博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ArcGIS API For JS实现动态点扩散
阅读量:5096 次
发布时间:2019-06-13

本文共 4216 字,大约阅读时间需要 14 分钟。

在博客中分享的关于Openlayer实现点动态扩散,今天分享一下关于ArcGIS API实现点动态扩散的效果,主要还用canvas写,这中间用一个rasterLayer的扩展图层。

先来看看效果:

 

一、完整demo代码:

    arcgis map flashmarker    

二、关于扩展图层rasterlayer

define([    "dojo/_base/declare", "dojo/_base/connect", "dojo/_base/array",    "dojo/dom-construct", "dojo/dom-style", "dojo/number",    "esri/lang", "esri/domUtils",     "esri/SpatialReference", "esri/geometry/Point", "esri/layers/layer"  ], function(    declare, connect, arrayUtils,    domConstruct, domStyle, number,    esriLang, domUtils,     SpatialReference, Point, Layer  ) {    var RL = declare([Layer], {      // Doc: http://docs.dojocampus.org/dojo/declare#chaining      "-chains-": {        constructor: "manual"      },            constructor: function(data, options) {        // Manually call superclass constructor with required arguments        this.inherited(arguments, [ "http://some.server.com/path", options ]);          this.data = data;          this.loaded = true;        this.onLoad(this);      },            /********************       * Public Properties       *        * data       *        ********************/            /**********************       * Internal Properties       *        * _map       * _element       * _context       * _mapWidth       * _mapHeight       * _connects       *        **********************/            /******************************       * esri.layers.Layer Interface       ******************************/            _setMap: function(map, container) {        this._map = map;                var element = this._element = domConstruct.create("canvas", {          id: "canvas",          width: map.width + "px",          height: map.height + "px",          style: "position: absolute; left: 0px; top: 0px;"        }, container);                if (esriLang.isDefined(this.opacity)) {          domStyle.set(element, "opacity", this.opacity);        }                this._context = element.getContext("2d");        if (!this._context) {          console.error("This browser does not support 
elements."); } this._mapWidth = map.width; this._mapHeight = map.height; // Event connections this._connects = []; this._connects.push(connect.connect(map, "onPan", this, this._panHandler)); this._connects.push(connect.connect(map, "onExtentChange", this, this._extentChangeHandler)); this._connects.push(connect.connect(map, "onZoomStart", this, this.clear)); this._connects.push(connect.connect(this, "onVisibilityChange", this, this._visibilityChangeHandler)); return element; }, _unsetMap: function(map, container) { arrayUtils.forEach(this._connects, connect.disconnect, this); if (this._element) { container.removeChild(this._element); } this._map = this._element = this._context = this.data = this._connects = null; }, /***************** * Public Methods *****************/ refresh: function() { if (!this._canDraw()) { return; } }, clear: function() { if (!this._canDraw()) { return; } this._context.clearRect(0, 0, this._mapWidth, this._mapHeight); }, /******************* * Internal Methods *******************/ _canDraw: function() { return (this._map && this._element && this._context) ? true : false; }, _panHandler: function(extent, delta) { domStyle.set(this._element, { left: delta.x + "px", top: delta.y + "px" }); }, _extentChangeHandler: function(extent, delta, levelChange, lod) { if (!levelChange) { domStyle.set(this._element, { left: "0px", top: "0px" }); this.clear(); } }, /**************** * Miscellaneous ****************/ _visibilityChangeHandler: function(visible) { if (visible) { domUtils.show(this._element); } else { domUtils.hide(this._element); } } }); return RL; });

 

转载于:https://www.cnblogs.com/tuboshu/p/10752323.html

你可能感兴趣的文章
mac下的mysql报错:ERROR 1045(28000)和ERROR 2002 (HY000)的解决办法
查看>>
Hmailserver搭建邮件服务器
查看>>
django之多表查询-2
查看>>
快速幂
查看>>
改善C#公共程序类库质量的10种方法
查看>>
AIO 开始不定时的抛异常: java.io.IOException: 指定的网络名不再可用
查看>>
MyBaits动态sql语句
查看>>
HDU4405(期望DP)
查看>>
拉格朗日乘子法 那些年学过的高数
查看>>
vs code 的便捷使用
查看>>
Spring MVC @ResponseBody返回中文字符串乱码问题
查看>>
用户空间与内核空间,进程上下文与中断上下文[总结]
查看>>
JS 中的跨域请求
查看>>
JAVA开发环境搭建
查看>>
vim插件ctags的安装和使用
查看>>
mysql基础语句
查看>>
Oracle中的rownum不能使用大于>的问题
查看>>
[Data Structure & Algorithm] 有向无环图的拓扑排序及关键路径
查看>>
git 常用命令
查看>>
cassandra vs mongo (1)存储引擎
查看>>