none
Choppiness issue with polygon rendering during drag and animate (AJAX control v7) RRS feed

  • Question

  • I've been creating a series of polygons which overlay the road map, the total polygon count is relatively low - maybe 30 buildings. When the map is dragged or animated, any polygons outside of the event's initial map bounds are not rendered until there is a moderate pause in the drag event. Polygons outside the events initial bounds are not drawn at all while an animation from point A to point B is running. This behavior makes the experience of navigating the different polygons feel choppy and unpolished. During a drag event, it becomes a usability issue as the user dragging the map is likely looking for a polygon (i.e. a representation of a building) outside the initial map bounds when the drag event began.

    I understand that in order to accommodate high polygon counts, the map can't assume that it can render everything all the time, however, given my particular use case, I'd like to improve the frequency of the polygon rendering. I can add a timer for the event, and in some browsers, the 'viewchange' event may be called back with enough frequency to improve the user experience.

    The only thing I seem to be missing is a "RenderEntitiesImmediately" method that can force a redraw. Does such a method exist? I've not been able to find it in the API docs. If not, are there any hacks to increase the frequency of redraw of a map's entities?

    EDIT:
    I'm using the Bing Maps AJAX Control, Version 7.0

    Thanks!


    • Edited by bckeene Monday, November 28, 2011 4:15 PM did not reference the control
    • Moved by Ricky_Brundritt Saturday, March 10, 2012 12:22 PM (From:Bing Maps: Map Control and Web services Development)
    Monday, November 28, 2011 3:59 PM

Answers

  • I can see what you are reffering! We would so some more optimizations to the rendering to improve the effects on new browsers, right now there is no public API to force update of entities.

    Thanks for using mapcontrol.


    MSFT
    Hemant Goyal
    Tuesday, November 29, 2011 9:26 PM

All replies

  • Are you experencing on all browsers or any specifc browser? I see decent polygon rendering in HTML5 enabled browsers.
    MSFT
    Hemant Goyal
    Monday, November 28, 2011 5:52 PM
  • Thanks for the reply, Hermant. It seems to be consistent across browsers, I'm testing with Firefox 8 and Chrome 15. The behavior very well could feel choppy due to the particular user interface I'm developing, and might not feel off in another type of overlay. What I'm seeing is that during a drag, there isn't a redraw of the polygons until the mouse drag is paused (user stops dragging for a second), or the drag is ended. During that period, polygons areas that were not within the drag start initial bounds are not showing up. It is best described with an image (below).

     

     

    Monday, November 28, 2011 6:37 PM
  • Are you experencing on all browsers or any specifc browser?
    Interesting - IE seems to handle it well, so it seems to be mozilla/webkit (FF 8/Chrome 15) only.
    Monday, November 28, 2011 9:26 PM
  • DO you have URL to your site or any sample which will help to repro the issue? I might be doing something different that why not able to repro on chrome as well!
    MSFT
    Hemant Goyal
    Monday, November 28, 2011 9:28 PM
  • Hermant, thanks again for taking a look, I've put it online:

    http://www.keene.edu/test/campusmap/

    I'm going to look around for another example of polygons and make sure it's occurring outside of my development. If it's something particular to something I've done, I don't want to waste your time. At the link, if you click on some of the place names on the right, it should animate to the polygon and the behavior should be present. The redraw occurs at the end of the animation, it is more pronounced on a drag (and continues so long as the drag is in motion).

     

     

    Tuesday, November 29, 2011 2:18 PM
  • I've verified that the behavior exists outside of my development at http://talkingdonkey.cloudapp.net/BM-AJ-V7/Default.aspx (using both 7.0 and 6.3). It also seemed less pronounced when I tried it on a faster machine (my development pc is a dinosaur). Anyways.. I'm guessing that the map only draws what it needs to as an optimization to maximize javascript performance/responsiveness. If I could call a polygon rendering method directly, I'm pretty sure I could attach a timer during the drag and animate actions that could add rendering "frames" between the start and end of the event, though I can't seem to find a public method (or hack) to do that.

    Tuesday, November 29, 2011 3:16 PM
  • I can see what you are reffering! We would so some more optimizations to the rendering to improve the effects on new browsers, right now there is no public API to force update of entities.

    Thanks for using mapcontrol.


    MSFT
    Hemant Goyal
    Tuesday, November 29, 2011 9:26 PM
  • Ah, ok. Thanks for taking a look. I'll keep my fingers crossed for a future update.
    Tuesday, November 29, 2011 10:02 PM