我遇到了Google Maps API的問題。我需要在Google地圖上顯示200個標記。所以我這樣做:Google地圖API標記
$gmap->addMarkerByAddress(location,type,picture);
對於我所有的不同標記。然後我這樣做:
$gmap->generate();
echo $gmap->getGoogleMap();
它運作良好,但它需要很長時間來顯示地圖。我想生成地圖,然後在地圖上逐個顯示標記,這樣用戶不必等待3分鐘即可看到結果。 任何想法我可以做到這一點? 非常感謝!
編輯: 額外的代碼:
$gmap = new GoogleMapAPI('thisismykey');
(你可以發現GoogleMapAPI這裏的內容:frenchtoast.fr/friendsmap/examples/GoogleMapAPIclass.txt)然後所有的初始化:
$gmap->setDivId('test1');
$gmap->setDirectionDivId('route');
$gmap->setEnableWindowZoom(false);
$gmap->setEnableAutomaticCenterZoom(true);
$gmap->setDisplayDirectionFields(true);
$gmap->setSize(600,600);
$gmap->setZoom(3);
$gmap->setDefaultHideMarker(false);
我加入我的200個標誌物:
$gmap->addMarkerByAddress(location,type,picture);
然後如果使用V2,那麼我會用MarkerClusterer或KML覆蓋嘗試生成地圖
$gmap->generate();
echo $gmap->getGoogleMap();
這將需要更長的時間向他們展示一個 – 2012-01-18 01:10:26
一個這不是真的很重要,因爲用戶將能夠看到的結果的演變。它不會成爲3分鐘的空白頁面... – 2012-01-18 01:13:35
解決這個問題的唯一方法是需要發佈更多代碼。無論如何,這是不可能的,無需更多的代碼就可以幫助你。 – 2012-01-18 01:16:21