ArcGIS Api For Flex 动态画点和线
2020-12-13 04:10
标签:arcgis api flex import mx.controls.Alert; ArcGIS Api For Flex 动态画点和线,搜素材,soscw.com ArcGIS Api For Flex 动态画点和线 标签:arcgis api flex 原文地址:http://blog.csdn.net/shileimohan/article/details/37598677
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:supportClasses="com.esri.ags.skins.supportClasses.*" minWidth="955" minHeight="600" xmlns:esri="http://www.esri.com/2008/ags"
initialize="init()"
>
private var arr:Array=
[new MapPoint(123.361328,41.265625,new SpatialReference(5326)),
new MapPoint(123.720703,41.703125,new SpatialReference(5326)),
new MapPoint(123.431641,41.320313,new SpatialReference(5326)),
new MapPoint(123.646484,41.515625,new SpatialReference(5326)),
new MapPoint(123.763272,41.734675,new SpatialReference(5326)),
new MapPoint(123.248047,41.710938,new SpatialReference(5326)),
new MapPoint(124.248047,42.510938,new SpatialReference(5326)),
new MapPoint(123.748047,43.210938,new SpatialReference(5326)),
new MapPoint(123.748047,43.210938,new SpatialReference(5326))
];
private var polyine:Polyline=new Polyline();
private var graphicsLayer:GraphicsLayer=new GraphicsLayer();
private var grahpic:Graphic=new Graphic();
private function init():void
{
graphicsLayer.add(grahpic);
Map.addLayer(graphicsLayer);
}
private function PlayPoint(e:MouseEvent):void
{
graphicsLayer.clear();
var i:int=0;
var timer:Timer = new Timer(1000, arr.length-1);
timer.addEventListener(TimerEvent.TIMER, TimerMethod);
timer.start();
function TimerMethod(event:TimerEvent):void
{
var mps:Array=new Array;
var mpStat:MapPoint=arr[i] as MapPoint;
grahpic=new Graphic(mpStat,sps);
graphicsLayer.add(grahpic);
i=i+1;
}
}
private function PlayLine(e:MouseEvent):void
{
polyine=new Polyline();
var i:int=0;
var timer:Timer = new Timer(1000, arr.length-1);
timer.addEventListener(TimerEvent.TIMER, TimerMethod);
timer.start();
function TimerMethod(event:TimerEvent):void
{
var mps:Array=new Array;
var mpStat:MapPoint=arr[i] as MapPoint;
var mpEnd:MapPoint=arr[i+1] as MapPoint;
mps.push(mpStat);
mps.push(mpEnd);
polyine.addPath(mps);
grahpic=new Graphic(polyine,sls);
graphicsLayer.add(grahpic);
i=i+1;
}
}
]]>
color="0x00FF00"/>
size="12"
style="square"/>
上一篇:编程语言的发展史