Reputation: 30556
I am using the google maps API to gain a users location:
https://developers.google.com/maps/documentation/geolocation/intro
To test this I would like to fake the location however setting chromes geo location does not work as it seems to ignore this.
Upvotes: 1
Views: 5853
Reputation: 2784
In the maps api itself you can't fake the position because it uses the geolocation functionality of your browser. If you want to fake your geolocation in Chrome you can do it like this:
Press F12 to open the Developer Console. Change to the tab Console and open the menu with the 3 dots icon. Select More Tools --> Sensors and change the default value for the Geolocation from "No override" to a preset or enter own coordinates. Now reload the page and see how it works.
I tested it right now on this Google Geolocation Tutorial page and inside an own application with Google maps. Good luck!
It works the same way in:
Different for:
Upvotes: 1