原创arcgis server flex 实现在地图上绘制折线图,效果图:
代码:利用arcgis的infosysbol 用LineChart来渲染,数据从Graphic的attributes来进行传递
<?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:esri="http://www.esri.com/2008/ags" pageTitle="infosymbol" creationComplete="application1_creationCompleteHandler(event)" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Style> .RightStyle { borderThickness: 1; info-placement:center; borderColor: #000005; backgroundColor: #ffffff; paddingLeft: 5; paddingRight: 5; paddingTop: 5; paddingBottom: 5; border-alpha:0; background-alpha:0; } </fx:Style> <fx:Script> <![CDATA[ import com.esri.ags.Graphic; import com.esri.ags.geometry.MapPoint; import com.esri.ags.utils.WebMercatorUtil; import mx.collections.ArrayCollection; import mx.events.FlexEvent; [Bindable] private var valueAC:ArrayCollection = new ArrayCollection( [ { hour: "1", value: 1500 }, { hour: "2", value: 200 }, { hour: "3", value: 500 }, { hour: "4", value: 1200 }, { hour: "5", value: 575 } ]); [Bindable] private var valueAC2:ArrayCollection = new ArrayCollection( [ { hour: "1", value: 1000 }, { hour: "2", value: 500 }, { hour: "3", value: 700 }, { hour: "4", value: 1200 }, { hour: "5", value: 300 } ]); protected function application1_creationCompleteHandler(event:FlexEvent):void { map.extent=WebMercatorUtil.geographicToWebMercator(extent) as Extent; darwPointPloygon(); } private function darwPointPloygon():void { var point:XML; for each(point in points) { var mp:MapPoint=WebMercatorUtil.geographicToWebMercator(new MapPoint(point.@x,point.@y)) as MapPoint; var myAttributes:Object = {}; myAttributes.text=point.@text; myAttributes.datap=valueAC; if(point.@text=="point2" || point.@text=="point4"){ myAttributes.datap=valueAC2; } var infosys:InfoSymbol=new InfoSymbol(); infosys.containerStyleName="RightStyle"; infosys.infoRenderer=myInfoSymbol.infoRenderer; var g:Graphic = new Graphic(mp, infosys, myAttributes); infoPointglayer.add(g); } } ]]> </fx:Script> <fx:Declarations> <fx:XMLList id="points"> <point text="point1" x="118" y="26" /> <point text="point2" x="116" y="30" /> <point text="point3" x="113" y="25" /> <point text="point4" x="105" y="22" /> </fx:XMLList> <esri:InfoSymbol id="myInfoSymbol"> <esri:infoRenderer> <fx:Component> <s:DataRenderer> <mx:LineChart id="linechart" height="100" width="100" paddingLeft="5" paddingRight="5" showDataTips="true" dataProvider="{data.datap}"> <!--categoryField:横坐标数据节点--> <mx:horizontalAxis> <mx:CategoryAxis id="h1" categoryField="hour" /> </mx:horizontalAxis> <!--yField:纵坐标数据节点--> <mx:series> <!--纵坐标轴1--> <mx:LineSeries id="cs1" horizontalAxis="{h1}" form="curve" yField="value" displayName="时间(h)/降水量(MM)"> <mx:lineStroke> <mx:SolidColorStroke id = "s2" color="blue" weight="2"/> </mx:lineStroke> </mx:LineSeries> </mx:series> </mx:LineChart> </s:DataRenderer> </fx:Component> </esri:infoRenderer> </esri:InfoSymbol> <esri:Extent id="extent" xmin="27.25" ymin="59.01" xmax="174.38" ymax="-2.07"> <esri:SpatialReference wkid="4326"/> </esri:Extent> </fx:Declarations> <esri:Map id="map" level="4"> <esri:ArcGISTiledMapServiceLayer url="http://cache1.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineStreetColor/MapServer"/> <esri:GraphicsLayer id="infoPointglayer" /> </esri:Map> </s:Application>
相关推荐
通过几天的研究终于可以用arcgis for flex 在地图上显示柱状图 饼状图和折线图
Arcgis server flex FeatureLayer 渲染用法
arcgis server flex API 函数及调用实例 FLEX 地图实例
里面包括调用百度地图的简单例子的实现类,和一篇详细介绍的文档,都是自己写的,代码类实现基于网上的一段代码。
基于arcgis for flex实现的地图卷帘特效,所有地图采用arcgis在线地图服务,只是用作效果切换
Arcgis server for flex 如何调用google地图
ArcGIS Server Flex 应用视频
(五)ArcGIS.Server.9.3和ArcGIS API for Flex实现GraphicsLayer上画点、线、面 20 (六)ArcGIS.Server.9.3和ArcGIS API for Flex实现Identify的功能图查属性 25 (七)ArcGIS.Server.9.3和ArcGIS API for Flex实现...
ArcGIS Server开发指南基于Flex和.Net数据随书光盘内容.分两个文件上传。
List of ArcGIS API for Flex 1.2 packages. See the Adobe Flex 3 Language Reference at http://livedocs.adobe.com/flex/3/langref/ for Adobe Flex 3 packages. Package Description ...
ArcGIS Server开发指南--基于Flex和.NET源码每一部分
arcgisserver + flex,在地图中绘制军标
ArcGIS Server Flex API 1.3 离线帮助
arcgis api for flex 开发入门(三)地图浏览控件的使用
解决arcgis server跨域问题: 1、停掉ArcGIS Server的服务。 2、 打开<ArcGIS Server> \framework\runtime\tomcat\conf\web.xml,注册跨域bean 3、lib下拷贝 cors-filter-2.5.jar java-property-utils-1.9.1.jar包 4...
ArcGIS For Flex 地图联动
arcgis server flex开发:WeightedClusterer聚类和GridClusterer聚类的用法, 效果不同。在地图上点击,每点击一次都增加一个点,这些点聚类时使用两种不同的方法效果差别很明显。
我把ArcGIS Server Flex API 2.2Reference(http://help.arcgis.com/en/webapi/flex/apiref/index.html)这个页面的抓下来了,没有做深层测试,随手点了几下都没有问题,欢迎下载使用 不知为什么IE有问题,请大家...
ArcGIS Server Flex API 1.3 参考,很实用的FLEX结合ARCGIS帮助文档
详尽的介绍了flex for arcgisserver开发,适合初次接触flex开发的程序员