Hi.
I want to display some shape files using silverlight. I wanted to use xamMap or xamWebMap. btw. what is the difference between those two? I coulnd find xamWebMap control anywhere in the toolbox (i'm using trial version if that helps) but I did found xamMap so I tried with that. Where can I find some instructions on how to start? I found gazzillion examples for xamWebMap but none for xamMap. For the beggining I want to just load simple shp file from the local disc. And also what do I have to do to use xamWebMap?
hi.
1. thx for the explanation
2. I don't seem to have .prj file. I have .shp .dbf .sbn .sbx and .shx. I'm not shure what all those files contain or do we need them, but that's what we got after conversion. Can I send you the whole thing so you can take look at it?
just to motivate you a bit we are looking into infragistic controls for some time and if we can make this thing with shape files work I think we will buy the whole package :)
Hi grabah,
XamWebMap was changed to XamMap, please take a look at this page for full list of 2010.2 breaking changes: http://help.infragistics.com/Help/NetAdvantage/DV/2011.1/CLR4.0/html/Breaking_Changes_2010_Volume_2.html
About issue #1 - That seems like a bug that we have recently fixed, please apply the latest service release, for more information about SR take a look at: http://ko.infragistics.com/support/service-releases.aspx#ServiceReleases. After layers are removed you can set the new map's WorldRect with the following snippet:
<pre>
private void InitMapCoordinates(){ // define world dimensions Point worldTopLeft = new Point(-180, 90); Point worldBottomRight = new Point(180, -90);
// Convert Geodetic to Cartesian coordinates Point winTopLeft = this.xamMap.MapProjection.ProjectToMap(worldTopLeft); Point winBottomRight = this.xamMap.MapProjection.ProjectToMap(worldBottomRight); // Create Rect structure the map control's WindowRect and WorldRect Rect winRect = new Rect() { X = Math.Min(winTopLeft.X, winBottomRight.X), Y = Math.Min(winTopLeft.Y, winBottomRight.Y), Width = Math.Abs(winTopLeft.X - winBottomRight.X), Height = Math.Abs(winTopLeft.Y - winBottomRight.Y) }; this.xamMap.IsAutoWorldRect = false; this.xamMap.WindowZoomMaximum = 40;
// Change the map control's WindowRect and WorldRect this.xamMap.WindowRect = this.xamMap.WorldRect = winRect;}
</pre>
About issue #2 -Please check the shapefile's prj file which contains coordinate system and projection information.
Regards,
Ivan Kotev
I found documentation.
but now I have whole different set of issues.
1. How do you clear loaded shape file from the xamMap. I load your usa_pl as layer 1. then later I want to delete it with xamMap.Layers.Clear(); Map stops beeing interactive but image of use still remains visible.
2. I have shape file converted from the AutoCad that simply won't display. I get no loading error. I assume its some kind of problem with coordinates.