它的最终解决方案:
RegionMapSkin.mxml:
<ibm:Scroller top="0" left="0" width="100%" height="100%" id="scroller" skinClass="com.ibm.ilog.elixir.skins.spark.ScrollerSkin">
<ibm:MapGroup id="mapGroup">
<ibm:MapFeatureGroup id="featureGroup"
featureRenderer="com.skins.DistrictRenderer" />
<ibm:MapDataGroup id="objectsGroup"
zoomable="false"
itemRenderer="com.skins.ObjectsRenderer"
dataProvider="{ObjectsModel.getInstance().items}" />
</ibm:MapGroup>
</ibm:Scroller>
对象渲染器.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:DataRenderer xmlns="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:ibm="http://www.ibm.com/xmlns/prod/ilog/elixir/2010"
left="{data.lon}"
top="{data.lat}">
<s:Label text="{data.title}"
color="#ffffff"
backgroundColor="#AB191A"
paddingLeft="3" paddingRight="3" paddingTop="4" paddingBottom="1"
top="-18" left="3"/>
<s:Ellipse width="6" height="6">
<s:fill>
<s:SolidColor color="#AB191A" />
</s:fill>
</s:Ellipse>
</s:DataRenderer>
DistrictRenderer 中的 onMouseClick 处理程序:
private function onMouseClick(e:MouseEvent):void
{
var mapFeature:MapFeature = MapFeatureRenderer(e.currentTarget).mapFeature;
var map:RegionMap = app.map;
var p:Point = new Point(e.localX, e.localY);
p = map.mapToLongLat(p);
ObjectsModel.getInstance().items.addItem({
'title': parameters.title,
'lon': parameters.lon,
'lat': parameters.lat
});
}