- 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.
- iOS Game Programming Cookbook
- Advanced Splunk
- 多媒體CAI課件設計與制作導論(第二版)
- RTC程序設計:實時音視頻權威指南
- Java Web程序設計
- Learning Network Forensics
- 蘋果的產品設計之道:創建優秀產品、服務和用戶體驗的七個原則
- Python+Tableau數據可視化之美
- 開源項目成功之道
- Building Serverless Architectures
- Scratch從入門到精通
- Java EE項目應用開發
- JBoss AS 7 Development
- 現代JavaScript編程:經典范例與實踐技巧
- Mastering Linux Kernel Development