none
MapTileLayer rendering problem? RRS feed

  • Question

  • In my Windows 8 Metro/Windows Store app I have configured the Bing map object to add a MapTileLayer, specifying the Source property to point to the server  holding our tiles. The tiles are actually transparent .png files intended to overlay the map tiles Bing gets.

    This seems to be working, except that the tile .png files themselves are inconsistently being blurred or perhaps scaled in a way that makes them look wrong. For example, often they look fine on first launch, and then if I drag the map away from its initial position they become blurred. It appears to be correlated with the watermark, i.e., tiles above the watermark that gets dragged down into it becomes blurred, and dragging it back above again returns it to normal. Oddly, tiles below the watermark are always blurred, dragged or not.

    Is this expected behavior for now?

    Thanks,

    Mark Peters

    Friday, August 31, 2012 9:24 PM

Answers

  • Thanks for the url. This is caused by a bug in our sampling code. When a tile is missing it renders the tile above it which will cover other tiles even if they're more detailed. You can work around this for now by never returning a 404 for any tile request but instead returning a blank image and 200 response so the incorrect sampling doesn't kick in.
    • Marked as answer by Mark Peters Tuesday, September 4, 2012 9:19 PM
    Tuesday, September 4, 2012 7:14 PM

All replies

  • Do you have a small self contained sample you can share?
    Monday, September 3, 2012 2:48 AM
  • I took the "Bing Maps Pushpin Sample" project, added my Bing Maps key, added  x:Name="Map" to the <bm:Map .../> tag in the xaml, then modified the MainPage class to contain this:

        public sealed partial class MainPage : Page
        {
            private MapTileLayer _tileLayer = new MapTileLayer();

            public MainPage()
            {
                this.InitializeComponent();
                _tileLayer.TileSource = @"...my tile source url.../{quadkey}.png";
               Map.TileLayers.Add(_tileLayer);
            }
    ...

        }

    Upon launch, the tiles start off clear then become blurry everywhere - perhaps while they're in the process of being loaded. If I tap the zoom out button once, then tap the zoom in button once, they become clear, and this appears to be 100% reproducible. I can get the same blurry/clear transition if I drag the map around for a bit, though I can't give precise steps to reproduce for that.

    The tiles are transparent .png files containing small filled circles in green, yellow and red. I can send you the URL used above privately if you need it to reproduce. I'd attach a sample .png, but I don't see a way to attach a file to this that doesn't also include the URL.

    Thanks,

    Mark Peters

    Tuesday, September 4, 2012 2:07 PM
  • I'll need the url to repro this. You can e-mail it to me first name dot last name at microsoft.com.

    Tuesday, September 4, 2012 3:57 PM
  • I'll need the url to repro this. You can e-mail it to me first name dot last name at microsoft.com.

    Okay, I sent it to you.
    Tuesday, September 4, 2012 5:15 PM
  • Thanks for the url. This is caused by a bug in our sampling code. When a tile is missing it renders the tile above it which will cover other tiles even if they're more detailed. You can work around this for now by never returning a 404 for any tile request but instead returning a blank image and 200 response so the incorrect sampling doesn't kick in.
    • Marked as answer by Mark Peters Tuesday, September 4, 2012 9:19 PM
    Tuesday, September 4, 2012 7:14 PM
  • Okay, but unfortunately the server response can't be changed - it is in production and is relied upon by every implementation of our app in the field.

    The server generates those .png files dynamically (with caching), and doesn't generate them at all beyond a certain zoom-in level. Our apps use the 404 response to know that they should make a similar request to a different server to get data that is appropriate for the zoom level.

    Is this bug going to be fixed in time for the formal release?

    Mark

    Tuesday, September 4, 2012 7:54 PM
  • Also, can you share any info on when that release might be?

    Mark

    Tuesday, September 4, 2012 7:56 PM
  • We're targeting september 27th as our release date. I cannot make any promises that this bug fix will make it in in time.

    Wednesday, September 5, 2012 2:14 AM
  • Kristoffer,

    I think I just found an already supported way to avoid this problem - please tell me if this has any negative side effects or is otherwise undesirable.

    There is a property in MapTileLayer called FillMissingTiles. It is true by default, but if I set it to false, the problem goes away.

    Is that an appropriate way to address this?

    Thanks,

    Mark

    Wednesday, September 5, 2012 3:50 PM
  • Yep. That will do nicely for you.
    Wednesday, September 5, 2012 4:07 PM