2013-03-06 33 views

回答

0

是的。這是使用地圖的更爲標準的方法之一。

對於位置來說,您需要長時間放置地圖並放置標記(可能是例如公司徽標的自定義圖像)。

只需按照任何教程。他們都展示瞭如何做到這一點。

0

如果要顯示一個具有參考編號的業務,請使用PlacesService

您還需要在API網址中包含位置庫。

e.g

// I assume the map is already loaded and defined as variable called map 
var placesService = new PlacesService(); 

placesService.getDetails({reference: placeReferenceNumber}, function(place, status) { 
    if (status === google.maps.places.PlacesServiceStatus.OK) { 
     var marker = new google.maps.Marker({ 
      map: map, 
      position: place.geometry.location 
     }); 
     // Warning: Viewport may not always be defined 
     map.setBounds(place.geometry.viewport); 
    } 
}); 
+0

我已經試過了,但位置只是用來加載地圖上的企業的名稱。我試圖獲得類似於谷歌地圖上顯示的數據,即。姓名,地址,電話號碼,評論,圖片 – 2013-03-06 18:09:47

+0

@JustinEhlert查看地點對象的屬性。我只使用了我的例子中的位置,但它擁有您需要的一切。 [文檔](https://developers.google.com/maps/documentation/javascript/reference#PlaceResult) – 2013-03-07 05:16:28

相關問題