ArcGIS Api For Flex 动态画点和线
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
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()"
>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.geometry.Polyline;
import com.esri.ags.layers.GraphicsLayer;
import com.esri.ags.symbols.SimpleLineSymbol;
import com.esri.ags.symbols.SimpleMarkerSymbol;
import mx.controls.Alert;
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;
}
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(比如服务、值对象)放在此处 -->
<esri:SimpleLineSymbol id="sls"
width="3"
color="0x00FF00"/>
<esri:SimpleMarkerSymbol id="sms"
color="0x00FF00"
size="12"
style="square"/>
<esri:PictureMarkerSymbol id="sps" source="http://localhost/Red_glow.swf" width="20" height="20" />
</fx:Declarations>
<esri:Map id="Map" >
<esri:ArcGISDynamicMapServiceLayer url="xxx "/>
</esri:Map>
<mx:ControlBar width="100%" top="0" left="0" paddingTop="0" paddingBottom="0" horizontalAlign="left" >
<mx:Button label="開始点轨迹" width="100" fontSize="12" click="PlayPoint(event)"/>
<mx:Button label="開始线轨迹" width="100" fontSize="12" click="PlayLine(event)"/>
</mx:ControlBar>
</s:Application>
ArcGIS Api For Flex 动态画点和线的更多相关文章
- ArcGIS API for Flex实现GraphicsLayer上画点、线、面。
目的: ArcGIS API for Flex实现GraphicsLayer上画点.线.面. 准备工作: 1.这次地图数据就用Esri提供的http://server.arcgisonline.com ...
- arcgis api for flex之专题图制作(饼状图,柱状图等)
最近公司给我一个任务,就是利用arcgis api for flex实现在地图上点(业务数据)直接显示饼状图以及柱状图的专题图制作,而不是通过点击点显示气泡窗口的形式来实现,这个公司已经实现了. 经过 ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十)态势标绘模块
config.xml文件的配置如下: <widget label="态势标绘" icon="assets/images/impact_area_over.png&q ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(一)GIS一张图的系统开发环境以及flexviewer框架
系统的GIS功能实现是基于arcgis api for flex,首先附上系统的主界面图,接下来的是对主界面的模块功能详细讲解: 一.GIS环境软件安装 (1)arcgis desktop的安装,要是 ...
- Clustering with the ArcGIS API for Flex
Clustering is an excellent technique for visualizing lotss of point data. We've all seen application ...
- ArcGIS API for Silverlight动态标绘的实现
原文:ArcGIS API for Silverlight动态标绘的实现 1.下载2个dll文件,分别是: ArcGISPlotSilverlightAPI.dll 和 Matrix.dll 其下载地 ...
- arcgis api for flex 开发入门(一)环境搭建
http://www.cnblogs.com/wenjl520/archive/2009/06/02/1494514.html arcgis api for flex 开发入门(一)环境搭建arcgi ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十三)台风模块
config.xml文件的配置如下: <widget label="台风" icon="assets/images/typhoon.png" config ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十一)路径导航模块
config.xml文件的配置如下: <widget label="路径导航" icon="assets/images/lujingdaohang.png" ...
随机推荐
- 个人学习源码的 HBase误区的总结 与 架构图
HDFS 的备份功能不是给 基于 HBase 等 基于HDFS 的项目做备份的. 如果 HBase 需要备份,那么久需要设置 备份(快照 )功能. HMaster . kafka 等无主结构并 ...
- UITextView自己定义键盘和系统键盘
UITextView有inputView 和 inputAccessoryView 两个属性,都指定了对应的视图. inputAccessoryView 对象显示在 inputView 对象的上面.与 ...
- bug14052601
AppDelegate.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall cocos2d::ui::Margin::Margin(void ...
- 新一代企业即时通信系统 -- 傲瑞通(OrayTalk)
傲瑞通(OrayTalk)是我们为企业专门打造的新一代企业即时通讯平台,功能强大丰富.像组织结构.文字/语音/视频会话.文件传送.远程协助.消息记录等功能都有,而且留有接口可与企业遗留系统进行集成. ...
- session和cookie详解
摘要:虽然session机制在web应用程序中被采用已经很长时间了,但是仍然有很多人不清楚session机制的本质,以至不能正确的应用这一 技术.本文将详细讨论session的工作机制并且对在Java ...
- [UOJ#334][NOIP2017]列队 平衡树/线段树/树状数组
题目链接 题意不说了,一辈子也忘不掉 解法1.平衡树 这题就是平衡树裸题,每一行开一棵维护前 \(m-1\) 个,最后一列单独维护,因为很多人没有用到,所以平衡树每个节点是一个区间(pair),分裂时 ...
- linux添加开机启动项的方法介绍
使用chkconfig命令可以查看在不同启动级别下课自动启动的服务(或是程序),命令格式如下:chkconfig --list可能输出如下:openvpn 0:关闭 1:开启 ...... 6:关闭 ...
- Android App中使用Gallery制作幻灯片播放效果
http://www.jb51.net/article/83313.htm 我们有时候在iPhone手机上或者Windows上面看到动态的图片,可以通过鼠标或者手指触摸来移动它,产生动态的图片滚动效果 ...
- @Html.Raw() 方法输出带有html标签的字符串
@Html.Raw() 方法输出带有html标签的字符串,如:@Html.Raw("<div style='color:red'>输出字符串</div>") ...
- HDU 4847 Wow! Such Doge!
Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...