2
votes

We are developing a WPF application, mainly using the WPF Bing Maps control.

We have multiple tile layers which can be turned on or off at runtime. The tile layers retrieve their data using a custom tilesource, so we have more control over the uri returned.

When the application starts multiple tilelayers are visible, causing calls to our restservices to retrieve the tiles. The services check the DB for images, if present, return the images, if not, generate the images, store them, and return them. So far it works like a charm.

Now the following 2 cases: DB gets cleared for some reason -> Services just recreate the images when the calls are made, and returns them. No problem here.

If someone clears the IE cache (client side), while the application is still running, zooms / moves around the map. The tiles loaded before disappeared, and are not coming back. When zooming in further, it does retrieve tiles that were not loaded before, but leaves us with big gaps in the tile layer(s).

Only way to solve this seems to be to close the application, clear IE cache, clear DB, and start again. What causes this behaviour? And why are, seemingly empty, images loaded?

After some digging around an option would be to give a tick parameter to the uri, so it will always retrieve new tiles. But this has a major performance penalty.

Any advice on how to solve this problem?

Thanks in advance.

1
Don't know how to solve this problem, but you may want to have a look at this alternative control. It has an API similar to that of the Bing Maps WPF control, but provides full control over local map tile caching. Besides the standard TileSource class that creates a tile URI, it also offers a special TileSource class that directly creates an ImageSource for a given zoom level, and x and y tile index.Clemens

1 Answers

0
votes

The tile layers in WPF cache the tiles and pulls the tiles from the cache if it has already loaded it once. If the cache is cleared then those tiles will not be reloaded. This is by design for performance. Especially for tile layers that do not have all possible tiles. There is no way around this.