2013-10-03 78 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"> 
相關問題