基于ArcGIS Flex API实现动态标绘(1.0)
发布时间:2020-12-15 03:42:24 所属栏目:百科 来源:网络整理
导读:标绘作为一种数据展示形式,在多个行业都有需求。基于ArcGIS Flex API(3.6)实现标绘API,当前版本1.0 alpha,支持常用几种标绘符号,包括: 圆
标绘作为一种数据展示形式,在多个行业都有需求。基于ArcGIS Flex API(3.6)实现标绘API,当前版本1.0 alpha,支持常用几种标绘符号,包括: 圆弧、曲线、圆形、椭圆、弓形、扇形、闭合曲线、集结地、直箭头、细直箭头、突击方向、进攻方向、进攻方向(尾)、钳击、分队战斗、分队战斗(尾) 目前仅支持绘制,接口设计简单,几行代码即可,如下: import com.esri.ags.symbols.SimpleFillSymbol; import com.esri.ags.symbols.SimpleLineSymbol; import gispace.plot.FillPlot; import gispace.plot.LinePlot; import gispace.plot.PlotTypes; import gispace.plot.events.PlotDrawEvent; import gispace.plot.tools.PlotDrawTool; private var plotDrawTool:PlotDrawTool; private var lineSymbol:SimpleLineSymbol = new SimpleLineSymbol("solid",0x0000ff,1,2); private var outline:SimpleLineSymbol = new SimpleLineSymbol("solid",0xff0000,1); private var fillSymbol:SimpleFillSymbol = new SimpleFillSymbol("solid",0x00ff00,0.5,outline); private function init():void{ // 实例化 this.plotDrawTool = new PlotDrawTool(map); // 监听 DRAW_END事件,绘制结束后可获得plot this.plotDrawTool.addEventListener(PlotDrawEvent.DRAW_END,drawEndHandler); } private function drawEndHandler(event:PlotDrawEvent):void{ // 对plot设置渲染符号 if(event.plotGraphic.geometry is FillPlot) event.plotGraphic.symbol = fillSymbol; else if(event.plotGraphic.geometry is LinePlot) event.plotGraphic.symbol = lineSymbol; this.graphicsLayer.add(event.plotGraphic); } demo下载地址:最新版本 效果图: 下一版本提供的功能: 1)标绘符号的编辑; 2)更多类型的标绘符号,包括常用的点、线、面。 欢迎大家使用、反馈意见,此API会持续更新。 联系方式:QQ:21587252 ?email:gispace@yeah.net (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |