arcgis for silverlight 中使用pictureFillSymbol不显示图片 5

只显示周围的框框,不显示中间的图片;<esri:Mapx:Name="MyMap"><esri:Map.Layers><esri:ArcGISTiledMapServic... 只显示周围的框框,不显示中间的图片;
<esri:Map x:Name="MyMap">
<esri:Map.Layers>
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"/>
<esri:GraphicsLayer ID="MyGraphicsLayer" />
</esri:Map.Layers>
</esri:Map>

//多边形的四个点
MapPoint point1 = new MapPoint(110.11, 30.81);
MapPoint point2 = new MapPoint(110.11, 34.82);
MapPoint point3 = new MapPoint(116.13, 34.82);
MapPoint point4 = new MapPoint(116.13, 30.81);
List<MapPoint> pointList = new List<MapPoint>();
pointList.Add(point1);
pointList.Add(point2);
pointList.Add(point3);
pointList.Add(point4);
pointList.Add(point1);
ESRI.ArcGIS.Client.Geometry.PointCollection points = new ESRI.ArcGIS.Client.Geometry.PointCollection(pointList);
ESRI.ArcGIS.Client.Geometry.Polygon pPolygon = new ESRI.ArcGIS.Client.Geometry.Polygon();
pPolygon.Rings.Add(points);
Graphic tupian = new Graphic()
{
//Geometry = mercator.FromGeographic(pPolygon), //图形
Geometry = pPolygon, //图形
Symbol = new PictureFillSymbol() //符号
{Source = new BitmapImage(new Uri("http://resources.esri.com/help/9.3/arcgisserver/apis/flex/samples/assets/warningsmall.gif", UriKind.RelativeOrAbsolute)),
} };
graphicsLayer.Graphics.Add(tupian);
展开
 我来答
孤城太守
2014-12-11 · TA获得超过216个赞
知道小有建树答主
回答量:177
采纳率:66%
帮助的人:61.3万
展开全部
是把图片放到MyGraphicsLayer图层中,后台没有获得。如下
GraphicsLayer myTempGL = Map.Layers["myGraphicsLayer"] as GraphicsLayer;
比如添加一个点的代码 myTempGL代替graphicsLayer
ESRI.ArcGIS.Client.Projection.WebMercator mercator=new ESRI.ArcGIS.Client.Projection.WebMercator();
GraphicsLayer myTempGL = Map.Layers["myGraphicsLayer"] as GraphicsLayer;
Graphic myTempGraphic = new Graphic()
{
Geometry = mercator.FromGeographic(new MapPoint(111, 22)),
Symbol = LayoutRoot.Resources["RedMakerSymbol"] as Symbol
};
myTempGL.Graphics.Add(myTempGraphic);
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式