Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
Shapefile not working properly with open streets map
posted

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 x:Name="mapLayer" FillMode="None" Fill="Transparent" >

<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>