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

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.

主站蜘蛛池模板: 梅河口市| 修水县| 万荣县| 合阳县| 讷河市| 鄂托克前旗| 文成县| 丹棱县| 政和县| 车险| 昌乐县| 孟连| 安吉县| 甘肃省| 溧阳市| 香格里拉县| 宜良县| 东阳市| 独山县| 曲周县| 罗定市| 丰原市| 岱山县| 西乡县| 宜章县| 城口县| 海原县| 万全县| 香河县| 淮阳县| 柏乡县| 永吉县| 滨海县| 新蔡县| 余干县| 郧西县| 鄂伦春自治旗| 南召县| 福清市| 靖远县| 兴仁县|