Infragistics® WPF 2014.2
Change Map Coordinate System

The xamMap™ control assumes all shapefiles are in unprojected geodetic coordinates and displays them using the projection specified in the the xamMap control's MapProjectionType property. SphericalMercator is the default value. For more information on projection types, please refer to Understanding xamMap section.

If a Shapefile contains unprojected coordinates, you only need to read in the Shapefile, and xamMap will display the data. However, if the Shapefile's coordinate system uses a map projection, you must specify this input projection when reading in the Shapefile. Specifying the CoordinateSystem allows for the xamMap control to correctly interpret and visualize the map. This allows you to combine multiple map data (states, cities, roads) independent of their coordinate systems.

The following code shows you how to read a Shapefile of Indiana State specified using the US State Plane Coordinate System for Indiana East zone. Usually, you can find information about the coordinate system of a map in the .prj or .txt Shapefiles. An example of what the information might look like can be found here: IndianaShapefile.



<igMap:MapLayer x:Name="Indiana">
   <igMap:ShapeFileReader Uri="/../../Shapefiles/IndianaShapefile">
      <!-- Specify coordinate system with input projection type.
           Settings for each attribute is obtained from the .txt Shapefile -->
         <igMap:CoordinateSystem UnitType="M" FalseEasting="500000.0">
               <!-- The Shapefile uses Transverse Mercator Map Projection -->
               <igMap:TransverseMercator EllipsoidType="NAD83" 
                                         ScaleFactor="0.9996" CentralMeridian="-87.0" LatitudeOrigin="0.0"     />



Copyright © 2008-2014 Infragistics, Inc. All rights reserved.

E-mail your feedback on this topic.