Question

This is the problem and what i'm trying to achieve http://i.stack.imgur.com/XpDQn.jpg

This is what i tried to achieve my goal http://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

Was it helpful?

Solution


Thanks to @Evan_Mulawski and answer here I finally did what i tried.

First of all i deleted all of my mapview and its containerview's attributes like setShadowColor,cornerradiues,masksToBounds e.g.

And also deleted what i did in my storyboard to make them fresh new.

Then i added these code

[[_viewContainer layer] setShadowOpacity:0.55f]; [[_viewContainer layer] setShadowRadius:15.0f]; [[_viewContainer layer] setCornerRadius:8.0f]; [[_viewContainer layer] setBorderWidth:1.0f];

and fixed my issue. Thanks for helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top