This is a migrated thread and some comments may be shown as answers.

RadMap displaying ShapeFile incorrectly

2 Answers 128 Views
Map
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 11 Oct 2016, 10:39 PM

I'm trying to get a shapefile into the radmap (intending to be similar to the hotel floor plan example), however my shapefile does not get displayed properly. It's using WGS84, and is displayed correctly with every shapefile viewer i can find

Attached expected and resulting outputs

<Grid>
            <telerik:RadMap x:Name="radMap"
                        UseDefaultLayout="False"
                        UseSpringAnimations="False"
                        Background="Transparent"
                        MouseDragMode="None"
                        MouseDoubleClickMode="None">
                <telerik:RadMap.Provider>
                    <telerik:EmptyProvider/>
                </telerik:RadMap.Provider>


                <telerik:VisualizationLayer x:Name="VisualizationLayer">

                    <telerik:VisualizationLayer.Reader>
                        <telerik:AsyncShapeFileReader PreviewReadShapeDataCompleted="OnPreviewReadShapeDataCompleted">
                            <telerik:AsyncReaderSource  DataSource="C:\temp\TestImageBlend\Test.dbf" Source="C:\temp\TestImageBlend\Test.shp"  />
                        </telerik:AsyncShapeFileReader>
                    </telerik:VisualizationLayer.Reader>
                </telerik:VisualizationLayer>
            </telerik:RadMap>
        </Grid>

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 12 Oct 2016, 12:37 PM
Hi Jeremy,

This might be an issue related to the format in which the shape file is saved. The projections which is supported by the RadMap are:

- The Mercator projection EPSG:4326 (default) that refers to WGS84 as (latitude, longitude) pair coordinates in degrees
- The OSGB-1936 projection which also known as EPSG:27700
- The EPSG:900913 projection which also known as EPSG:3857 and Pseudo-Mercator projection that refers to WGS84 as (latitude, longitude) pair coordinates in meters
 
However, since you use EmptyProvider (check the notes in the article), you can set its Projection property whose value by default is MercatorProjection. If your shp file is produced among with prj file you can check it for the type of projection used when building the shape file.


Regards,
Petar Mladenov
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Jeremy
Top achievements
Rank 1
answered on 12 Oct 2016, 01:08 PM

Thanks Petar,

I was unsuccessful with the WGS84 projection but I re-saved my shape files using the OSGB-1936 projection with the EmptyProvider.Projection set accordingly and my map is now being correctly displayed. 

Tags
Map
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Jeremy
Top achievements
Rank 1
Share this question
or