zoukankan      html  css  js  c++  java
  • 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...
        }
    

      

  • 相关阅读:
    JAVA——汉诺塔
    JAVA与MySQL连接并显示、管理表格实例
    2019沈阳网选——模拟
    CodeforcesRound#553(Div. 2)(A-D题解)
    CodeforcesRound#551(Div. 2)(A-C题解)
    CodeforcesGlobalRound2(Div.2)ABCE题解
    EducationalCodeforcesRound62(Div. 2)(A-D题解)
    博客搬家
    文本分类基本流程
    卡方检验应用-特征选择
  • 原文地址:https://www.cnblogs.com/huchaoheng/p/8558956.html
Copyright © 2011-2022 走看看