I'm using the Skobbler ios SDK.
I add two annotations to my map view. Then I route between these two points. The routing succeeds, but the annotation (pin) for the first point, the starting point disappears -- Actually the first annotations moves behind the second annotation. If I look carefully at the second annotation (pins) at the end of the route, I can see that there is another annotation behind it.
The app shows an annotation's callout when I tap the annotation. If I carefully tap the annotation behind the the end point annotation, the callout for the first annotation at the beginning of the route appears in its original starting point location. The annotation at the beginning of the route has improperly (so it seems to me) moved behind the annotation at the end of the route, but its callout remains at the correct position at the beginning of the route.
Why is the first annotation moving, and how can I keep it at its original position.
Thanks!
EDIT: iOS 9, Swift.
Its pretty generic code taken from snippets at http://developer.skobbler.com/getting-started/
func mapView(mapView: SKMapView, didLongTapAtCoordinate coordinate: CLLocationCoordinate2D) {
let annotation = ABPAnnotation()
annotations.append(annotation)
annotation.identifier = Int32(annotations.count)
annotation.annotationType = SKAnnotationType.Red
annotation.location = coordinate
let animationSettings = SKAnimationSettings()
mapView.addAnnotation(annotation, withAnimationSettings: animationSettings)
self.mapView(mapView, didSelectAnnotation: annotation)
}
func mapView(mapView:SKMapView!, didSelectAnnotation annotation:SKAnnotation!) {
mapView.calloutView.location = annotation.location
mapView.calloutView.titleLabel.text = "Annotation"
mapView.calloutView.subtitleLabel.text = "subtitle"
mapView.showCalloutForAnnotation(annotation, withOffset: CGPointMake(0, 42),
animated: false);
}
@IBAction func routeAction(sender: AnyObject) {
let route = SKRouteSettings()
route.startCoordinate = annotations[0].location
route.destinationCoordinate = annotations[1].location
route.shouldBeRendered = true
route.routeMode = SKRouteMode.CarEfficient
route.maximumReturnedRoutes = 1
route.routeRestrictions.avoidHighways = false
route.requestAdvices = true
SKRoutingService.sharedInstance().calculateRoute(route)
}
func routingService(routingService: SKRoutingService!,
didFinishRouteCalculationWithInfo routeInformation: SKRouteInformation!) {
routingService.zoomToRouteWithInsets(UIEdgeInsetsZero, duration: 400)
}