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

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.

主站蜘蛛池模板: 偏关县| 丹凤县| 夹江县| 磴口县| 太仆寺旗| 榆树市| 城市| 吴堡县| 曲松县| 昭觉县| 若羌县| 阿瓦提县| 获嘉县| 同江市| 饶河县| 临西县| 河源市| 峡江县| 定日县| 淮滨县| 阿巴嘎旗| 北碚区| 论坛| 邛崃市| 凤阳县| 武邑县| 丹阳市| 德钦县| 隆化县| 长春市| 烟台市| 枣阳市| 祁连县| 麻城市| 钦州市| 伊宁县| 曲麻莱县| 台南县| 承德市| 西宁市| 会理县|