ArcGIS API for Silverlight中legend控件显示图例问题
轉自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或以上版本就可以實現了。
轉載于:https://www.cnblogs.com/holygis/archive/2012/12/27/2835977.html
總結
以上是生活随笔為你收集整理的ArcGIS API for Silverlight中legend控件显示图例问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c# 日期函数[string.Forma
- 下一篇: 使用.NET程序集作为Business