现在,添加一个查询功能,并在结果上高亮显示: varfeatureLayer=newFeatureLayer({url:"https://your-feature-layer-url"// 替换为你的 FeatureLayer URL});view.when(function(){// 添加 FeatureLayer 到地图webMap.add(featureLayer);// 创建查询varquery=featureLayer.createQuery();query.where="your_query_condit...
mapView.on('click',function(event){letlayer=this.map.findLayerById('featureLayer');// 创建查询对象letquery=layer.createQuery()// 将点击的点放入查询对象中query.geometry={type:'point',// autocasts as new Point()longitude:event.mapPoint.x,latitude:event.mapPoint.y,spatialReference:4527//arcgis...
map.add(featureLayer1); view.when(function() {//地图刚初始化时获取graphics集合,需要监控featureLayer的updating状态完成后才能获取到view.whenLayerView(featureLayer1).then(function(lyrView) { lyrView.watch("updating",function(){ lyrView.queryFeatures().then(function(results) { console.log(results); ...
require(["esri/Map", "esri/views/MapView", "esri/layers/GraphicsLayer", "esri/layers/FeatureLayer", "esri/Graphic", "esri/geometry/Polygon", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/layers/support/LabelClass", "esri/tasks/support/Query", "dojo/_base/conn...
Learn how to execute a spatial query to access features from a feature layer.A feature layer can contain a large number of features stored in ArcGIS. To access a subset of the features, you can execute either a SQL or spatial query, or both at the same time. You can return feature att...
注意:arcgis 和桌面中的符号尺寸使用时点,在API for JavaScript中使用的是像素。 */ 类的层级 esri/layers/Layer esri/layers/GraphicsLayer esri/layers/FeatureLayer --- 子类: CSVLayer,DataAdapterFeatureLayer,StreamLayer --- 构造函数: new FeatureLayer(url,options?) // 实例化对象, ...
varfeatureLayer=newFeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"); map.addLayer(featureLayer); });
("名称:" + graphic.attributes.NAME) }); //监听JsonJlayer图层的鼠标移进事件 JsonJlayer.on("mouse-over", function (evt) { isShow = false; var graphic = evt.graphic; var content = getQueryWinContent(graphic.attributes, "jiancezhan", "simple");//自定义监测站气泡窗口内容 var zoompoint ...
查询示范:http://xxx/arcgis/rest/services/my_layer/MapServer/93/query 其中93是具体的图层,在这个服务中表示县级行政区 查询条件: 查询示例:http://xxx/arcgis/rest/services/my_layer/MapServer/93/query?where=CODE=340102&f=json 查询说明:根据where查询CODE等于340102的行政地区,结果包含边界数据 ...
query.where = "POP04 > " + population; text:文本查询,查询使用的是服务器显示的字段, 是使用“like”的WHERE子句的缩写。 query.text = "山 "; 查询结果 QueryTask查询的返回结果是FeatureSet,FeatureSet也有自己的属性,一般常用的就是features,格式为Graphic[],将其添加到GraphicsLayer中,再添加到map即可在...