<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. [Android Pro] 监听内容提供者ContentProvider的数据变化

    转载自:http://blog.csdn.net/woshixuye/article/details/8281385 一.提出需求 有A,B,C三个应用,B中的数据需要被共享,所以B中定义了内容提供者 ...

  2. July 18th, Week 30th Monday, 2016

    Truth needs no color; beauty, no pencil. 真理不需要色彩,美丽无需涂饰. Most of the time, giving some color to trut ...

  3. linux编译中的常见问题

    转linux编译中的常见问题 错误提示:Makefile:2: *** 遗漏分隔符 . 停止. 原因makefile中 gcc语句前 缺少一个 tab分割符 错误提示: bash: ./makefil ...

  4. 无线ap和路由器wifi热点怎么区分和区别

    转自:http://blog.sina.com.cn/s/blog_5a6efa330101yrzh.html 有的人发现无线ap和无线路由器都可以实现无线上网,于是到无线市场买了个相当便宜的无线ap ...

  5. SQL Server 2012 OFFSET/FETCH NEXT分页示例(转载)

    原文:http://beyondrelational.com/modules/29/presentations/483/scripts/12983/sql-server-2012-server-sid ...

  6. 思考探索,如何才能高效访问我的这个DataTable?

    需求 一切都是空的,除了Money,只有需求才是最真的,你懂的. 最近接到个略显棘手的需求,思索再三,想出两种方法,可觉得都不太好,这里与大家讨论一下. 需求如下: 用户需要在现有的某个grid中添加 ...

  7. 布局文件中fill_parent、match_parent和wrap_content有什么区别?

    fill_parent 宽度或者高度 布满整个屏幕从Android 2.2开始fill_parent改名为match_parent.wrap_content布局元素将根据内容更改大小.

  8. PL/SQL Developer 连接新数据库

    1 2 3

  9. hdu 4640(状压dp)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4640 思路:f[i][j]表示一个人状态i下走到j的最小花费,dp[i][j]表示i个人在状态j下的最 ...

  10. 2016.6.17 kali Linux 隧道工具

    隧道工具的基本概念: 1.在计算机网络中,隧道工具是指使用一种网络协议去封装另一种网络协议的技术. 2.通常用来数据伪装或者穿越防火墙,在入侵目标系统后,可用来提升权限和权限维持. Kali中的隧道工 ...