Getting Started with UriImageProvider

4 posts, 0 answers
  1. Edwin
    Edwin avatar
    2 posts
    Member since:
    Aug 2016

    Posted 05 Aug Link to this post

    I know there's probably a simple solution to this problem but I cant find it for the life of me. Im trying to use RadMap in order to display a floor plan that I can later add points to similar to the demo shown here. The issue that im facing is that I cant get the Floor plan to appear. Ive tried using different images with different sizes and that has yet to yield any results when I run it I simply see a blank canvass with the coordinates. The floor plan is saved as a FloorMap.png and for now I have placed it in my desktop. I was not sure how to set the GeoBounds so I have left them as they appear in the sample used here

    <UserControl x:Class="testingxaml.MainPage"
                HorizontalAlignment="Center" VerticalAlignment="Center"
                 mc:Ignorable="d" d:DesignWidth="625" d:DesignHeight="629">
        <Grid x:Name="LayoutRoot">
     
            <telerik:RadMap x:Name="xRadMap"
                            NavigationVisibility="Collapsed"
                            ZoomBarVisibility="Collapsed"
                            CommandBarVisibility="Collapsed"
                            Center="42.72481708629, 23.3176519378416">
                 
                             
                <telerik:RadMap.Provider>
                    <telerik:UriImageProvider GeoBounds="42.786, 23.17, 25, 14" Uri=file:///C:/Users/*****/Desktop/FloorMap.png/>
                </telerik:RadMap.Provider>
            </telerik:RadMap>
        </Grid>
    </UserControl>

     

  2. Dinko
    Admin
    Dinko avatar
    201 posts

    Posted 10 Aug Link to this post

    Hi Edwin,

    Thank you for contacting us.

    The image doesn't appear because you haven't set the ZoomLevel property of the RadMap. Basically, when you are using the UriImageProvider by design it require that you specify zoom level. In your case you can set to 10 for example:
    <telerik:RadMap x:Name="xRadMap"
                    NavigationVisibility="Collapsed"
                    ZoomBarVisibility="Collapsed"
                    CommandBarVisibility="Collapsed"
                    Center="42.72481708629, 23.3176519378416"
                    ZoomLevel="10">
     . . . . . . . . . .

    Give it a try and let me know if it works for you.

    Regards,
    Dinko
    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. Edwin
    Edwin avatar
    2 posts
    Member since:
    Aug 2016

    Posted 11 Aug in reply to Dinko Link to this post

    I made the change that you suggested but its still not displaying anything.

    Do i need to change anything within the .cs file?

  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 12 Aug Link to this post

    Hi Edwin,

    I am attaching a sample project in which RadMap shows Image with ImageProvider. Can you modify it with your settings and try to break it ? On your side, you can double check:

    - the URI you give ; simply place Image with the same URI source next to the Map 
    - the VS output for some binding  / other errors

    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.
Back to Top