Is there a way to use the "My location" button that exist on Google Maps in your own webbapplication using the javascript api?
I have read about adding controls here Google Maps Javascript API V3 Controls but I haven't found anything about the "My locaton" control.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There's currently no geolocation button in Google Maps API v3. But it's not difficult to implement one yourself.
Information about implementing geolocation can be found in the Google Maps Javascript API documentation.
If you want to add a geolocation button as a map control, read the Custom Controls section of the Google Maps documentation.