none
Odd behavior with street name rendering - not showing on initial display. RRS feed

  • Question

  • I've written a Windows Store C#/XAML app which uses a Bing Maps control on the initial page, and I'm seeing some odd behavior with the rendering of street names in road view.  The version I'm using is the most currently available (1.1.20120927.1).

    When the page is first rendered, the street names within the map control are not drawn.  If the user moves the map around even slightly, or zooms out or in, the street names are then drawn.  

    I have another page in the application with a smaller map control on it in which the attributes are set to identical values - the only major differences between these two map controls (other than the pages on which they reside) is their size, relative to the page, and the number of pins placed on them.  This second map control doesn't exhibit this behavior.

    What could cause the street names to fail to render when the app first loads?  Does there exist a workaround?

    Tuesday, November 13, 2012 8:05 PM

Answers

  • I found that setting visibility and view in this fashion corrected the behavior:

                map.Visibility = Windows.UI.Xaml.Visibility.Visible;

                map.SetView(new Location(40.4, -74.1), 15, MapAnimationDuration.None);

    We'll continue to investigate.

    Friday, November 30, 2012 12:01 AM

All replies

  • This sounds like a bug; can you put together a repro project?
    Tuesday, November 13, 2012 8:22 PM
  • I'm seeing the same problem. First view of a map shows roads with no names. Zoom in by one step and road names appear. Zoom out by one step - presumably to the original zoom factor - and there are still road names!

    Thursday, November 29, 2012 1:51 PM
  • I've managed to pull together a repro for this.

    Having copied over just the bits of code in my app that are relevant to the map usage, it looks like the key - at least in my usage - is that I start off by setting the visibility of the map to collapsed (as I'm not sure if I want to display the map yet). I then geocode the address, set the longitude & latitude of the map to the values and set the visibility to visible.

    The map then does not render properly.

    If, however, I leave the map control visible at all times, it seems to work perfectly.

    Let me know if you want the full project and I can share it somehow.

    Philip

    Thursday, November 29, 2012 2:17 PM
  • Hi Philip,

    I started with a collapsed map and then made it visible but in my case the labels are still appearing.  Could you zip up that repro project and make available at some cloud location where I can grab it? 

    Thanks a lot,

    Jim

    Thursday, November 29, 2012 9:50 PM
  • Nevermind Philip, we have a repro now.  -Jim
    Thursday, November 29, 2012 10:09 PM
  • I found that setting visibility and view in this fashion corrected the behavior:

                map.Visibility = Windows.UI.Xaml.Visibility.Visible;

                map.SetView(new Location(40.4, -74.1), 15, MapAnimationDuration.None);

    We'll continue to investigate.

    Friday, November 30, 2012 12:01 AM
  • Good to hear that you are able to repro this, Jim.

    Thanks for the suggestion of turning off the animation. That certainly seems to get the map drawing correctly.

    However, I have now noticed that the scale & copyright is being rendered in white text instead of black. Again, this seems to be tied into the Visible/Collapsed setting. If the control starts off visible, it all gets displayed correctly.

    Philip

    Friday, November 30, 2012 8:54 AM