Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8322767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:29:42+00:00 2026-06-08T23:29:42+00:00

I am trying to use a custom tileset for Bing maps. What I am

  • 0

I am trying to use a custom tileset for Bing maps. What I am trying to do is similar to the question here, but I’m trying to understand how a URI is formatted so that I can host the tiles within the application. The reason I am trying to host this locally is because I want to limit network traffic out from my application as much as possible.

Are there any tutorials on hosting the map tiles locally or a more in depth tutorial on how to have the URI point to a local storage path?

Thanks in advance for any advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:29:43+00:00Added an answer on June 8, 2026 at 11:29 pm

    The central point in the Bing Maps (or Google Maps or OpenStreetMap) tiled map scheme is that each map tile is identified by three parameters. These are the zoom level (that typically ranges from 0 or 1 to about 20) and the x and y index of a tile within a zoom level. In a given zoom level z the x and y index range from 0 to 2^z-1. In zoom level 0 there is one tile, in level 1 there are 2×2 tile, in level 2 there are 4×4 tiles and so on.

    Most map tile providers like OpenStreetMap or Google Maps directly reflect these three parameters in their tile URIs. OpenStreetMap for example provides map tiles by the URI http://tile.openstreetmap.org/z/x/y.png.

    In a derived TileSource class you override the GetUri method to provide an URI for the three tile parameters. For OpenStreetMap alike tiles such a derived TileSource might look like this:

    public class MyTileSource : Microsoft.Maps.MapControl.WPF.TileSource
    {
        public override Uri GetUri(int x, int y, int zoomLevel)
        {
            return new Uri(UriFormat.
                           Replace("{x}", x.ToString()).
                           Replace("{y}", y.ToString()).
                           Replace("{z}", zoomLevel.ToString()));
        }
    }
    

    For some stupid technical detail in the Bing Maps WPF Control TileLayer class you would also have to derive your own TileLayer class to enable usage in XAML:

    public class MyTileLayer : Microsoft.Maps.MapControl.WPF.MapTileLayer
    {
        public MyTileLayer()
        {
            TileSource = new MyTileSource();
        }
    
        public string UriFormat
        {
            get { return TileSource.UriFormat; }
            set { TileSource.UriFormat = value; }
        }
    }
    

    You would then use it in the Map Control like below where the XAML namespace m references Microsoft.Maps.MapControl.WPF and local references the namespace that contains the derived TileLayer.

    <m:Map>
        <m:Map.Mode>
            <!-- set empty map mode, i.e. remove default map layer -->
            <m:MercatorMode/>
        </m:Map.Mode>
        <local:MyTileLayer UriFormat="http://tile.openstreetmap.org/{z}/{x}/{y}.png"/>
    </m:Map>
    

    Instead of creating a http URI you might now also create an URI for a local file. You could for example organize the map tiles in a directory structure with a directory for the zoom level, a subdirectory for the x index and a file name for the y index. You could set the UriFormat property in a way that specifies a local path:

    <local:MyTileLayer UriFormat="file:///C:/Tiles/{z}/{x}/{y}.png"/>
    

    The overridden GetUri method might also directly create an appropriate local file URI, without using the UriFormat property:

    public override Uri GetUri(int x, int y, int zoomLevel)
    {
        string rootDir = ...
        string path = Path.Combine(rootDir, zoomLevel.ToString(), x.ToString(), y.ToString());
        return new Uri(path);
    }
    

    You may want to read more about how OpenStreetMap handles map tile names.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use custom check boxes within Fancybox. They are showing up but
I am trying to simply use a custom view helper that is located in
I'm trying to use custom font for my iOS app. Here is what I
I'm trying to use a custom textfield background. The problem is that the text
I'm trying to use a custom ::selection effect in Chrome but getting this bad
I'm trying to use a custom class (be.myname.rssreader.util.Global) extending android.app.Application, but when I try
I'm trying to use custom validator with my Rails 3 app. Here are my
I'm trying to use a custom image for checkboxes, as discussed in this question:
I'm trying to use custom meta boxes in wordpress. My goal at the moment
I am trying to use a custom segue to perform a kind of zoom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.