<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   
   
  <meta name="viewport"
  content="initial-scale=1, maximum-scale=1,user-scalable=no">
  <title>Create Map with Custom ArcGISDynamicMapServiceLayer Layer
  Definitions</title>
   
  <link rel="stylesheet"
  href="https://js.arcgis.com/3.16/esri/css/esri.css"/>
  <style>
  html, body, #mapDiv {
  padding: 0;
  margin: 0;
  height: 100%;
  }
   
  </style>
   
  <script src="https://js.arcgis.com/3.16/"></script>
  <script>
  var map;
   
  require([
  "esri/map",
  "esri/layers/ArcGISDynamicMapServiceLayer",
  "esri/layers/ImageParameters",
  "dojo/domReady!"
  ],
  function (Map, ArcGISDynamicMapServiceLayer, ImageParameters) {
   
  map = new Map("mapDiv", {
  basemap: "streets",
  center: [-98.258, 38.236],
  zoom: 7
  });
   
  //Use the ImageParameters to set map service layer definitions and map service visible layers before adding to the client map.
  var imageParameters = new ImageParameters();
   
  //ImageParameters.layerDefinitions takes an array. The index of the array corresponds to the layer id.
  //In the sample below an element is added in the array at 3, 4, and 5 indexes.
  //Those array elements correspond to the layer id within the remote ArcGISDynamicMapServiceLayer
  var layerDefs = [];
  layerDefs[5] = "STATE_NAME='Kansas'";
  layerDefs[4] = "STATE_NAME='Kansas' and POP2007>25000";
  layerDefs[3] = "STATE_NAME='Kansas' and POP2007>25000";
  imageParameters.layerDefinitions = layerDefs;
   
  //I want layers 5,4, and 3 to be visible
  imageParameters.layerIds = [5, 4, 3];
  imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW;
  imageParameters.transparent = true;
   
  //construct ArcGISDynamicMapServiceLayer with imageParameters from above
  var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer",
  {"imageParameters": imageParameters});
   
  map.addLayer(dynamicMapServiceLayer);
  });
  </script>
  </head>
   
  <body>
  <div id="mapDiv"></div>
  </body>
  </html>

ArcGISDynamicMapServiceLayer 实现条件过滤的更多相关文章

  1. Mysql命令-以NULL做where条件过滤时应该写 IS NULL;

    以NULL做where条件过滤时应该写 IS NULL;SELECT * FROM pet WHERE death IS NULL; SELECT * FROM pet WHERE death IS ...

  2. java8 按条件过滤集合

    //黄色部分为过滤条件list.stream().filter(user-> user.getId() > 5 && "1组".equals(user. ...

  3. fiddler 按条件过滤

    使用fiddler抓包过程中最希望获取自己想要的数据,不重要的信息最希望的是过滤,如果重要和不重要的数据都展示对我们在寻找资源的时候产生了很大的干扰,所以我们需要按条件过滤: 1.启用fiddler ...

  4. MongoDB(课时13 where条件过滤)

    3.4.2.8 条件过滤 关系型数据库开发对于数据的筛选,想到的一定是where语句,MongoDB里面提供的是"$where". 范例:使用where进行数据的查询 db.stu ...

  5. automapper如何全局配置map条件过滤null值空值对所有映射起效

    原文 automapper如何全局配置map条件过滤null值空值对所有映射起效 我们在使用automapper的时候经常会遇到这样的问题:假设展示给用户的数据我们用UserDto类,User类就是我 ...

  6. 教你用Java web实现多条件过滤功能

    生活中,当你闲暇之余浏览资讯的时候,当你搜索资料但繁杂信息夹杂时候,你就会想,如何更为准确的定位需求信息.今天就为你带来: 分页查询 需求分析:在列表页面中,显示指定条数的数据,通过翻页按钮完成首页/ ...

  7. JavaWeb项目之多条件过滤

    相信很多同学在学习java基础之后,面对各种项目还是相当头疼,那今天我将手把手教你学会JavaWeb项目中的多条件过滤,希望你能在与我实战的过程中积累经验,更进一步. 分页查询 需求分析:在列表页面中 ...

  8. Django项目:CRM(客户关系管理系统)--23--15PerfectCRM实现King_admin多条件过滤

    登陆密码设置参考 http://www.cnblogs.com/ujq3/p/8553784.html list_filter = ('source','consultant','consult_co ...

  9. js数组Array根据动态条件过滤

    数据 [{ "name": "张三", "score": 153 }, { "name": "李四" ...

随机推荐

  1. eclipse4.4 tomcat jrebel使用

    1.下载jrebel破解包 2.去eclipse -->Help -->EclipseMarketplace 下载eclipse jrebel 也可以下载离线安装包,然后eclipse - ...

  2. svn update 每更新一项就输出一行信息,使用首字符来报告执行的动作 这些字符的含义是:

    A 已添加 D 已删除 U 已更新 C 合并冲突 G 合并成功 例子: [root@ok 资料库]# svn ci -m "" Sending 资料库/简历 Transmittin ...

  3. kvm xxx.xml文件的位置

    /var/run/libvirt/qemu/xxx.xml /etc/libvirt/qemu/xxx.xml

  4. android 广播

    关于广播以前感觉是一知半解的,这次看到同事整理的文档,顺带跟着再参考几篇博文也学习整理了下,先上个整理的图 代码模板 发送广播 public static final String RECEIVE_A ...

  5. Android虚拟机中的sqlite数据库文件

    Android虚拟机中的sqlite数据库文件 ①

  6. Gym 100971D Laying Cables 单调栈

    Description One-dimensional country has n cities, the i-th of which is located at the point xi and h ...

  7. loj 1185(bfs)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=26898 思路:我们可以给定有直接边相连的两点的距离为1,那么就是求 ...

  8. 【HTML5】Application Cache应用程序缓存

    HTML5 引入了应用程序缓存,这意味着 web 应用可进行缓存,并可在没有因特网连接时进行访问. 应用程序缓存为应用带来三个优势: 离线浏览 - 用户可在应用离线时使用它们 速度 - 已缓存资源加载 ...

  9. 关于phpstudy安装的问题

    1.最常见的就是80端口冲突.如果是安装在服务器的话,有些服务器已经默认安装了iis,所以会有冲突.关闭iis即可. 2.明明装了vc9运行库,但错误还是不行.如果你是整个项目copy过来的,可能就会 ...

  10. 使用INFORMATION_SCHEMA.Columns查询数据表结构

    使用情形1:写数据字典(Word文档)时, 需要获取表结构,以加快书写速度,当然,前提是没有文档导出工具. 使用情形2:生成实体时, 前提也是没有代码生成工具. 脚本 SELECT A.COLUMN_ ...