PDA

View Full Version : SKViaPoints.h is missing in SKMaps.h (Cocoa Pod)



jimt2000
02.01.2016, 20:06
When I install the ScoutMaps-iOS-SDK cocoa pod, I can't use SKViaPoint because its include file is not imported in SKMaps.h

jimt2000
04.01.2016, 21:11
I added SKViaMaps.h to SKMaps.h and it compiles. However, when I use SKViaPoints in a rout calculation, it crashes with
"libc++abi.dylib: terminating with uncaught exception of type std::length_error: vector"



var viaPoints = [SKViaPoint]()
viaPoints.append(SKViaPoint(2000, withCoordinate: CLLocationCoordinate2DMake(40.685623, -112.00685)))
viaPoints.append(SKViaPoint(2001, withCoordinate: CLLocationCoordinate2DMake(40.6956965462893, -112.010362744331)))
viaPoints.append(SKViaPoint(2002, withCoordinate: CLLocationCoordinate2DMake(40.6905431890973, -112.006948292255)))

let route = SKRouteSettings()
route.startCoordinate = annotations[0].location
route.destinationCoordinate = annotations[annotations.count-1].location
route.shouldBeRendered = renderRoute
route.routeMode = routeMode
route.maximumReturnedRoutes = UInt(maxRoutes)
route.requestAdvices = loadSteps

// Works fine if I comment out this line. Crashes with this line.
route.viaPoints = viaPoints.count > 0 ? viaPoints : nil

SKRoutingService.sharedInstance().calculateRoute(r oute)

Adela_Silvia
11.01.2016, 10:34
This is a known issue that unfortunately wasn't fixed for the CocoaPods integration. As we are working on the new build, this fix should be available in the next month.