ClemensFischer / XAML-Map-Control

XAML Map Control Library
Microsoft Public License
203 stars 59 forks source link

Zoom to view all items? #51

Closed mennowo closed 4 years ago

mennowo commented 4 years ago

Hello, first off: thanks for a great control! Easy to use, and it has always just worked. A question: is it possible to make the map zoom in a way so that a given range of GPS coordinates will become visible? Thank you! Greets, Menno

ClemensFischer commented 4 years ago

Sure, there is a ZoomToBounds method in MapBase.

mennowo commented 4 years ago

Ok, thanks! Now I am trying to databind to the BoundingBox dep. property on the Map control. Is that supposed to have the same effect? Setting it to a new value seems to no influence the view. Thanks again.

ClemensFischer commented 4 years ago

Not sure what you mean. There is nothing like a "BoundingBox dep. property on the Map control".

mennowo commented 4 years ago

Map inherits from MapBase, which in turn inherits from MapPanel. The latter has a DependencyProperty BoundingBox, which I tried databinding to. However, I now got it working using the ZoomToBounds method you mentioned, wrapping that in dependency property in a user control. Thanks again! Greets, Menno

On Wed, Apr 29, 2020 at 9:57 PM Clemens notifications@github.com wrote:

Not sure what you mean. There is nothing like a "BoundingBox dep. property on the Map control".

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ClemensFischer/XAML-Map-Control/issues/51#issuecomment-621429900, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANHGEVBY4VEFWGUMGO6UQDRPCBD3ANCNFSM4MTYR23Q .

-- To ensure safety and privacy, this email will selfdestruct in 5 seconds. Don't panic!

ClemensFischer commented 4 years ago

That is an attached property, which can be set on child elements of a MapPanel (e.g. an Image element in a MapImageLayer), but not a MapPanel itself. The Map element does not have a BoundingBox property.