0

I have a Windows Store (8.1) app that uses Bing Maps library and I am converting to UWP using the MapControl.

My map has a partial floating overlay to the right of the screen showing some extra info, however, this moves the effective center of the map to the left. This means when the map zooms in/out it should zoom in around a point offset to the left of actual map center.

I handled this in Bing Maps using the SetZoomLevelAroundPoint method however there does not seem to be an equivalent in UWP MapControl. Methods like TryZoomInAsync do not allow a point to be specified to zoom in around.

How can I achieve this using UWP MapControl?

EDIT: Here is a sketch of the setup

enter image description here

rbrundritt
  • 16,570
  • 2
  • 21
  • 46
Brendan
  • 18,771
  • 17
  • 83
  • 114
  • it's not quite clear as to what you're trying to do here, as I haven't done used it. can you showcase a vid (upload a screen recording somewhere and paste the link here) and then I can help you out on how can you achieve the same on UWP – iam.Carrot Oct 05 '17 at 14:36
  • @AdityaSharma I've uploaded a sketch of what I mean – Brendan Oct 05 '17 at 14:49

1 Answers1

0

For this scenario you should use the ViewPadding property on MapControl. You could also use the TransformOrigin property, but ViewPadding is the preferred method.

Duncan Lawler
  • 1,772
  • 8
  • 13
  • I can't use this property on my min target of 10.0.10240 - Is there a fallback for older versions? – Brendan Oct 05 '17 at 16:43
  • ViewPadding was designed for this scenario, but it's only available from Creator's update. TransformOrigin should be usable on older builds, but it has some other effects you may not want. – Duncan Lawler Oct 05 '17 at 17:24