我有以下代碼,它是Google Maps V3上的自定義圖標。我想用jQuery.Rotate插件旋轉它。Google Maps v3 MarkerImage&jQuery.Rotate
var image = new google.maps.MarkerImage(
"markers/test.png",
new google.maps.Size(52, 52), // size
new google.maps.Point(0, 0), // origin
new google.maps.Point(20, 0) // anchor
);
marker = new google.maps.Marker(
{
map: map,
draggable: false,
position: markerData[i].latLng,
visible: true,
icon: image,
optimized: false
});
問題是jQuery.Rotate是想要的DOM ID來識別旋轉元素.. Markerimage沒有一個,我不能指定。
例如,
<img src="img" id="image">
$("#image").rotate(15);
誰能告訴我一些示例代碼,讓我要麼分配一個ID,MarkerImage使jQuery.Rotate可以使用它如。 #image假設id是id =「image」,還是有另一種告訴jQuery.Rotate使用MarkerImage而不是指向DOM元素的方法?
任何幫助,將不勝感激..如果我找不到這個答案,我需要創建360個版本的同一個圖標我使用的每個圖標有很多。我更喜歡使用這個特殊的插件。希望有一個簡單的答案。
如果任何人能夠協助這個,它將不勝感激。如果有更簡單的方法,我真的不想創建數百個圖標。 – gleff 2012-08-02 07:45:31
你見過這個嗎? http://stackoverflow.com/questions/2065485/get-dom-element-of-a-marker-in-google-maps-api-3 – Stephan 2012-10-22 14:57:49