- 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.
- Spring 5.0 By Example
- Building a RESTful Web Service with Spring
- 算法精粹:經(jīng)典計算機(jī)科學(xué)問題的Java實現(xiàn)
- 小程序開發(fā)原理與實戰(zhàn)
- SQL基礎(chǔ)教程(第2版)
- Getting Started with LLVM Core Libraries
- SQL 經(jīng)典實例
- Hands-On Kubernetes on Windows
- Instant jQuery Boilerplate for Plugins
- 算法圖解
- 零基礎(chǔ)看圖學(xué)ScratchJr:少兒趣味編程(全彩大字版)
- OpenCV Android Programming By Example
- Java高手是怎樣煉成的:原理、方法與實踐
- LabVIEW入門與實戰(zhàn)開發(fā)100例(第4版)
- Manage Your SAP Projects with SAP Activate