官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 阜宁县| 瑞金市| 沿河| 房山区| 罗江县| 偃师市| 斗六市| 长顺县| 吴江市| 昌平区| 柘城县| 大连市| 郴州市| 高阳县| 锦州市| 明光市| 嘉峪关市| 淮安市| 莎车县| 含山县| 文山县| 山东| 新干县| 临沭县| 中江县| 昌都县| 汉中市| 沾益县| 南华县| 旺苍县| 隆回县| 定陶县| 龙海市| 贵南县| 视频| 浦东新区| 永济市| 申扎县| 龙山县| 侯马市| 布拖县|