2011-05-09 77 views

回答

0

您可以使用這樣的事情:

[Embed(source="assets/MyIcon.png")] private var myIcon:Class; //defines the marker icon to be used 

。 。 。

//然後在你的代碼中。

var optObj:Object = new Object(); 
optObj.icon = new myIcon(); // instance of the myIcon Class 
optObj.iconOffset = new Point(-11.5, -17.5); // this is optional, to set center of icon visually 
optObj.draggable = true; // this option makes draggable Icon 
var latlng = new LatLng(xxx, xxx); // replace xxx with your lat/lng values. 
var marker:Marker = new Marker(latlng, new MarkerOptions(tmpObj)); 
map.addOverlay(marker); // adds the marker to your overlay 

這是我做的方式,希望你覺得它有用。

問候。

奧馬爾古茲曼。

0

我不認爲你可以使用多邊形作爲標記圖標,雖然我沒有嘗試過。 MarkerOptions類讓你指定一個DisplayObject來代替默認的氣泡標記......這可能是你最簡單的解決方案。

如果你想要一個更復雜的Marker,你可以做的一件事就是創建你自己的擴展Marker的CustomMarker類。這樣你可以添加額外的功能。

劉易斯

相關問題