1

Is there a way to center mapView on specific coordinates in specific mapView's frame?

Let me illustrate:

I have a centered pin:

enter image description here

At some point of time popup view may appear and I need to center my pin in visible mapView rect:

enter image description here

Moreover I have to do this during popup appearing animating (this is another issue since popup.frame is no KVO compliant)

What I have:

I've implemented fast-&-dirty solution by centering mapView on fake location. Simply I copied fake coordinates from original and replaced latitude, this lets original pin to be on top of popup.

But this approach not really elegant and not accurate.

Important: I can't change mapView's frame simple because popup has indents through which map is visible.

Injectios
  • 2,777
  • 1
  • 30
  • 50

0 Answers0