Skip to content

How i add array in dynamic manner NMAWAYPOINT and NMAGeoCoordinates *start/end.  #222

Description

@vishalparmar22091989

// 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]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions