我希望我的网站注册用户在其个人资料页面中存储提供的 gmap 的位置(纬度和经度),我成功嵌入了谷歌地图,但不知道如何获取用户设置的 gmap 当前位置的纬度和经度…… 可选*当前缩放值 请帮忙
最佳答案
参见https://developers.google.com/maps/documentation/javascript/reference#Map
假设您的 map 存储在名为 map
的变量中,以下是获取 map 中心的方法(返回 LatLng):
map.getCenter()
Returns the position displayed at the center of the map. Note that this LatLng object is not wrapped. See LatLng for more information.
以及 map 的缩放级别(返回数字):
map.getZoom()
关于php - 需要有关谷歌地图嵌入的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9795065/