ios - SKMaps and ViaPoints/WayPoints -
i have questions regarding skmap sdk functionality.
after creating route , starting navigation process, there anyway of capturing waypoint
/viapoint
directed towards? after calculating route, seems routeinformation.viapointsonroute
empty. calculateroute(route)
automatically generate list of viapoints
? in sknavigationdelegate
protocol reference see following event functions :
– routingservice:didenterviapointarea: – routingservice:didreachviapointwithindex: – routingservice:didexitviapointarea:
however, these methods never seem called. not sure if called if viapoints
programmatically added.
also when routeservice fires currentadvice , nextadvice methods, skrouteavice location appear empty well.
is there anyway provide me simple example of how create , capture current waypoint
position , next waypoint
position while in navigation? essentially, trying calculate direction current location next waypoint
.
below rough example of route , navigation initiation code:
//created route let route: skroutesettings = skroutesettings() route.routemode = skroutemode.pedestrian route.startcoordinate = coordinatecurrent! route.destinationcoordinate = coordinatedestination! route.shouldberendered = true skroutingservice.sharedinstance().calculateroute(r oute) //start navigation let navsettings: sknavigationsettings = sknavigationsettings() navsettings.navigationtype = sknavigationtype.simulation navsettings.distanceformat = skdistanceformat.milesfeet navsettings.viapointnotificationdistance=1 self.mapview!.settings.displaymode = skmapdisplaymode.mode3d navsettings.transportmode = sktransportmode.pedestrian skroutingservice.sharedinstance().startnavigationw ithsettings(navsettings) //start postioner service skpositionerservice.sharedinstance().delegate = self skpositionerservice.sharedinstance().startlocation update() routeinfo.viapointsonroute func routingservice(routingservice: skroutingservice!, didchangenextadvice nextadvice: skrouteadvice, islastadvice:bool) { log(string(nextadvice.location)) } func routingservice(routingservice: skroutingservice!, didchangecurrentadvice currentadvice: skrouteadvice, islastadvice:bool) { log(string(currentadvice.location)) } func routingservice(routingservice: skroutingservice!, didupdateviapointsinformation viapoints: [anyobject]!) { log("via info: " + string(viapoints)) } func routingservice(routingservice: skroutingservice!, didenterviapointarea index: int32) { log("enter via: " + string(index)) } func routingservice(routingservice: skroutingservice!, didexitviapointarea index: int32) { log("exit via: " + string(index)) }
thank time!
i think first have clarify terminology.
viapoint or waypoint (the skobbler/telenav sdk uses viapoint terminology) point on route explicitly declared "viapoint". these points added @ route calculation time (by passing array of viapoints in route settings) or during navigation addviapoint api.
these viapoints monitored sdk , you'll receive didenterviapointarea, didreachviapointwithindex , didexitviapointarea callbacks.
i believe you're using term waypoint describing "junction" or "point requiring advice" along route - these correspond "route coordinates" provided sdk (see routecoordinationsforroutewithid api). these route coordinates not explicitly surfaced sdk - don't explicit information these points indirect notifications in form of advices ("in 200 meters turn right onto main street").
what turn turn engine provides "direction" between 2 such coordinates (in form of advice: "carry straight on", "turn right", "turn left"). see documentation regarding how advices created more details (here , here)
maybe skobbler/telenav team can provide better advice if describe end goal (what use case trying achieve).
Comments
Post a Comment