In Console, when you make a run with a Nextmv Routing app based on nextroute (either the Marketplace app or a custom app), the run result will have a routing-based visualization for the input and output.
The routing visualization is activated based on the input and output schema. For custom apps, if you would like to have the same visualization as nextroute apps, the following minimum schema must be adhered to.
Input
The minimum required schema to enable the routing visualization for input is to specify the lat
and lon
of a stop’s location in a location
block along with a unique id
field, and then place these stop objects in a top-level stops
array:
This will enable the locations on the map:
Vehicles can be visualized on the map as well if they are given either a start or end location (or both).
If the start_location
and the end_location
defined for the vehicle are the same then a special “depot” icon will appear.
The start and end locations for the vehicles can also be added as defaults. See the full input schema reference for more.
Output
To activate the routing-based visualization for the run result, your output JSON file must have a top-level solutions
array that contains an object with two properties: unplanned
and vehicles
.
The unplanned
array holds stops that were not assigned to vehicles. Each unplanned stop in the unplanned
array must have at a minimum a location
object and id
:
The vehicles
array holds an array of vehicle
objects which must have the following minimum schema:
Where each object in the route
array represents a vehicle stop along the route, the order of objects in the array following the sequential order of stops in the vehicle’s route.
So a minimum schema of the following (note that the stop’s quantity
and vehicle’s capacity
are only present to force an unplanned stop):
Produces this visualization:
Duration and distance display
In addition to the location, there are 5 other properties that can be defined on the vehicle
object that are picked up by the visualization and listed in the vehicle’s tooltip content:
Likewise, additional travel and distance properties can be defined for each stop in the vehicle’s route
array and if present will be displayed in the stop’s tooltip content:
Other values can be added, but the attributes defined above are the only items that will be shown as part of the routing visualization. However, note that the full contents of the run output is always available in the Output tab of the Result view.
See the full ouput schema reference for more detailed definitions of these additional properties and the rest of the nextroute output schema.