开发者

LocationToViewportPoint issue

开发者 https://www.devze.com 2023-02-13 02:48 出处:网络
I have an issue with this where LocationToViewportPoint for Bing Maps is calculating ba开发者_JAVA技巧sed on current viewport of the map as opposed to calculating the target viewport point.

I have an issue with this where LocationToViewportPoint for Bing Maps is calculating ba开发者_JAVA技巧sed on current viewport of the map as opposed to calculating the target viewport point.

The reason is because if the user is panning/zooming the map, this method will return inconsistent results.

I've tried reflecting this method but to no avail, does anyone have any more insight on how to solve this problem?


Solved this:

What I had to do was turn off the AnimationLevel for (panning/zooming) and explicitly SetView to the target bounding rectangle and then performed whatever calculations I needed to calculate the Map's new center point.

I then changed the AnimationLevel back on and then setting the new Map's center point for the map to zoom/pan to.

Apparently the LocationToViewportPoint had a dependency on AnimationLevel and "current" view.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号