【问题标题】:Google Map API - update lat/long infoGoogle Map API - 更新纬度/经度信息
【发布时间】:2011-11-29 14:55:26
【问题描述】:

我正在为一家公司进行站点更新,其中包括为新位置添加新的 Google 地图。

我需要用新的经度和纬度坐标更新下面的代码,但不知道如何根据地址生成它们。

<script type="text/javascript">
    //<![CDATA[

    function gmap_load() {

    function createMarker(point, html, labeltext) {
     var marker = new GMarker(point, {title:labeltext});
     GEvent.addListener(marker, "click", function() {
       marker.openInfoWindowHtml(html);
     });
     return marker;
    }

      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("googlemap"));
        map.setCenter(new GLatLng(51.71,-1.96), 11);
        map.addControl(new GLargeMapControl());
        map.addControl(new GScaleControl());

        var point = new GLatLng(51.71448,-1.97357);
        marker = createMarker(point, 
        "<div class=smalltext>David Lloyd,<br>Latham Road,<br>Blunsdon,<br>Swindon.<br>SN25 4DL</ div>", "Swindon clinic");
        map.addOverlay(marker);

      }
    }

    //]]>
    </script>

【问题讨论】:

  • 看起来你的一些代码在创建这个问题时被剪掉了。您需要修复它,我们才能为您提供帮助。
  • 对不起,约翰 - 感谢您让我知道。我现在已经解决了上面的问题。我现在要显示的地址在 div 的末尾有说明。谢谢
  • 这是 API v2。重新标记问题。
  • “我如何计算出要在代码中替换的 long/lat” - 我不明白这个问题。你有什么问题?
  • 上面的代码显示了一个旧地图坐标。我只更新了底部的地址。我需要获得正确的 GLatLng 数字。谢谢

标签: google-maps google-maps-api-2


【解决方案1】:

找到为您提供我需要的数据的网站:http://universimmedia.pagesperso-orange.fr/geo/loc.htm

谢谢

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-24
    • 1970-01-01
    • 2013-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-16
    • 2018-06-26
    相关资源
    最近更新 更多