New to Telerik UI for WinUI? Download free 30-day trial

UriImageProvider

RadMap provides support for single image provider through the UriImageProvider class besides the built-in support for tiled (MultiScaleImage) providers like BingRestMapProvider and OpenStreetMapProvider.

The UriImageProvider is suitable for showing images of city areas or cities. It is not designed to handle big geographical spaces (such as entire countries or continents) as this may result in a considerably big size of the created images which may cause an OutOfMemoryException on some machines.

Assuming that images with names osm_10.png, osm_11.png, ..., osm_14.png are embedded as Content within the application assembly, you can initialize the UriImageProvider like this:

Example 1

<dataVisualization:RadMap x:Name="RadMap1"  
                ZoomLevel="10"  
                MinZoomLevel="10"  
                MaxZoomLevel="14"  
                Center="42.72481708629, 23.3176519378416" 
                NavigationVisibility="Collapsed" 
                ZoomBarVisibility="Collapsed" 
                CommandBarVisibility="Collapsed"> 
    <dataVisualization:RadMap.Provider> 
        <telerikMap:UriImageProvider GeoBounds="42.786, 23.17, 25, 14" Uri="/Examples/Map/Shapes/osm_{zoom}.png" /> 
    </dataVisualization:RadMap.Provider> 
</dataVisualization:RadMap> 
The UriImageProvider provides support for the following specific properties:
  • Uri: Gets or sets the uniform resource identifier (URI) for the image location.

WinUI RadMap Rad Map Features UriImageProvider WinUI RadMap

If you have separate image for every zoom level then the URI string must contain {zoom} placeholder. This part will be replaced with the actual zoom level when the image is requested (e.g."/Examples/Map/Shapes/imageName_{zoom}.png").

  • BaseAddress: Gets or sets the uniform resource identifier (URI) of the base address for the image location.

  • ZoomNumericFormat: Gets or sets numeric format string will be used to replace {zoom} placeholder. For example "D2" will replace {zoom} placeholder with 2 digits integer (01, 02, ..., 19). The default value is null and it produces simple integer without paddings (1, 2, ... 9, 10, ... 19).

Note that the UriImageProvider cannot be used as a master provider in a multi-provider scenario and always should be restricted within geographic region (i.e. you need to set the UriImageProvider.GeoBounds property).

In this article
Not finding the help you need?