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 ...
随机推荐
- WCF服务开发与调用的完整示例
WCF服务开发与调用的完整示例 开发工具:VS2008 开发语言:C# 开发内容:简单的权限管理系统 第一步.建立WCF服务库 点击确定,将建立一个WCF 服务库示例程序,自动生成一个包括IServi ...
- <input type="file">中怎设置那个按钮的样式
最近才开始学习HTML,在练习表单的过程中,发现在使用<input type="file"/>这个类型的元素,产生的文件框和浏览按扭,它们的样式往往不符合我们的需要.怎 ...
- Bean property '**DAO' is not writable or has an invalid setter method
ApplicationContext.xml中配置有问题,里面的bean的属性名称写错了. ApplicationContext.xml中写的是loginDAO,在java类里配置的bean却写成了l ...
- Android中build target,minSdkVersion,targetSdkVersion,maxSdkVersion概念区分 (转载)
本文参考了谷歌开发者文档:http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#provisional 如果 ...
- 使用查询(SQ01、SQ02、SQ03)创建报表
查询需求说明 通过Query(SQ01.SQ02.SQ03)实现根据销售组织查询销售订单中的各项信息,包括物料.金额.成本,以及毛利. 其中对销售组织进行权限检查(Authority Check),字 ...
- Java多线程之ConcurrentSkipListMap深入分析(转)
Java多线程之ConcurrentSkipListMap深入分析 一.前言 concurrentHashMap与ConcurrentSkipListMap性能测试 在4线程1.6万数据的条件下, ...
- android使用Webview上传图片
package com.example.webview; import java.io.File; import android.net.Uri;import android.os.Bundle;im ...
- Oracle创建、删除表空间、用户
1.创建临时表空间 create temporary tablespace linshi tempfile 'e:\linshi.dbf' size 50m autoextend on next 50 ...
- python set集合操作
set集合是一个无序且不重复的集合. 创建一个set集合: name = set('sdd') name 返回结果:{'d', 's'} add 功能:增加集合元素 name = {'d', 's'} ...
- 【转】Android M(6.0) 权限爬坑之旅
原文网址:https://yanlu.me/android-m6-0-permission-chasm/ 有一篇全面介绍Android M 运行时权限文章写的非常全面:Android M 新的运行时权 ...