Event that fires if the user does not allow using the location [duplicate]

青春壹個敷衍的年華 提交于 2019-12-23 06:22:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!