I used to 'watchPosition' method for 'function getMylocation()'.
- function getMylocation(){
- firstTime=false;
- if(navigator.geolocation) {
- keycnt=navigator.geolocation.watchPosition(success,error2,geoOptions);
- } else {
- handleNoGeolocation(false);
- }
- }
It detect to your location is changed.
And I add option that 'enableHighAccuracy'.
- geoOptions={
- enableHighAccuracy : true,
- timeout: 5000,
- maximumAge: 0
- };
It option is Increases the accuracy of location.
No comments:
Post a Comment