Clustering with the ArcGIS API for Flex
Clustering is an excellent technique for visualizing lotss of point data. We've all seen applications where there were so many points that simply appear as one big blob.Clustering takes the individual points and groups them into clusters and then renders the cluster as one graphic.In this post I will describe how you can use ArcGIS API for Flex to create clustering demo.
First,I add 500 random points in the map of tianditu.(There tell you how to create tianditu use ArcGIS API for Flex)
// 往地图上添加点
protected function addPointsToMap(cluseter:WeightedClusterer):void
{
var graphicsLayer:GraphicsLayer = new GraphicsLayer(); for(var i:int = ; i < ; i++)
{
// 产生随机数
var num: Number = Math.round(Math.random() * );
var num2: Number = Math.round(Math.random() * ); // 产生随机颜色
var index: Number = Math.round(Math.random() * );
var colors: Array = ["0xFF00FF", "0x0000FF", "0x000000", "0x008000", "0x800000"];
var color:Number = parseInt(colors[index]); var sym:SimpleMarkerSymbol = new SimpleMarkerSymbol("circle",,color); var geo:MapPoint = new MapPoint(120.13102 - num * 0.01, 30.19089 - num2 * 0.01);
var graphic:Graphic = new Graphic(geo,sym);
graphicsLayer.add(graphic); } myMap.addLayer(graphicsLayer);
}
And then, I create the Cluster.
// 文本格式
var tf:TextFormat = new TextFormat("Arial",,0xE6E6E6); // 创建FlareSymbol
var flareSymbol:FlareSymbol = new FlareSymbol();
flareSymbol.backgroundAlphas = [0.7,1.0];
flareSymbol.backgroundColor = 0x394B8C;
flareSymbol.backgroundColors = [0x5B8C3E,0xBF2827];
flareSymbol.borderColor= 0x666666;
flareSymbol.flareMaxCount=;
flareSymbol.flareSizeIncOnRollOver=;
flareSymbol.sizes=[,];
flareSymbol.textFormat=tf;
flareSymbol.weights=[,]; // 创建Clustering
var cluseter:WeightedClusterer = new WeightedClusterer();
cluseter.sizeInPixels = ;
cluseter.symbol = flareSymbol;
cluseter.center = new MapPoint(117.02263, 28.28375,new SpatialReference());
At last, add cluseter to graphic.
graphicsLayer.clusterer = cluseter;
The effect is like it.

Download source here.
Clustering with the ArcGIS API for Flex的更多相关文章
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十)态势标绘模块
config.xml文件的配置如下: <widget label="态势标绘" icon="assets/images/impact_area_over.png&q ...
- arcgis api for flex之专题图制作(饼状图,柱状图等)
最近公司给我一个任务,就是利用arcgis api for flex实现在地图上点(业务数据)直接显示饼状图以及柱状图的专题图制作,而不是通过点击点显示气泡窗口的形式来实现,这个公司已经实现了. 经过 ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(一)GIS一张图的系统开发环境以及flexviewer框架
系统的GIS功能实现是基于arcgis api for flex,首先附上系统的主界面图,接下来的是对主界面的模块功能详细讲解: 一.GIS环境软件安装 (1)arcgis desktop的安装,要是 ...
- ArcGIS API for Flex实现GraphicsLayer上画点、线、面。
目的: ArcGIS API for Flex实现GraphicsLayer上画点.线.面. 准备工作: 1.这次地图数据就用Esri提供的http://server.arcgisonline.com ...
- 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" ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(四)地图导航控件模块
config.xml文件的配置如下: <widget left="10" top="50" config="widgets/Navigation ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(三)显示地图坐标系模块
config.xml文件的配置如下: <widget left="3" bottom="3" config="widgets/Coordinat ...
随机推荐
- FlashBuilder使用
打开调用层次视图,显示当前类.变量被谁调用,右侧显示调用位置. ctrl+alt+H 快捷键 导航即浏览菜单中,单击. 右键单击打开. 为组件生成事件处理函数 组件==控件,按钮等.右侧属性,又叫属性 ...
- VG.net矢量图和矢量动画开发平台拓扑图软件免费下载
VG.net拓扑图软件是一个基于.net平台的矢量图开发工具,可广泛应用于包括:电力.军工.煤炭.化工.科研.能源等各种监控软件.工作流设计器.电力.化工.煤炭.工控组态软件.仿真.地理信息系统.工作 ...
- UIkit框架之UISegmentedControl
1.继承链:UIcontrol:UIview:uiresponder:NSObject 2.初始化 (1)- (instancetype)initWithItems:(NSArray *)items ...
- MySQL 数据库实现远程连接
1,刚开始我使用的是Navicat for MySQL工具连接远程的mysql的数据库. 报错了.报错信息是 Error 1130: Host '192.168.1.80' is not allowe ...
- Smart210学习记录------nor flash驱动
nor flash驱动与nand flash驱动的差别不大,只是设置不同的结构体而已,, nor flash驱动代码: #include <linux/module.h> #include ...
- (基础篇)echo、print、print_r、printf、sprintf、var_dump的区别比较
一.echo echo() 实际上不是一个函数,是php语句,因此您无需对其使用括号.不过,如果您希望向 echo() 传递一个以上的参数,那么使用括号会发生解析错误.而且echo是返回void的,并 ...
- hdu 4336 Card Collector
dp+状态压缩 #include<cstdio> using namespace std; ]; <<]; int main() { int n; while(scanf(&q ...
- Embedded database support
http://docs.spring.io/spring-framework/docs/3.0.0.M4/reference/html/ch12s08.html <jdbc:embedd ...
- HackerRank "Prim's (MST) : Special Subtree"
An intuitive Prim algorithm impl. #include <vector> #include <iostream> #include <que ...
- Swagger+Spring mvc生成Restful接口文档
简介 Swagger 是一个规范和完整的框架,用于生成.描述.调用和可视化 RESTful 风格的 Web 服务.总体目标是使客户端和文件系统作为服务器以同样的速度来更新.文件的方法,参数和模型紧密集 ...