<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. vs c++中读取数据流并存储

    ifstream in("test.txt"); vector<string> vs; string s; while(!in.eof()) { in>>s ...

  2. Android数据存储之sharedpreferences与Content Provider

    android中对数据操作包含有: file, sqlite3, Preferences, ContectResolver与ContentProvider前三种数据操作方式都只是针对本应用内数据,程序 ...

  3. p188习题2

  4. -- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.

    [root@DB ~]# mysqldump -uroot -p123 --flush-logs --all-databases >fullbackup_sunday_11_PM.sql -- ...

  5. HTTP协议缓存机制的应用

    缓存的目 的是减少相应延迟 和 减少网络带宽消耗, 比如 css. js.图片这类静态资源应该进行缓存.实际项目 一般使用反向代理服务器(如 nginx. apache 等) 进行缓存. 关键字:ca ...

  6. hdu 1059 多重背包

    题意:价值分别为1,2,3,4,5,6的物品个数分别为a[1],a[2],a[3],a[4],a[5],a[6],问能不能分成两堆价值相等的. 解法:转化成多重背包 #include<stdio ...

  7. 小甲鱼PE详解之输入表(导入表)详解2(PE详解08)

    在此之前,我们已经对这个输入表进行了一些实践和理解,这有助于大家对这个概念更进一步的加深认识.小甲鱼觉得,越是复杂的问题我们应该越是去动手操作它,认识它,这样才容易熟悉它! 在上一节课我们像小鹿一样的 ...

  8. C#实现UTC时间与Datetime转换

    为了便于传输,通信过程中传输的都是:当前时间跟标准时间相隔的秒数,并且是以16进制字节的形式传输的. public double ConvertDateTimeInt(System.DateTime ...

  9. android 制作自定义标题栏

    1.在AndroidManifest.xml设置主题 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 2.在l ...

  10. A. Robot Sequence

    A. Robot Sequence time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...