http://rickgutierrez.bol.ucla.edu/map_mobile6.htm
The map is set up to load centered on the users current location. If the user denies the geolocation request, the map is not opening. How do I get the map to open on
center: new google.maps.LatLng( 34.05221496568917, -118.24334979057312 ),
if the user denies the geolocator access to their location? Right now I have an error function that opens a prompt with an error message when the geolocation is denied or fails. I am guessing that I should replace that function with a function that has the above coordinates but how do I feed those to the function that creates the map and centers it on those coordinates?
Thank You
Create a custom position-object from the desired coordinates:
You now may call displayLocation with that object as argument, e.g:
You should also take a look at this: How to detect negative user response for geolocation