Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1735
Caching tiles locally
posted

Hi,

I'm evaluating the XamMap class and currently I'm looking into how to use this control with a local tile cache for use with OpenStreetMap. I e.g. want downloaded tiles to be cached and reused if they have been cached within the last 30 days.

As far as I can see I can use a subclass of MapTileSource as an extension point. However, this only provides the XamMap with a tile URL. I need to get access (callback?) to the tile data when the tile for the provided URL has been downloaded, so that I can save the tile to disk. What are my options here ? 

Regards,
Leif

 

 

 

 

Parents
  • 30692
    Verified Answer
    Offline posted

    Leif,

    Yes, the custom tile source lets you change the url's provided, but, at the moment you can't extend the portion of the multi scale image that would allow you to redirect at a cache. There are other options as to how to achieve this though. You could use a local web proxy that cached the tiles, and make sure that the urls generated would be fed through the proxy, for one. Or, alternatively, you could register a scheme handler for your application and make sure that the uri's provided by the tile source use this custom scheme. That handler could check for the uri in local storage before firing off the actual request if the file isn't cached yet.

     

    I haven't tried this approach for the tile imagery before, but here is a link were I am using a custom scheme to load shape files from isolated storage for the Silverlight version of the map: http://es.infragistics.com/community/forums/p/39754/224934.aspx#224934

    The principle should be the same, let us know if you have any issues applying that approach.

     

    -Graham

Reply Children
No Data