For all thoses who is trying add custom GraphicLayers to WPF Map.. a short way is: MobileCache md = new MobileCache("MapCache"); md.Open(); mapControl1.MapLayers.AddRange(md); mapControl1.ExtentChanged += new EventHandler(mapControl1_ExtentChanged); GraphicLayer gl = new GraphicLayer(); ESRI.ArcGIS.Mobile.Geometries.Point p = new ESRI.ArcGIS.Mobile.Geometries.Point(new ESRI.ArcGIS.Mobile.Geometries.Coordinate(mapControl1.GetExtent().XCenter, mapControl1.GetExtent().YCenter)); mapControl1.MapGraphicLayers.Add(gl);//Carefull with the order of this 2 lines gl.GeometryBag.Add(p); This sample adds a point in the center of the current extend.
MobileCache md = new MobileCache("MapCache"); md.Open(); mapControl1.MapLayers.AddRange(md); mapControl1.ExtentChanged += new EventHandler(mapControl1_ExtentChanged); GraphicLayer gl = new GraphicLayer(); ESRI.ArcGIS.Mobile.Geometries.Point p = new ESRI.ArcGIS.Mobile.Geometries.Point(new ESRI.ArcGIS.Mobile.Geometries.Coordinate(mapControl1.GetExtent().XCenter, mapControl1.GetExtent().YCenter)); mapControl1.MapGraphicLayers.Add(gl);//Carefull with the order of this 2 lines gl.GeometryBag.Add(p);
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.