here-ios-sdk-examples
here-ios-sdk-examples copied to clipboard
How i add array in dynamic manner NMAWAYPOINT and NMAGeoCoordinates *start/end.
// setup waypoints NMAGeoCoordinates *start = [[NMAGeoCoordinates alloc] initWithLatitude:49.839882 longitude:24.029239]; NMAGeoCoordinates *end = [[NMAGeoCoordinates alloc] initWithLatitude:49.849897 longitude:24.022307]; NMAWaypoint *startWaypoint = [[NMAWaypoint alloc] initWithGeoCoordinates:start]; NMAWaypoint *endWaypoint = [[NMAWaypoint alloc] initWithGeoCoordinates:end];
// setup mode NMARoutingMode *mode = [[NMARoutingMode alloc] initWithRoutingType:NMARoutingTypeFastest transportMode:NMATransportModeCar routingOptions:0]; // calculate a route _router = [[NMACoreRouter alloc] init]; [_router calculateRouteWithStops:@[startWaypoint, endWaypoint] routingMode:mode completionBlock:^(NMARouteResult *result, NMARoutingError error) { if (error == NMARoutingErrorNone && result.routes.count > 0) { // distance in meters NSUInteger distance = [result.routes firstObject].length; } }];
Hello sir I want to pass a single array with a waypoint and NMAGeoCoordinates in following. let me know if ypu have any idea. i don't have any limit for waypoint so I can not put it static.
[_router calculateRouteWithStops:@[startWaypoint, endWaypoint]
@dashchak try to the possible answer as ASAP. Thanks in Advance
@LeOric32 Please take a look
@dashchak @LeOric32 Any update ?
@vishalparmar22091989 Hi! Can you provide more info? Do you want to add waypoints in stops array and change your route dynamically?
@LeOric32 I want to add the following things
- one origin and one destination
- And multiple waypoints
So one array-like
[startpoint, multiple waypoints, destinationpoint]
i want to make dynamically all things How i make this array?
@LeOric32 Any suggestion for that
@LeOric32 @dashchak Any update?
@dashchak @LeOric32 Any Update ?
@dashchak @LeOric32 Any solutions?