ArcGIS API for Silverlight中legend控件显示图例问题
轉(zhuǎn)自http://www.gisall.com/html/34/9534-5141.html
在使用ArcGIS API for Silverlight進(jìn)行地圖展示應(yīng)用的時(shí)候,我們都會(huì)設(shè)置地圖圖層列表的圖例(該圖例包含有圖層名稱和圖層符號(hào)),但是在使用API時(shí)卻出現(xiàn)了圖例無法正常顯示,該圖例只顯示了圖層名稱,卻無法顯示圖層的符號(hào)顏色的問題。查看ArcGIS API for Silverlight的接口說明,沒任何說明。但是在ArcGIS API for Flex的接口說明確發(fā)現(xiàn)如下信息:
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.
通過上述描述我們發(fā)現(xiàn)導(dǎo)致這個(gè)問題的原因是因?yàn)槭褂肁rcGIS Server10版本或更低的發(fā)布地圖服務(wù)(靜態(tài)或動(dòng)態(tài)類型)是不能使用ArcGIS API for Silverlight的Legend控件進(jìn)行圖例顯示,但是使用FeatureLayer類型卻可以正常顯示圖例.
而要正常顯示本地靜態(tài)或動(dòng)態(tài)類型的地圖服務(wù)則需要將ArcGIS Server10版本打補(bǔ)丁到SP1或以上版本就可以實(shí)現(xiàn)了。
轉(zhuǎn)載于:https://www.cnblogs.com/holygis/archive/2012/12/27/2835977.html
總結(jié)
以上是生活随笔為你收集整理的ArcGIS API for Silverlight中legend控件显示图例问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c# 日期函数[string.Forma
- 下一篇: 使用.NET程序集作为Business