Faster way to access updated data after zoom

3 posts, 1 answers
  1. Nick
    Nick avatar
    19 posts
    Member since:
    Aug 2010

    Posted 24 Aug 2010 Link to this post

    Hi there,

    I am trying to zoom to a specific MapPolygon, in order to determine to zoom in or out, I need to access the MapPolygon's ScreenBounds property. The problem is that this does not seem to update untill the ZoomingFinished event triggers (which is about 1500ms). If you need to zoom 4-5 levels, this just takes too long. Is there a different (faster) way to determine the ScreenBounds of a MapPolygon after changing the Zoom Level?

    Thanks in Advance.

    [Edit]
    It isn't that gracefull, but it does the trick... Disabling Spring Animations while adjusting zoom certainly speeds things up.
    [/Edit]
  2. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 25 Aug 2010 Link to this post

    Hello Nick,

    I am afraid there is no way to get screen bounds of the map shape before zooming is finished. During zooming with spring animation coordinate system is changing continuously, so any calculation would not give the correct result. Fortunately you would not need to use screen coordinates to zoom in to the specific map polygon. It is enough to have its geographic locations. You can use following code to zoom in to the specific map polygon:

    LocationRect rect = polygon.GeographicalBounds;
    this.radMap.SetView(rect);


    Kind regards,
    Andrey Murzov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Nick
    Nick avatar
    19 posts
    Member since:
    Aug 2010

    Posted 25 Aug 2010 Link to this post

    Thank you.
Back to Top