本文主要是介绍ArcGIS API for Silverlight之ElementLayer使用注意点,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<!--地图控件--><esri:Map x:Name="myMap" ExtentChanged="myMap_ExtentChanged" WrapAround="True" IsLogoVisible="False" Extent="114.289579051054,29.3907111115968,121.380372848428,33.7272787947227"><i:Interaction.Behaviors><local:WheelZoom /></i:Interaction.Behaviors><esri:Map.Layers><esri:ArcGISTiledMapServiceLayer ID="BaseLayer" Url="http://192.168.2.188/arcgis/rest/services/AnHuiBase/MapServer"/><!--<bing:TileLayer ID="BingLayer"></bing:TileLayer>--><!--GraphicsLayer--><esri:GraphicsLayer ID="MyGraphicsLayer"></esri:GraphicsLayer><esri:GraphicsLayer ID="MyGraphicsLayer2"></esri:GraphicsLayer><esri:GraphicsLayer ID="MapTipLayer"></esri:GraphicsLayer><!---特征图层--><!--<esri:FeatureLayer ID="MyFeatureLayer"></esri:FeatureLayer>--></esri:Map.Layers></esri:Map>
ElementLayer.SetEnvelope方法很重要,必须设置
Graphic grahpics = sender as Graphic;ESRI.ArcGIS.Client.Projection.WebMercator mercator = new ESRI.ArcGIS.Client.Projection.WebMercator();ESRI.ArcGIS.Client.Geometry.Envelope selected = mercator.ToGeographic(grahpics.Geometry).Extent;ElementLayer.SetEnvelope(tip, new Envelope(new MapPoint(selected.XMin, selected.YMin), new MapPoint(selected.XMin, selected.YMin)));if (elementLayer.Children.Count > 0){elementLayer.Children.Clear();elementLayer.Children.Add(tip);}else{elementLayer.Children.Add(tip);}
这篇关于ArcGIS API for Silverlight之ElementLayer使用注意点的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!