If you have a pushpin image, you can create a PictureMarkerSymbol. You can download the SDK to get this image. This will be your Graphic.Symbol.<esri:PictureMarkerSymbol x:Key="PinPictureMarkerSymbol" OffsetX="11" OffsetY="39" Source="/Assets/images/i_pushpin.png" />Assuming you have already defined a map with GraphicsLayer, a push pin symbol and have retrieved the map coordinates (mp) from SQL Server. GraphicsLayer l = this.MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; Graphic g = new Graphic() { Geometry = new MapPoint(mp.X, mp.Y, MyMap.SpatialReference), Symbol = this.LayoutRoot.Resources["PinPictureMarkerSymbol"] as Symbol }; l.Graphics.Add(g);
GraphicsLayer l = this.MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; Graphic g = new Graphic() { Geometry = new MapPoint(mp.X, mp.Y, MyMap.SpatialReference), Symbol = this.LayoutRoot.Resources["PinPictureMarkerSymbol"] as Symbol }; l.Graphics.Add(g);
Have you looked into this blog post? http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/03/11/Sending-geometry-between-Silverlight-and-the-server-using-WCF.aspxI think you can use WCF service to get geometries from your SQL Server. Then it would be as simple as creating Graphics, setting their Geometry (Polygon or MapPoint), applying appropriate symbol (Fill or Marker), and adding them to your GraphicsLayer. http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddGraphicsXAML
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.