- Building Web and Mobile ArcGIS Server Applications with JavaScript(Second Edition)
- Eric Pimpler Mark Lewin
- 201字
- 2021-07-02 15:49:00
Setting a definition expression
In ArcGIS Desktop you can use a definition expression to specify a subset of all the features in a data layer that you want to display. A definition expression is simply a SQL query against the layer's data. Only the features whose attributes meet the query are displayed. For example, if you only wanted to display cities with a population greater than 1 million the expression would be something like POPULATION > 1000000. The ArcGIS API for JavaScript has a setLayerDefinitions() method that accepts an array of definitions that can be applied against ArcGISDynamicMapServiceLayer to control the display of features in the resulting map. The following code example shows how this is done:

First, create an array that will hold multiple WHERE clauses which will serve as the definition expressions for each layer. In this case we are defining layer definitions for the first (index position 0) and sixth (index position 5) layers. Remember that the array is zero-based, so the first array is at index position 0. The WHERE clauses are stored in the array and then passed into the setLayerDefinitions() method. ArcGIS Server then renders the features that match the definition expressions for each layer.
- SQL Server 從入門到項(xiàng)目實(shí)踐(超值版)
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- Mastering Adobe Captivate 2017(Fourth Edition)
- Building a RESTful Web Service with Spring
- DevOps入門與實(shí)踐
- The Computer Vision Workshop
- C語言程序設(shè)計(jì)實(shí)踐教程
- 精通Scrapy網(wǎng)絡(luò)爬蟲
- 重學(xué)Java設(shè)計(jì)模式
- D3.js 4.x Data Visualization(Third Edition)
- 利用Python進(jìn)行數(shù)據(jù)分析(原書第3版)
- Jupyter數(shù)據(jù)科學(xué)實(shí)戰(zhàn)
- 圖數(shù)據(jù)庫實(shí)戰(zhàn)
- 軟件體系結(jié)構(gòu)
- Mastering Embedded Linux Programming