This is the problem and what i'm trying to achieve https://i.stack.imgur.com/XpDQn.jpg
This is what i tried to achieve my goal https://i.stack.imgur.com/lF5hy.png
and my didUpdateLocations delegate
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{
CLLocation* location=[locations lastObject];
MKPointAnnotation*annotation=[[MKPointAnnotation alloc]init];
annotation.coordinate=location.coordinate;
annotation.title=@"Me";
annotation.subtitle=@"Current location";
MKCoordinateRegion region;
region.center=location.coordinate;
if(myLocation!=nil){
[_mapAsset removeAnnotation:myLocation];
myLocation=nil;
}
[_mapAsset addAnnotation:annotation];
myLocation=annotation;
[self zoomToFitMapAnnotations:_mapAsset];
}
As you can see in ScreenShot, my MKPointAnnotation is overlaying my MKMapView.I tried to put my mapView in another UIView (to use it like container) but it didn't work. I believe reason why this happening is beacuse I'm putting my annotation in code which means on all layers.
I'm using iOS7.1 SDK and Xcode5. Any advice can be useful.
Thanks in advance