2014-09-22 38 views
17

我需要在嵌入地圖上放置幾個由座標指定的標記。我知道如何做一個標記,但不知道多個。嵌入多個標記的谷歌地圖API

<iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" 
     src="https://www.google.com/maps/ms?msid=204293175747830583907.0005022420ef3bca6a816&msa=0&ie=UTF8&t=m&ll=40.79042,-73.945541&spn=0.462677,1.056747&output=embed"></iframe> 

回答

35

你不能用google地圖嵌入iframe來做到這一點。

您或者需要使用Google Maps地圖製作工具(http://www.google.com/maps/mm)來做,或者您需要使用Google Maps API(https://developers.google.com/maps/)。

Google Maps地圖製作工具的缺點是您需要手動返回並隨時重新創建您的地圖,以便進行更改。

我建議使用Google Maps API。

這是一個偉大的小教程,顯示你一個簡單的地圖使用谷歌地圖API的多個標記 - http://wrightshq.com/playground/placing-multiple-markers-on-a-google-map-using-api-3/

+0

感謝您的回答,我一直在使用GMAP API V3解決了這個問題:) – 2015-01-08 14:46:11

+1

你的最後一個環節是破碎。 – RareNCool 2016-11-08 18:47:36

+0

本教程的鏈接正常工作,解釋瞭如何「在Google地圖上放置多個標記(使用API​​ 3)」:-) – 2017-07-13 13:00:21