none
Report bug: map.setView({ labelOverlay: Microsoft.Maps.LabelOverlay.hidden }) does not take effect immediately. RRS feed

  • Question

  • When I call 
    map.setView({ labelOverlay: Microsoft.Maps.LabelOverlay.hidden })
    , the labels on the map does NOT disappear immediately. It will disappear when I zoom or pan the map afterward. The same bug exists when the labels being turned on.

    Jim King


    Saturday, October 26, 2019 3:29 AM

Answers

  • Hi Jim,

    The team is already aware of the issue from your previous post.  I am afraid I can't give you a timeline but they believe they know the cause.

    Sincerely,

    IoTGirl

    • Marked as answer by Jim King 2000 Thursday, October 31, 2019 12:16 AM
    Wednesday, October 30, 2019 8:51 PM
    Owner

All replies

  • Hi Jim,

    Where and when are you calling the set view? The change will only occur when the map is redrawn. https://github.com/Microsoft/BingMapsV8CodeSamples/blob/master/Samples/Map/Set%20Map%20View.html

    Sincerely,

    IoTGirl

    Monday, October 28, 2019 3:51 PM
    Owner
  • Hi IoTGirl,

    I call map.setOptions(...) and map.setView(...) in the callback of my select control which can show/hide roads(and road labels) on Bing Maps. The road would disappear immediately while labels wouldn't. So, how to trigger a redraw in code?

    Thanks,

    Jim Jin


    Jim King


    Monday, October 28, 2019 4:12 PM
  • Hi Jim,

    Thank you for the extra info.  The V8 Maps team will take a look this week and see what you are seeing.

    Sincerely,

    IoTGirl

    Monday, October 28, 2019 8:43 PM
    Owner
  • Hi IoTGirl,

    I change my code to call map.setView(...) first and call map.setOptions(...) later, the bug has gone. It seems that map.setOptions(...) triggers a redraw while map.setView(...) does not.

    You can reproduce the bug by enabling/disabling "labels" through the default map UI (see the picture).


    Thanks,

    Jim Jin


    Jim King

    Tuesday, October 29, 2019 1:58 AM
  • Hi Jim,

    The team is already aware of the issue from your previous post.  I am afraid I can't give you a timeline but they believe they know the cause.

    Sincerely,

    IoTGirl

    • Marked as answer by Jim King 2000 Thursday, October 31, 2019 12:16 AM
    Wednesday, October 30, 2019 8:51 PM
    Owner
  • It is OK for the timeline. I workaround it (call map.setOptions() after map.setView()) and it can work now.

    Jim King

    Thursday, October 31, 2019 12:18 AM
  • Great!  Thank you for the update Jim!
    Thursday, October 31, 2019 4:57 PM
    Owner