• arcgis 定位图斑,并且高亮显示


        ///图斑定位
        function TabQuery(instance_id, layer_name) {
            require(["esri/map", "esri/geometry/Extent", "esri/SpatitalReference", "esri/graphic", "esri/tasks/QueryTask", "esri/tasks/query", 'esri/symbols/SimpleLineSymbol', 'esri/Color'], function(map, Extent, SpatitalReference, Graphic, QueryTask, Query, SimpleLineSymbol, Color) {
                var url = "../MapServer/0"; //发布的服务url
                var QueryTask = new QueryTask(url);//查询任务
                var query = new Query();//查询条件
                query.where = " instance_id=" + instance_id;
                query.outSpatialReference = map.extent.spatitalReference;
                query.returnGeometry = true;
                QueryTask.execute(query, showClickSearchResult);//执行查询返回要进行高亮显示的graphics
    
                function showClickSearchResult(result) {
                    map.graphics.clear();
                    var graphic = result.features[0];
                    var searchsymbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE.SOLID, new Color([0, 255, 255]), 3)//高亮样式
                    graphic.setSymbol(searchsymbol);
                    map.graphics.add(graphic);//添加到地图中去图形
                    var returnGeometry = graphic.geometry;
                    var returnExtent = returnGeometry.getExtent();
                    returnExtent = returnExtent.expend(2);
                    map.setExtent(returnExtent);//设置到范围
                    // body...
                }
    
                // body...
            })
            // body...
        }
    

      

  • 相关阅读:
    vue 组件轮播联动
    Echarts 解决饼图文字过长重叠的问题
    Echarts 背景渐变柱状图
    vue 组件间数据传递
    vue webpack build 打包过滤console.log()日志
    自定义字段排序
    vue 路由嵌套高亮问题
    微信小程序验证码获取倒计时
    解决小程序里面的图片之间有空隙的问题???
    axios使用
  • 原文地址:https://www.cnblogs.com/huchaoheng/p/8558956.html
Copyright © 2020-2023  润新知