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

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.

主站蜘蛛池模板: 北安市| 稻城县| 梓潼县| 奎屯市| 铜川市| 广东省| 安图县| 鹰潭市| 鹤庆县| 灌南县| 都江堰市| 乳山市| 曲周县| 绥阳县| 彭阳县| 乌苏市| 兴安盟| 萍乡市| 独山县| 诸城市| 手游| 鹤岗市| 夏邑县| 河源市| 望谟县| 剑阁县| 金华市| 突泉县| 石家庄市| 尤溪县| 全椒县| 惠安县| 长宁区| 冀州市| 安阳市| 长泰县| 兴海县| 喜德县| 庆安县| 内江市| 苗栗县|