2013-10-03 76 views
1

我有位置经度和纬度的数据。我想在我的应用程序中将其显示在地图中。我计划使用Google地图向用户显示此位置。谷歌地图中的精确位置(经度和纬度)

要做到这一点,我需要Google Maps API吗?或Google地图协调中心? 我查看了他们的网站,但所有这些品种只是让我感到困惑。 我只需要它将数据(纬度和经度)显示到可视化(地图)中,以使我的应用程序更加便于用户使用。

我以前从未使用过Google Maps API,因此对于那些有经验的人,请指导我。

谷歌地图API:http://www.google.com/enterprise/mapsearth/products/mapsapi.html#

谷歌地图坐标:http://www.google.com/enterprise/mapsearth/products/coordinate.html?rd=1#

在一个侧面说明,我可能会出售的应用程序(使用订阅),所以我需要在谷歌地图API的许可证。任何人都知道它有多少,程序如何? (例如,每月或每年,每用户或每使用等)

EDIT

或者是有用于映射的任何其他API?就像Google Maps API一样。

+0

[This](https://developers.google.com/maps/documentation/javascript/markers)应该有所帮助。 – Aarowaim

+0

是的,这看起来像我所需要的。根据经纬度标记位置以显示给用户。那么这是使用Google Maps API? – shinega

+0

如果您只是想显示地图,您可能只需使用[静态地图API](https://developers.google.com/maps/documentation/staticmaps/)即可。 – duncan

回答

3

我们必须给予经纬度。

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> 
<script type="text/javascript"> 
    window.onload = function() { 
     var mapOptions = { 
      //give latitude and long 
      center: new google.maps.LatLng("18.9750", "72.8258"), 
      zoom: 8, 
      mapTypeId: google.maps.MapTypeId.ROADMAP 
     }; 
     var infoWindow = new google.maps.InfoWindow(); 
     var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions); 
      //give latitude and long 
     var myLatlng = new google.maps.LatLng("18.9750", "72.8258"); 
     var marker = new google.maps.Marker({ 
      position: myLatlng, 
      map: map, 
      title: "Mumbai" 
     }); 
    } 
</script> 

<div id="dvMap" style="width: 500px; height: 500px"> 
相关问题