arcgis api for js简要笔记
1、主要借助官网的接口文档和samplecode来学习
https://developers.arcgis.com/javascript/latest/api-reference/index.html
https://developers.arcgis.com/javascript/latest/sample-code/index.html
1、条件查询
2、
WMS是OGC标准中比较简单也是比较重要的标准之一。它全称是“Web Map Service”(网络地图服务)。此标准主要定义了用于创建和显示地图图像的三大操作:GetCapabilities(获取服务能力), GetMap(获取地图)和GetFeatureInfo(获取对象信息)。其中GetMap为核心操作,此操作得到一幅地图图像。
3、图层加载时用definitionExpression过滤后不显示
var landusePointLayer = new FeatureLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/6", {
mode: FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"],
definitionExpression: "ObjectId>2750000"
});
4、
queryTask = new esri.tasks.QueryTask("http://localhost:6080/arcgis/rest/services/test/MapServer/0");
query = new esri.tasks.Query();
query.returnGeometry = true;
query.outFields = ["*"];
//query.geometry给出查询范围,如果不给总是出错,不像书上说的可以不给
query.geometry =map.extent; ;
dojo.connect(queryTask, "onComplete", function(fset){
map.graphics.clear();
var resultFeatures = fset.features;
for (var i = 0, il = resultFeatures.length; i < il; i++) {
var graphic = resultFeatures[i];
//根据类型设置一个符号
setTheSymbol(graphic);
graphic.setInfoTemplate(resultTemplate);
map.graphics.add(graphic);
//定位到该区域中心点,之前有说直接用
graphic.geometry作为参数,但是我用的时候总是报错,后面参数3表示级别,完成累死与InfoTemplate的“缩放致”功能
map.centerAndZoom(graphic.geometry._centroid,3); } }