我在將標記添加到Google地圖標記Clusterer時遇到問題。螢火蟲返回錯誤:將標記添加到Google Maps clusterer時遇到問題
Error: Invalid value for property : [object Object]' when calling method: [nsIDOMEventListener::handleEvent]
標記與JavaScript代碼結構和PHP創建:
// loop starts here.......
var randLatLng = new google.maps.LatLng(<?php echo $lat; ?>, <?php echo $lon; ?>);
var marker_<?php echo $gauging["Gauging"]["id"]; ?> = new google.maps.Marker({
map: MyMap.map,
title: '<?php echo $gauging["Gauging"]["identification"]; ?>',
position: randLatLng,
draggable: false,
clickable: true,
icon: '/img/markers/yellow_Marker.png',
myId: 'gp_<?php echo $gauging["Gauging"]["id"]; ?>'
});
myMap.markers.push(marker_<?php echo $gauging["Gauging"]["id"]; ?>);
// loop ends here .......
var markerYellowCluster = new MarkerClusterer(myMap, yellowMarkers);
...這代碼創建的所有精細的標誌,但它並沒有將它們添加到人聚類。
你能給我一些建議,我可以解決這個問題嗎?
Tnx in adv!
更新:也許這可以幫助 - 警報(yellowMarkers);顯示警報窗口,以:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
可以喲你發佈php創建的輸出?你不必發佈標記的整個列表只有一個 – clem 2012-02-08 18:04:21
與PHP我只添加標記屬性,並且它工作正常。問題是我無法將創建的標記組合到標記聚類器中。你認爲哪一部分的PHP代碼可以幫助你? – user198003 2012-02-08 18:09:01