GIS-ArcGIS JS API FeatureLayer图层绑定事件的几种方式

本文介绍了一种使用ArcGIS API实现Web地图点击交互的方法,并展示了如何通过不同方式为地图图层添加点击事件监听器。同时,文章还列举了大量与地图操作相关的模块和类。
一、以下四种方式均可以
importantProvinceLayer.on("click", DoIdentify);
dojo.connect(importantProvinceLayer, "onClick", DoIdentify);
on(importantProvinceLayer, "click", DoIdentify);
connect.connect(importantProvinceLayer, "onClick", DoIdentify);
 
二、引入的包
require(["dojo/dom", "dojo/dom-construct",
"esri/map", "esri/layers/FeatureLayer",
"esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
"esri/renderers/SimpleRenderer", "esri/graphic", "esri/lang", "myModules/InfoWindow", "esri/InfoTemplate",
"esri/Color", "dojo/number", "dojo/dom-style",
"esri/layers/ImageParameters",
"esri/dijit/Bookmarks", "esri/tasks/GeometryService", "esri/tasks/LengthsParameters", "esri/tasks/AreasAndLengthsParameters",
"esri/dijit/HomeButton",
"esri/layers/FeatureLayer", "esri/layers/GraphicsLayer", "esri/InfoTemplate", "esri/Graphic",
"esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol",
"esri/renderers/SimpleRenderer", "esri/graphic", "esri/lang",
"esri/Color", "esri/tasks/Query", "esri/tasks/QueryTask", "esri/SpatialReference",
"esri/geometry/Point", "esri/geometry/Polyline", "esri/geometry/Polygon",
"esri/dijit/Scalebar",
"esri/tasks/FindTask",
"esri/tasks/FindParameters",
"esri/tasks/Identify",
"esri/tasks/IdentifyTask",
"esri/tasks/IdentifyParameters",
"dojo/number",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/TitlePane",
"dijit/TooltipDialog",
"esri/dijit/OverviewMap",
"esri/dijit/BasemapToggle", "esri/basemaps",
"dojo/parser",
"esri/dijit/BasemapGallery", "esri/arcgis/utils",
"esri/dijit/Popup", "esri/dijit/PopupTemplate",
"dojo/_base/connect", "dijit/registry",
"esri/toolbars/draw",
"esri/toolbars/navigation",
"dojo/dom", "dojo/dom-style", "dojo/on",
"dijit/TooltipDialog", "dijit/popup", "dojo/domReady!"
], function (dom, domConstruct,
Map, FeatureLayer,
SimpleFillSymbol, SimpleLineSymbol,
SimpleRenderer, Graphic, esriLang, InfoWindow, InfoTemplate,
Color, number, domStyle,
ImageParameters,
Bookmarks,
GeometryService,
LengthsParameters,
AreasAndLengthsParameters,
HomeButton,
FeatureLayer,
GraphicsLayer,
InfoTemplate,
Graphic,
SimpleFillSymbol,
SimpleLineSymbol,
SimpleMarkerSymbol,
SimpleLineSymbol,
SimpleRenderer,
Graphic,
esriLang,
Color,
Query,
QueryTask,
SpatialReference,
Point,
Polyline,
Polygon,
Scalebar,
FindTask,
FindParameters,
Identify,
IdentifyTask,
IdentifyParameters,
number,
BorderContainer,
ContentPane,
TitlePane,
TooltipDialog,
OverviewMap,
BasemapToggle,
esriBasemaps, parser, BasemapGallery, arcgisUtils, Popup, PopupTemplate, connect, registry, Draw, Navigation, dom, domStyle, on,
TooltipDialog, dijitPopup
) {
 
//todo
 
});

转载于:https://www.cnblogs.com/defineconst/p/7239255.html

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值