问题
Possible Duplicate:
google map - user choses not to allow location
I need to capture if the user does NOT allow the browser to grab thier location, and use a default set of corridinates to center the map.
How would I do this?
thank you
回答1:
gMap.setZoom(5);
gMap.setCenter(new google.maps.LatLng(44.44, -88.88));
gMap being your map. Above is how you center the map. I am guessing you have a flow that determines if they allow the browser to grab their location. At that point is where you would set the center. Can't grasp much of what you are doing from what you currently have.
来源:https://stackoverflow.com/questions/11961226/event-that-fires-if-the-user-does-not-allow-using-the-location