PDA

View Full Version : iOS: Pin dissapears when moving Map



MeltingElements
25.07.2014, 09:17
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


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:
1370
After moving:
1371

Greetings

Adela_Silvia
25.07.2014, 10:11
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,

MeltingElements
25.07.2014, 10:56
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.



#import "MapViewController.h"
#import <SKMaps/SKMaps.h>
#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?

Adela_Silvia
05.08.2014, 14:08
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.