1

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

Onur Var
  • 1,778
  • 1
  • 16
  • 16
  • This question lacks sufficient information to diagnose the problem. Please include the [relevant parts of the code](http://stackoverflow.com/help/mcve) and explain what you're trying to accomplish and how your results differ from the desired results. Include any error messages you receive. Please read this advice on [ask] good questions and Jon Skeet's blog post [Writing the perfect question](http://msmvps.com/blogs/jon_skeet/archive/2010/08/29/writing-the-perfect-question.aspx). Pay special attention to the "Golden Rule", though I highly advise you to read the entire article. – Adi Inbar Apr 24 '14 at 23:59
  • Did you try setting the `clipsToBounds` property of the `MKMapView` to `YES`? – Evan Mulawski May 04 '14 at 18:13
  • +1 well prepared question: screenshot, code -- have and expected -- that would be example for other SO questions – Daij-Djan May 04 '14 at 19:11

1 Answers1

0

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

Community
  • 1
  • 1
Onur Var
  • 1,778
  • 1
  • 16
  • 16