Results 1 to 4 of 4

Thread: iOS: Pin dissapears when moving Map

  1. #1
    Etablierter skobbler
    Join Date
    04.07.2014
    Posts
    10

    iOS: Pin dissapears when moving Map

    Hi, again me :P

    After the latest update (2.1.0 I think) the Pin gets dissapeard when moving the map.
    Is it a known issue?

    Code how I create the Pin/Pins

    Code:
    self.placeMapView = [[SKMapView alloc] init];
        self.placeMapView.frame = CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame));
        self.placeMapView.delegate = self;
        self.placeMapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        self.placeMapView.settings.poiDisplayingOption = SKPOIDisplayingOptionNone;
        [self.view addSubview:self.placeMapView];    
        //add a circle overlay
        for(int i=0;i < latitude.count;i++)
        {
            //set the map region
            SKCoordinateRegion region;
            region.center = CLLocationCoordinate2DMake([latitude[i] floatValue], [longitude[i] floatValue]);
            region.zoomLevel = 17;
            self.placeMapView.visibleRegion = region;
            
            SKAnnotation *mapAnnotation = [SKAnnotation annotation];
            mapAnnotation.identifier = i;
            mapAnnotation.minZoomLevel = 5;
    
            mapAnnotation.annotationType = SKAnnotationTypeRed;
            mapAnnotation.location = CLLocationCoordinate2DMake([latitude[i] floatValue], [longitude[i] floatValue]);
    
            [self.placeMapView addAnnotation:mapAnnotation];
       }
    And the images:
    Before moving:
    Bildschirmfoto 2014-07-16 um 13.34.06.jpg
    After moving:
    Bildschirmfoto 2014-07-16 um 13.34.24.jpg

    Greetings
    Last edited by MeltingElements; 25.07.2014 at 09:38.

  2. #2
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399

    Cannot Reproduce [Annotations become invisible after panning the map]

    Hello,

    Unfortunately we cannot reproduce it.
    Can you please offer us more details/info. Can you reproduce the same issue with the demo project?

    Thank you,

  3. #3
    Etablierter skobbler
    Join Date
    04.07.2014
    Posts
    10
    Hi,

    no that doesn't happen in the demo. I also deleted the frameworks and copied again into my project but still the same.
    I don't know what kind of info you need. It happnes after the update.

    Here my whole code snippet in the view where the map is.

    Code:
    #import "MapViewController.h"
    #import 
    #import "PlaceDetailViewController.h"
    
    PlaceDetailViewController *placeDetail;
    @interface MapViewController ()
    
    @end
    
    @implementation MapViewController
    {
        NSArray *latitude,*longitude;
    }
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
        placeDetail = [[PlaceDetailViewController alloc] init];
        latitude = [placeDetail Latitude];
        longitude = [placeDetail Longitude];
        
        
        self.placeMapView = [[SKMapView alloc] init];
        self.placeMapView.frame = CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame));
        self.placeMapView.delegate = self;
        self.placeMapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        self.placeMapView.settings.poiDisplayingOption = SKPOIDisplayingOptionNone;
        [self.view addSubview:self.placeMapView];
        
        //add a circle overlay
        for(int i=0;i< latitude.count;i++)
        {
            //set the map region
            SKCoordinateRegion region;
            region.center = CLLocationCoordinate2DMake([latitude[i] floatValue], [longitude[i] floatValue]);
            region.zoomLevel = 17;
            self.placeMapView.visibleRegion = region;
            
            SKAnnotation *mapAnnotation = [SKAnnotation annotation];
            mapAnnotation.identifier = i;
            mapAnnotation.minZoomLevel = 5;
    
            mapAnnotation.annotationType = SKAnnotationTypeRed;
            mapAnnotation.location = CLLocationCoordinate2DMake([latitude[i] floatValue], [longitude[i] floatValue]);
    
            [self.placeMapView addAnnotation:mapAnnotation];
        }
    
    }
    -(void)mapView:(SKMapView *)mapView didSelectAnnotation:(SKAnnotation *)annotation
    {
        
        self.placeMapView.calloutView.titleLabel.text= placeDetail.Name;
        self.placeMapView.calloutView.titleLabel.font = [UIFont fontWithName:@"PTSans-Narrow" size:15];
        self.placeMapView.calloutView.subtitleLabel.text = @"";
        [self.placeMapView showCalloutForAnnotation:annotation withOffset:CGPointMake(0, 42) animated:YES];
        
        [self.placeMapView.calloutView.rightButton addTarget:self action:@selector(backToDetailView) forControlEvents:UIControlEventTouchUpInside];
    }
    
    -(void)backToDetailView
    {
        [self.navigationController popViewControllerAnimated:YES];
    }
    
    @end
    EDIT: I think I found the problem that causes this beahvior. In my app I have two kind of maps. One Mini Map and one large Map. But in two different views.
    When I deactivate the Mini Map it works. SO I think it has to do with the loading of the SKMap framework. Currently the mini map function is called in view did load method.
    So you know what to do here?
    Last edited by MeltingElements; 28.07.2014 at 08:59.

  4. #4
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    Thanks for the update.
    All the details were sent to our dev team and we are trying to find out the problem.

    We will get back to you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •