TiledMapSource gettile method using bitmap source

4 posts, 0 answers
  1. Hakan
    Hakan avatar
    3 posts
    Member since:
    Mar 2013

    Posted 03 Feb Link to this post

    TiledMapSource GetTile method using bitmap source
    How can I change the Uri for Bitmap Source?
  2. Dinko
    Admin
    Dinko avatar
    363 posts

    Posted 08 Feb Link to this post

    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.
  3. Hakan
    Hakan avatar
    3 posts
    Member since:
    Mar 2013

    Posted 08 Feb in reply to Dinko Link to this post

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

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

  4. Dinko
    Admin
    Dinko avatar
    363 posts

    Posted 10 Feb Link to this post

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top