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.
- 一步一步學(xué)Spring Boot 2:微服務(wù)項目實戰(zhàn)
- Docker and Kubernetes for Java Developers
- Beginning C++ Game Programming
- 測試驅(qū)動開發(fā):入門、實戰(zhàn)與進(jìn)階
- Unity Virtual Reality Projects
- TestNG Beginner's Guide
- 面向?qū)ο蟪绦蛟O(shè)計(Java版)
- MySQL數(shù)據(jù)庫基礎(chǔ)實例教程(微課版)
- Python機(jī)器學(xué)習(xí)算法與實戰(zhàn)
- Visual C#.NET程序設(shè)計
- Nginx實戰(zhàn):基于Lua語言的配置、開發(fā)與架構(gòu)詳解
- Python算法詳解
- 零基礎(chǔ)學(xué)C語言程序設(shè)計
- Python Programming for Arduino
- ASP.NET Core 2 High Performance(Second Edition)