Hello!
I've been evaluating the xamMap and I have a problem with projection, the layer from my shapefile is not where it's suposed to be and it also seems smaller than it should be. The shapefile works fine in Arcgis explorer, it also works fine in Telerik's map component after beeing converted to kml.
The shape file wont display at all if I don't add the <igMap:SphericalMercator /> in the shapefile reader. And it looks like to me that the projection on the shapefile is of that type.
If I set the MapProjectionType to Equirectangular the shapefile display, but then the openstreetmap doesnt.
I have not been able to try this using Bing's free maps instead of openstreetmap since I can't find any help on how to do that when you don't have a username and password for bing that you get with the pay version.
//Thomas
My code is as below
<igMap:XamMap
Grid.Column="0"
MapProjectionType="SphericalMercator"
HorizontalAlignment="Left"
Name="xamMap1"
VerticalAlignment="Top"
Width="600"
Height="836"
ElementClick="xamMap1_ElementClick"
IsClickable="True"
ViewportBackground="Transparent" BorderBrush="Black" BorderThickness="2" >
<igMap:XamMap.MapTileSource>
<igMap:OpenStreetMapTileSource x:Name="openStreetsTileSource" />
</igMap:XamMap.MapTileSource>
<igMap:XamMap.Layers>
<igMap:MapLayer.Reader>
<igMap:ShapeFileReader Uri="../Shapefiles/Sweden_county07">
<igMap:ShapeFileReader.CoordinateSystem>
<igMap:CoordinateSystem>
<igMap:CoordinateSystem.Projection>
<igMap:SphericalMercator />
</igMap:CoordinateSystem.Projection>
</igMap:CoordinateSystem>
</igMap:ShapeFileReader.CoordinateSystem>
</igMap:ShapeFileReader>
</igMap:MapLayer.Reader>
</igMap:MapLayer>
</igMap:XamMap.Layers>
</igMap:XamMap>
Hi,
That may be a bug, is there a sample shapefile you can provide?
For your latter problem, this may help: http://community.infragistics.com/forums/p/30600/228452.aspx#228452
-Graham
Hi!
I've tried every setting I could find under CoordinateSystem.Projection and nothing made it work. What I did in the end was to unproject the shapefile using a software called MapWindow Gis then reproject is using WGS80 after that XamMap took the shapefile just fine.
Only problem now is that it seems XamMap can't handle "åäö" in the shapefile so captions aren't displayed the way they should. Is there any way to set what encoding should be used reading the shapefile?
Another problem we have is that Captions seems to be shown more than once if a shape lets say a county in this case has a lake in it or similar so it has more than one polygon. The caption is displayed once / polygon even tho the county itself is just one MapElement.
Hi samoht4u
Try to set Bessel 1841 map datum through the Projection's EllipsoidType property:
<Maps:ShapeFileReader Uri="../Shapefiles/Sweden_county07"> <Maps:ShapeFileReader.CoordinateSystem> <Maps:CoordinateSystem> <Maps:CoordinateSystem.Projection> <Maps:SphericalMercator EllipsoidType="Bessel1841" /> </Maps:CoordinateSystem.Projection> </Maps:CoordinateSystem> </Maps:ShapeFileReader.CoordinateSystem></Maps:ShapeFileReader>
You can read more about XamMap coordinate system here: http://help.infragistics.com/NetAdvantage/WPFDV/2010.2/CLR4.0/?page=xamWebMap_Change_Map_Coordinate_System.html
About how to use Bing maps you can read from this guide: http://help.infragistics.com/NetAdvantage/DV/2010.2/CLR4.0/?page=xamWebMap_Add_Bing_Maps_as_Geo-Imagery_Data_Source.html
We are curruntly updating this article, because the authentication method for Bing Maps imagery service has been updated and now Microsoft recommends usage of Bing Maps Keys instead of tokens. More on the subject can be found here: http://msdn.microsoft.com/en-us/library/cc980937.aspx. How to get a Bing Map key you can read from here: http://msdn.microsoft.com/en-us/library/cc980937.aspx and what is the Bing Maps Imagery Service's address from here: http://msdn.microsoft.com/en-us/library/cc966738.aspx
Please let me know if you have been able to load the shapefiles.
Ivan Kotev
Nope, just adding 1 shapefile as shown in xaml, it seems the openstreetmap always show just that depending on the mapProjectionType the xamMap pan to show the shapefile layeres and that can be way off from the world map that openstreetmap shows.
If it is world map coordinates I need to set to get openStreetMap to work with my shapefiles how exactly do I know how to set those? If I use the settings in the example you linked to my shapefiles still doesn't fit correctly on the map.
It looks like the shapefile use Bessel_1841 the xamMap cannot unproject this and project to wgs80?
Hi, just to check first, is your code running something like the InitMapCoordinates function from this how to guide?
http://help.infragistics.com/NetAdvantage/DV/2010.2/CLR4.0/?page=xamWebMap_Add_Open_Street_Maps_as_Geo-Imagery_Data_Source.html