ArcGIS API for Silverlight中legend控件显示图例问题
2012-12-27 16:43
183 查看
转自http://www.gisall.com/html/34/9534-5141.html
在使用ArcGIS API for Silverlight进行地图展示应用的时候,我们都会设置地图图层列表的图例(该图例包含有图层名称和图层符号),但是在使用API时却出现了图例无法正常显示,该图例只显示了图层名称,却无法显示图层的符号颜色的问题。查看ArcGIS API for Silverlight的接口说明,没任何说明。但是在ArcGIS API for Flex的接口说明确发现如下信息:
The Legend component displays labels and symbols for some or all of the layers in the map. By default the legend will respect scale dependencies and only display layers and sublayers that are currently visible in the map. Optionally, you can set the respectCurrentMapScale property to false to show all layers at all scales, then layers that are not in scale will be shown - with 50% transparency. The legend automatically updates if the visibility of a layer or sublayer changes.
The legend supports the following layer types: ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer, and FeatureLayer. If the layer is an ArcGISDynamicMapServiceLayer or ArcGISTiledMapServiceLayer created using ArcGIS Server 10.0 SP1 or higher the legend is generated using the REST Map Service legend resource of that service, e.g. http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Unemployment_Rate/MapServer/legend. If the layers are version 10 or lower the legend is created using the ArcGIS.com legend service. In order to use the ArcGIS.com legend service your map service needs to be publicly accessible and your application must be able to access ArcGIS.com.
The legend for feature layers is created using the layer's drawing info, for example: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0.
通过上述描述我们发现导致这个问题的原因是因为使用ArcGIS Server10版本或更低的发布地图服务(静态或动态类型)是不能使用ArcGIS API for Silverlight的Legend控件进行图例显示,但是使用FeatureLayer类型却可以正常显示图例.
而要正常显示本地静态或动态类型的地图服务则需要将ArcGIS Server10版本打补丁到SP1或以上版本就可以实现了。
在使用ArcGIS API for Silverlight进行地图展示应用的时候,我们都会设置地图图层列表的图例(该图例包含有图层名称和图层符号),但是在使用API时却出现了图例无法正常显示,该图例只显示了图层名称,却无法显示图层的符号颜色的问题。查看ArcGIS API for Silverlight的接口说明,没任何说明。但是在ArcGIS API for Flex的接口说明确发现如下信息:
The Legend component displays labels and symbols for some or all of the layers in the map. By default the legend will respect scale dependencies and only display layers and sublayers that are currently visible in the map. Optionally, you can set the respectCurrentMapScale property to false to show all layers at all scales, then layers that are not in scale will be shown - with 50% transparency. The legend automatically updates if the visibility of a layer or sublayer changes.
The legend supports the following layer types: ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer, and FeatureLayer. If the layer is an ArcGISDynamicMapServiceLayer or ArcGISTiledMapServiceLayer created using ArcGIS Server 10.0 SP1 or higher the legend is generated using the REST Map Service legend resource of that service, e.g. http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Unemployment_Rate/MapServer/legend. If the layers are version 10 or lower the legend is created using the ArcGIS.com legend service. In order to use the ArcGIS.com legend service your map service needs to be publicly accessible and your application must be able to access ArcGIS.com.
The legend for feature layers is created using the layer's drawing info, for example: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0.
通过上述描述我们发现导致这个问题的原因是因为使用ArcGIS Server10版本或更低的发布地图服务(静态或动态类型)是不能使用ArcGIS API for Silverlight的Legend控件进行图例显示,但是使用FeatureLayer类型却可以正常显示图例.
而要正常显示本地静态或动态类型的地图服务则需要将ArcGIS Server10版本打补丁到SP1或以上版本就可以实现了。
相关文章推荐
- ArcGIS API for Silverlight 地图元素点闪烁,线流动显示的处理方式
- ArcGIS API for Silverlight地图加载众多点时,使用Clusterer解决重叠问题
- 解决ArcGIS API for Silverlight 加载地图的内外网访问问题
- ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(一)
- 使用Visifire+ArcGIS API for Silverlight实现Graphic信息的动态图表显示
- ArcGIS API for Silverlight 查询点闪烁显示
- 使用Visifire+ArcGIS API for Silverlight实现Graphic信息的动态图表显示
- ArcGIS API for Silverlight 解决众多密集点分层显示
- ArcGIS API for Silverlight之Web Mapping开发:根据图层属性查询、定位、高亮显示
- ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(二)--Silverlight 配置动态的 webService、动态加载ArcGis地图服务
- ArcGIS API for Silverlight地图加载众多点时,使用Clusterer解决重叠问题
- ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(一)
- ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(四)--动态绘制点
- ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(三)--绘制点、线、圆,显示提示信息
- ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(三)--绘制点、线、圆,显示提示信息
- Arcgis for Silverlight的图例Legend默认折叠
- ArcGIS API for Silverlight地图加载众多点时,使用Clusterer解决重叠问题
- 使用Visifire+ArcGIS API for Silverlight实现Graphic信息的动态图表显示
- 解决ArcGIS API for Silverlight 加载地图的内外网访问问题
- 使用Visifire+ArcGIS API for Silverlight实现Graphic信息的动态图表显示