This is a migrated thread and some comments may be shown as answers.

[Solved] Faster way to access updated data after zoom

2 Answers 102 Views
Map
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nick
Top achievements
Rank 2
Nick asked on 24 Aug 2010, 12:23 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 25 Aug 2010, 05:21 PM
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
0
Nick
Top achievements
Rank 2
answered on 25 Aug 2010, 08:18 PM
Thank you.
Tags
Map
Asked by
Nick
Top achievements
Rank 2
Answers by
Andrey
Telerik team
Nick
Top achievements
Rank 2
Share this question
or