I am using navigator.geolocation.getCurrentPosition(success, error); to get the user's location in an https web page. I have also defined var map; ...as a global var.
The success function gets called, but inside that function it doesn't seem to recognize "map" as a global variable. I can initialize the map and set the location of the map inside the success function, but after the success function ends, "map" is undefined again. That causes any other events with map to fail.
How can I get the map variable to be recognized inside of the success function, or return position.coords.latitude ...and position.coords.longitude
...from the success function so I can initialize the map?