neilang / NAMapKit

Allows you to use custom maps in iphone applications and attempts to mimics some of the behaviour of the MapKit framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dropping pins on zoomed maps

neilang opened this issue · comments

There is an issue with adding a pin after the zoom scale has been changed.

Simple workaround is to reset the zoom scale to 1.0 before adding the pin.

e.g.

// Calculate zoomed out position
CGPoint point = CGPointMake(location.x / self.mapView.zoomScale, location.y / self.mapView.zoomScale);

// Zoom to default level
[self.mapView setZoomScale:1.0 animated:YES];

// Focus on correct position
[self.mapView centreOnPoint:point animated:YES];

// Add annotation at new point
... = [NAAnnotation annotationWithPoint:point];

Fixed with the release of v2.0