arcgis js 4.10 图属查询方法有三种:query、find、identify
1. 对比
方法 | 范围 | 查询模式 | 输入参数 |
---|---|---|---|
identify | map service(多图层)查询 | 模糊查询 | 图形(字符串) |
find | map service(单层单字段、单层多字段、多层多字段)查询 | 模糊查询 | 属性(字符串) |
query | 单个图层查询 | 精确查询 | 图形(几何)、属性(字符串) |
2. 使用
2.1. Identify
图形查询:
<div id="viewDiv">
<!--画矩形-->
<div id="rectangle-button" class="esri-widget esri-widget-button esri-interactive" title="框选">
<span class="esri-icon-checkbox-unchecked"></span>
</div>
</div>
view.when(function () {
Layers.refresh();
let draw = new Draw({
view: view
});
$('#rectangle-button').on('click', function () {
enableCreateRectangle(draw, view);
});
});
function enableCreateRectangle(draw, view) {
let action = draw.create('rectangle', {
mode: 'click'
});
//获取焦点
view.focus();
//顶点移除
action.on('vertex-remove', createRectangle);
//鼠标移动
action.on('cursor-update', createRect