Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CREATING ROUTE VISUALIZATION REQUEST

Navmii SDK contains NMRouteVisualizerRequestBuilder class the NMRouteVisualizerRequest class which should be used to create immutable NMRouteVisualizerRequest instances configured requests configured to render the required data on map.

If you call the build method immediately after creating a builder instance, the returned request which is in this case configured to do nothing with route visualizer state, which means such request, if performed, will not affect the route visualizer state. If route visualizer was previously configured, for example, to render a route, nothing will change after such no-op request is executed.

As you can see from the interface of NMRouteVisualizerRequestBuilderNMRouteVisualizerRequest class, it allows to construct a request which performs multiple operations (i.e. to set an active route, to set one or multiple alternative routes and to set way-point markers) within the single request. This is the preferred way to handle the visualizer state in terms of performance as each route visualizer request, once executed, requires map tiles to be re-created.

Tip

If possible, try to create a single request configured to perform all the required actions rather than creating a new request for each action. The less often the performRequest: method of NMRouteVisualizer is called, the better.

VISUALIZING ROUTES

NMRouteVisualizerRequestBuilder class has the setRoutePolylineFromRouteThe NMRouteVisualizerRequest class contains the requestDisplayingPolylineOfRoute: method which allows to render to create an NMRouteVisualizerRequest instance configured so that the new request, in addition to the previously configured actions, will display the active route polyline on map. The route parameter is an instance of NMRoute class which is used to get a polyline to render. Active The active route polyline is rendered with the route color . Traffic (magenta by default). You can change it using the routeLineColor property of NMMapView. Traffic is displayed on the route polyline if the route contains it.The

setRoutePolylineAndWaypointMarkersFromRouteThe requestDisplayingPolylineAndWaypointsOfRoute: method allows to render the to create an NMRouteVisualizerRequest instance configured so that the new request, in addition to the previously configured actions, will display the active route polyline along with its waypoints on map. The route parameter is an instance of NMRoute class which is used to get a polyline and a route plan from. Special The special start point marker (the blue flag) is used for route origin, special finish point marker (black-and-white flag) is used for route destination, intermediate waypoints are rendered with yellow flag.The

setAlternativeRoutePolylinesFromRoutesThe requestDisplayingPolylinesOfAlternativeRoutes: method allows to render alternative create an NMRouteVisualizerRequest instance configured so that the new request, in addition to the previously configured actions, will display alternative route polylines on map. The routes parameter is an array of alternative routes. Each route is an instance of NMRoute class which is used to get a polyline to render. Alternative routes are rendered with grey color and traffic is displayed on each polyline if the route contains it.

The clearRoutePolyline and clearAlternativeRoutePolylines methods allow to The requestRemovingRoutePolyline and requestRemovingAlternativeRoutePolylines methods allow to create an NMRouteVisualizerRequest instance configured so that the new request, in addition to the previously configured actions, will remove the active and the alternative route polylines respectively.

VISUALIZING WAYPOINT MARKERS

NMRouteVisualizerRequestBuilder has the setWaypointMarkersAtCoordinatesThe NMRouteVisualizerRequest contains the requestDisplayingWaypointMarkersAtCoordinates:consideringFirstOneAsStart: method which allows to render waypoint markers on map. The coordinates parameter specifies an array of waypoint marker coordinates. Each coordinate is an instance of NMMapCoordinates class. The special finish marker (black-and-white flag) is used for the last waypoint. The special start marker (blue flag) is used for the first waypoint if YES is specified for the consideringFirstOneAsStart parameter, otherwise the regular waypoint marker (yellow flag) is used. The regular marker is also used for all other waypoints.The clearWaypointMarkers method allows to clear waypoint markers on

The requestRemovingWaypointMarkers method allows to create an NMRouteVisualizerRequest instance configured so that the new request, in addition to the previously configured actions, will remove all the waypoint markers from map.

ROUTE VISUALIZER BINDING

...