This project has moved. For the latest updates, please go here.

Missing BingMaps tiles at high zoom levels

Feb 27, 2015 at 11:30 AM
Hi, and Kudos for the wonderful XAML MapControl!
I think it would be a big improvement to get rid of the ugly BingMaps fallback tiles at high zoom levels (e.g. zoom >14 near Minsk at N 53°58' E 26°49'). Just like the MS BingMaps for WPF Control, the XAML MapControl should be able to only display available tiles of previous zoom levels as fallback.
Probably the ErrorDetails of the REST imagery metadata response need to be checked for that.
Do you plan to implement such a feature in the future (2015), or can anyone already provide such a solution?
Coordinator
Feb 27, 2015 at 2:05 PM
Have you tried to implement this by creating a specialized TileSource? It would have to have some knowledge about the maximum currently available zoom level. If you could provide such an implementation, or an idea how it would work, I'd be happy to integrate it.
Mar 3, 2015 at 2:16 PM
Edited Mar 3, 2015 at 2:25 PM
I didn't find the time to dig deeper into the BingMaps REST API, so for the moment I just implemented a quick hack which seems to solve the issue.
In Tile.SetImage(...) I now check the bitmap's PixelFormat and color of each corner pixel. If the two corner pixels of the same edge are black or the PixelFormat is not Pbgra32 and not Bgr32, then the Image.Source of the tile is set to null instead. The whitish BingMaps fallback tiles all seem to have Indexed4 format and all partially black tiles are detected using the corner check. This could also easily be improved by probing some more pixels than just the corners, so that for example only tiles which are at least 50% black are filtered away.
Sep 12, 2016 at 9:44 AM
Thought everyone might be interested in one solution for this. The issue comes from some locations having tiles at high zoom (e.g. major cities) versus some areas with little content (e.g., ocean, deserts).

I created a modified TileImageLoader that processed the WebResponse Headers for additional information. Turns out that there a key named 'tile-info' with a value of 'no-tile' that signifies if there is not content within the returned tile. I tried this from a few sources (Bing, OSM) and found it appears to be a common key.

Replace the GetExpiration method with something similar to below
        private static void GetHeaderDetails(WebHeaderCollection headers, out DateTime expiration, out bool noImage)
        {
            noImage = false;

            var tileInfoHeaderKeys = headers.AllKeys.Where(key => key.Contains("tile-info", StringComparison.OrdinalIgnoreCase));
            foreach (var headerKey in tileInfoHeaderKeys)
            {
                var headerValue = headers.Get(headerKey);
                if (headerValue.Contains("no-tile", StringComparison.OrdinalIgnoreCase))
                {
                    noImage = true;
                    break;
                }
            }

            // ... previous expiration date code goes here ...
        }
Coordinator
Sep 14, 2016 at 4:16 PM
Edited Sep 14, 2016 at 4:18 PM
Apparently Bing Maps sets a X-VE-Tile-Info header with value no-tile, where VE stands for Virtual Earth, the former name of Bing Maps. Couldn't find any documentation, though.

Which OSM server is also setting this (or a similar) header?
Coordinator
Oct 18, 2016 at 10:42 AM
TileImageLoader now (Version 2.13) evaluates the X-VE-Tile-Info HTTP header, and does no longer show the Bing Maps fallback tiles.
Marked as answer by ClemensF on 2/20/2017 at 12:51 PM