【问题标题】:Html5 geolocation in google maps api [duplicate]谷歌地图api中的Html5地理位置[重复]
【发布时间】:2014-08-02 13:01:47
【问题描述】:

当使用 html5 地理定位按下按钮时,我一直试图在某人的位置上创建一个谷歌地图中心。但我不知道它是如何工作的,而且我有太多其他事情要关注,所以如果有人能告诉我,那就太好了。

【问题讨论】:

  • 我不想浪费你宝贵的时间在你没有时间的时候阅读我的答案。反建议,你会写我的答案吗?因为我没有时间!

标签: javascript html google-maps-api-3


【解决方案1】:

【讨论】:

  • 感谢您的链接,但现在它显示“SyntaxError: missing ) after argument list”并且不起作用。我的代码是function initialize() { if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); } var mapOptions = { center: pos, //new google.maps.LatLng(51.762841,-2.2454), zoom: 6, mapTypeId: google.maps.MapTypeId.HYBRID };)}
  • 我不能用这个,对不起。你总是可以雇人为你做这件事……
  • 非常感谢您为我指明了正确的方向
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-04-10
  • 1970-01-01
  • 2013-11-16
  • 2017-01-03
  • 2013-10-01
  • 2014-08-07
  • 2015-04-07
相关资源
最近更新 更多