0

我在此页面上使用了“图标简单对象”代码:1)https://developers.google.com/maps/documentation/javascript/examples/icon-simple

对象坐标:38.481001,26.582399

当我在 Google 地图(此页面)上检查对象位置时:2) https://maps.google.com/maps?q=%2B38%C2%B0+48 '+10.01%22,+26%C2%B0+ 58'+23.39%22&um=1&ie=UTF-8&sa=N&tab=wl

对象位置显示在第 1 页和第 2 页上的不同位置。是否有任何 Google Api Map V3 问题?或者有什么问题?你能帮助我吗?谢谢你。

4

2 回答 2

0

Google Maps Javascript API v3采用十进制度坐标

+38° 48' 10.01", 26° 58' 23.39"

是 38 + (48/60) + (10.01/3600), 26 + (58/60) + (23.39/3600)

38.802780555555555555555555555556, 26.973163888888888888888888888889

谷歌地图显示的是:38.802745,26.973233

(不是 38.481001,26.582399)

于 2013-09-19T13:37:52.187 回答
0

使用这个脚本

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

google.maps.LatLng 对于当前位置非常重要

如何找到 google.maps.LatLng 的特殊位置?只使用谷歌地图。例如 https://www.google.com/maps/place/Oak+Forest+Heritage+Preserve/@41.5979032,-87.7048253,14z/data=!4m2!3m1!1s0x0000000000000000:0x6ebf1071640b2787

并设置 - >var latlng = new google.maps.LatLng(41.5979032, -87.7048253);
您可以设置缩放选项

map_canvas 是你的 div 位置

<script type="text/javascript">  
          function initialize() {  
            var latlng = new google.maps.LatLng(41.5979032, -87.7048253);  
            var myOptions = {  
              zoom: 15,  
              center: latlng,  
              mapTypeId: google.maps.MapTypeId.ROADMAP  
            };  

            var map = new google.maps.Map(document.getElementById("map_canvas"),  
                myOptions);  

            var marker = new google.maps.Marker({    
              position: new google.maps.LatLng(41.5979032, -87.7048253),    
              map: map    
            });  


          }  

        </script>

并设置正文标签 onload="initialize()"

<body onload="initialize()">

由 id map_canvas 设置的 div 标签

<div id="map_canvas"></div>
于 2015-01-21T16:03:59.003 回答