RadMap displaying ShapeFile incorrectly

3 posts, 1 answers
  1. Jeremy
    Jeremy avatar
    2 posts
    Member since:
    Sep 2016

    Posted 11 Oct Link to this post

    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. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 12 Oct Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jeremy
    Jeremy avatar
    2 posts
    Member since:
    Sep 2016

    Posted 12 Oct in reply to Petar Mladenov Link to this post

    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. 

Back to Top