Answered Constrain view in WPF bing maps

  • Friday, August 31, 2012 7:01 PM
     
     
    In Bing Maps API - it;s possible to restrict map view with the help of overriding  ConstrainView() method of MapMode class. What about WPF control? MapMode is different and there is no ConstrainView() method. How one can constrain WPF map view? (e.g. full map, no infinite scroll and cetrain zoomlevels) Should it be done manually by overriding input control events?

    Evgeny Balykov

All Replies

  • Tuesday, September 04, 2012 8:03 PM
    Owner
     
     
    There is no built in method for doing this. Trying to do it manually using events usually ends up with bounce back effects that make for a poor user experience. Its usually best to just let the user navigate the map as they please. As it is, when the map is loaded it creates a session, all tiles load within that session are a part of that single session. So it doesn't incur any additional billable transactions on your account.

    http://rbrundritt.wordpress.com

  • Wednesday, September 05, 2012 3:23 PM
     
     

    I'm asking this question to find workaround against some strange WPF bing maps artifact we've found. Some weird things are happening to BoundingRectangle (which is extremely important for us because we're doing clusterization with R-Tree). Scenario: after map loads, zoom in to approx 2.2 and start slowly pan to the right. Here is the debugger output (captured OnFrameChange) during this scenario:

    Map centers:

    {25.532231704203,15.3276747018987,0}
    {25.532231704203,15.6337276343075,0}
    {25.532231704203,16.5518864315339,0}
    {25.532231704203,17.1639922963515,0}

    Map zoom levels:

    2.2
    2.2
    2.2
    2.2

    Map boudning rectangles:

    {84.4703439631608,-148.798448556473,0   -76.149651263786,179.453797960271,0}
    {84.4703439631608,-148.492395624065,0   -76.149651263786,179.75985089268,0}
    {84.4703439631608,-179.321990310094,0 -76.149651263786,-147.574236826838,0}   // HERE!
    {84.4703439631608,-178.709884445276,0   -76.149651263786,-146.962130962021,0}

    Because of this artifactal jump of SE longitudes our clusterization is failing too ...

    I understand that East = -147 coordinate tells us that the view is basically overlaps two maps now. But then - how user will get to know this to be able to adjust clusterization algorithm they are using. Any event which signals about this in particular? 

    And another thing - shift to 1 (16 -> 17) degree in the center isn't it to much to shift approx 33 degrees  (179 ->      -147) on the sides (of course keeping in mind that map projection is not linear)?

    Thanks!


    Evgeny Balykov



  • Thursday, September 06, 2012 9:59 PM
    Owner
     
     Answered
    This is caused by the wrap around effect of the map.

    http://rbrundritt.wordpress.com

    • Marked As Answer by Evgeny Balykov Wednesday, September 12, 2012 6:44 PM
    •