IOS MapKit: how to get a map for panning while dragging a marker?

I searched in vain for answers to this.

In the Google Maps JavaScript JavaScript API, when you drag the marker and draw near the edge, copy the map to make room for the marker, and bring more map into view. This is very useful for starting at location A and then dragging to location B; even if B is currently off the map.

This seems to be impossible in MapKit. There are no built-in functions for this.

Fair enough. I will write to myself. I will create rectangles around the edges, and if they include drag and drop, the map starts the pan. I would speed up the pan based on proximity to the edge.

In addition, there is also no way to get the location of a marker while dragging. You can get it only before and after. This kind of pooches is my great idea.

I tested this by writing NSTimer, which starts at the beginning of the drag and is invalid at the end. It repeatedly calls a function that reads the annotation object for its location.

When dragging, the location never changes.

Question: Any ideas on how I can make this “auto pan” work?

0
source share
2 answers

Nope. Sounds like you can't get from here.

, , , - , . , , .

, , drag-panning .

, MapKit.

0

- , , , .

0

Source: https://habr.com/ru/post/1612062/


All Articles