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

TiledMapSource gettile method using bitmap source

3 Answers 110 Views
Map
This is a migrated thread and some comments may be shown as answers.
Hakan
Top achievements
Rank 1
Hakan asked on 03 Feb 2017, 03:10 PM
TiledMapSource GetTile method using bitmap source
How can I change the Uri for Bitmap Source?

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 08 Feb 2017, 09:47 AM
Hi Hakan,

You can implement a custom Provider in order to change the default URI RadMap uses to download map images. Basically, you create custom Provider and custom MapTileSource. Override the GetTile method of the MapTileSource in order to provide new URI.  

You can find custom provider example in this form thread.
public class LocalhostTileSource : TiledMapSource
{
      ...
/// <summary>
    /// Gets the image URI.
    /// </summary>
    /// <param name="tileLevel">Tile level.</param>
    /// <param name="tilePositionX">Tile X.</param>
    /// <param name="tilePositionY">Tile Y.</param>
    /// <returns>URI of image.</returns>
    protected override Uri GetTile(int tileLevel, int tilePositionX, int tilePositionY)
    {
..........

Please also check our Implement custom map provider help article which describes how you can create a custom provider.

Regards,
Dinko
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Hakan
Top achievements
Rank 1
answered on 08 Feb 2017, 11:33 AM

I want use the Bitmapsource like this:
protected override BitmapSource GetTile()

I dont want use static images or uri, only byteArray.

0
Dinko | Tech Support Engineer
Telerik team
answered on 10 Feb 2017, 11:28 AM
Hello Hakan,

Thank you for the additional information. Basically, the TileMapSource doesn't provide GetTile() method which returns an object of type BitmapSource. You can consider overriding the GetCachedTile() method which returns a stream that contains the image.

Regards,
Dinko
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Map
Asked by
Hakan
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Hakan
Top achievements
Rank 1
Share this question
or