sample code from the docs

Sample code copied directly from plugin docs file
cordova-plugin-geolocation/doc/ ndex.md at
https://github.com/apache/cordova-plugin-geolocation