最近研究heatMap,发现一个西安建筑科技大学的牛人,在2009年就最的很好了,针对ESRI的 Arcgis Flex API 做的heatMap extention,据说ESRI不大喜欢,卖给了美国另外一家公司,但是这家公司不大喜欢开源,所以,看看效果吧,
http://www.umapper.com/maps/view/id/29118/
还有他本人做的关于猪流感的heatmap
http://www.geoinformatics.cn/lab/swineflu/

经过一段时间的资料搜寻,发现用过heatmap技术的有:
一.基于Flex技术
1.基于ArcGIS Flex API的heatMap图层
2.扩展UIComponent,实现heatMap层
3.扩展Sprite实现heatMap层(用于在GoogleMap flex API上通过叠加层实现
实现:
//初始化
public var hm:HeatMap = new HeatMap(600, 600);
//根据服务器返回结果,设置hm的数据参数并指定容器
var dataX:Array = ev.result.dataX;
var dataY:Array = ev.result.dataY;
//Now process the HeatMap
var re:Rectangle = new Rectangle(0,0,360,360);
hm.setQuality(2,1);
hm.setPenProperties(4,0.08);
hm.alpha = 0.75;
hm.setData(dataX,dataY,re);
//叠加到google地图上(google的地图的map需要初始化哦)
//For some reason if the groundOverlay is set from longitude -180 to 180 it does not work. You just need to get closer.
var go:GroundOverlay = new GroundOverlay(hm,new LatLngBounds(new LatLng(-85,-179.78), new LatLng(85,179.78)),
new GroundOverlayOptions(
{name: "HeatMapGroundOverlay",
description: "HeatMap ground overlay" }));
map.addOverlay(go);
//地图所在的容器
<mx:Canvas width="100%" height="100%" id="canvas1">
<mx:UIComponent id="mapContainer"
initialize="startMap(event);"
width="100%" height="100%"/>
</mx:Canvas>
简单点来说就是,Sprite需要放到UIComponent才能显示在界面上:
var comp:UIComponent = new UIComponent();
var hm:HeatMap=new HeatMap(900,900);
hm.setData(GradientDictionary.THERMAL,GradientDictionary.THERMAL,new Rectangle(111,100,500,500));
comp.addChild(hm);
this.addElement(comp);
二.基于javascript技术
1.google有一个gheat( http://code.google.com/p/gheat/),通过扩展,实现一个heatmap的tile 服务器,并通过GoogleMap的API实现heatmap加载
Google Maps gives you API for adding additional map layers. This software implements a map tile server for a heatmap layer.
google 的heatmap API(http://www.heatmapapi.com/),需要免费的或付费的key,可以在Google Map api中加载,也可以在其他GIS系统中使用.
免费的heatmap api 的key的限制条件:
- You are limited to a total of 500 hits per day(不超过500次/天的访问量)
- You can only submit a total of 100 data points (or less depending on the method of deployment) per call(不超过100个数据点,或)
- Our logo will appear on the heat map(显示google的logo)
效果:
移动地图时候,heatmap不会跟着移动,只有鼠标抬起才会heatmap才能移动到指定位置
2.arcgis api for javascript,包含heatmaplayer
三.基于html5的canvas绘图板标签
2185

被折叠的 条评论
为什么被折叠?



