這裏是基本的代碼,我把它剪直出:谷歌地圖API V3 - 標記陰影消失
var loadposition = new google.maps.LatLng(<?=$feed['location'][0]?>,<?=$feed['location'][1]?>);
var markerSize = new google.maps.Size(20,34);
var houseMarker = new google.maps.MarkerImage("marker2.png",markerSize);
var markerShadowSize = new google.maps.Size(30,34);
var markerShadowPoint = new google.maps.Point(30,0);
var markerShadowAnchor = new google.maps.Point(0,35);
var houseMarkerShadow = new google.maps.MarkerImage("marker2.png",markerShadowSize,markerShadowPoint,markerShadowAnchor);
marker = new google.maps.Marker({
position:loadposition,
title:"<?=$feed['name']?>",
draggable:false,
clickable:true,
icon:houseMarker,
shadow:houseMarkerShadow
});
marker.setMap(map);
google.maps.event.addListener(marker, 'click', function(e){
var loadposition = new google.maps.LatLng(<?=$feed['location'][0]?>,<?=$feed['location'][1]?>);
var htmlContent = "<?=$feed['name']?><br/><?=$feed['address']?>";
infowindow.setPosition(loadposition);
infowindow.setContent(htmlContent);
infowindow.open(map);
});
出於某種原因,陰影不顯示。但是,如果我啓用拖放和/或設置標記動畫(反彈或放下),陰影就會顯現出來。一旦標記放下,陰影消失。
我找不到任何其他文檔或類似的問題/答案。
謝謝
不知道爲什麼這是投下來的,這是在發佈時的實際錯誤... https://code.google.com/p/gmaps-api-issues/issues/detail?id=3993 – 2015-06-16 02:40:41