Display Entities on the Map
In this guide we will
Send Sites
to the SDK and see them on the MapSend Orders
to the SDK and see them on the MapSend Predefined Routes
to the SDK and see them on the Map- customize the sites default display
Follow common setup steps
If not done already, follow common Introduction page.
Send sites
Prepare the list of sites
To send your list of sites to the SDK, you need to build a data
object containing it.
Here is an example of a minimalistic list of site
List of Sites
"sites": [
{
"id": "MOULINS",
"coordinates": {
"longitude": 3.327869,
"latitude": 46.559176
}
},
{
"id": "AXIOROUTE",
"coordinates": {
"longitude": -0.561642,
"latitude": 47.462544
}
},
{
"id": "CJM",
"coordinates": {
"longitude": -0.345602,
"latitude": 48.597481
}
},
{
"id": "COFISOFT",
"coordinates": {
"longitude": 1.697037,
"latitude": 46.816713
}
},
{
"id": "GPI",
"coordinates": {
"longitude": 4.740329,
"latitude": 45.752201
}
},
{
"id": "SINARI",
"coordinates": {
"longitude": -1.604869,
"latitude": 48.113197
},
"isDepot": true
},
{
"id": "XYRIC",
"coordinates": {
"longitude": 5.09304,
"latitude": 47.310967
}
}
]
Send the sites to the SDK
To send your list of sites to the SDK, you need to build an entities
message.
Sending Sites
{
"type": "SET_SDK_ENTITIES",
"payload": {
"sites": [
{
"id": "MOULINS",
"coordinates": {
"longitude": 3.327869,
"latitude": 46.559176
}
},
{
"id": "AXIOROUTE",
"coordinates": {
"longitude": -0.561642,
"latitude": 47.462544
}
},
{
"id": "CJM",
"coordinates": {
"longitude": -0.345602,
"latitude": 48.597481
}
},
{
"id": "COFISOFT",
"coordinates": {
"longitude": 1.697037,
"latitude": 46.816713
}
},
{
"id": "GPI",
"coordinates": {
"longitude": 4.740329,
"latitude": 45.752201
}
},
{
"id": "SINARI",
"coordinates": {
"longitude": -1.604869,
"latitude": 48.113197
},
"isDepot": true
},
{
"id": "XYRIC",
"coordinates": {
"longitude": 5.09304,
"latitude": 47.310967
}
}
],
},
"author": "<author id>",
"recipients": [
"<recipient id>"
],
"status": "SENT"
}
Note that all the parts (Sites, trucks, trailers, ...) must be present in the message even if there are no associated datas
See the sites on the Map
The sites are automatically transmitted by the SDK to any active MapViewer associated to your SDK user. The Mapviewers automatically display the sites they receive from the SDK.
Site rollover
Sites are one of the webview native entities with native interactions.
Upon rollover, a tooltip with site id as title is displayed.
Send orders
Prepare the list of orders
To send a list of orders to the SDK, you need to build a data
object containing:
Here is an example of a minimalistic list of orders with the matching sites
List of Orders
"operations": [
{
"id": "OPERATION_07",
"type": "DELIVERY",
"idSiteDestination": "MOULINS"
},
{
"id": "OPERATION_01",
"type": "DELIVERY",
"idSiteDestination": "AXIOROUTE"
},
{
"id": "OPERATION_02",
"type": "DELIVERY",
"idSiteDestination": "COFISOFT"
},
{
"id": "OPERATION_03",
"type": "DELIVERY",
"idSiteDestination": "CJM"
},
{
"id": "OPERATION_04",
"type": "DELIVERY",
"idSiteDestination": "GPI"
},
{
"id": "OPERATION_05",
"type": "DELIVERY",
"idSiteDestination": "XYRIC"
}
]
Send orders to the SDK
To send a list of orders to the SDK, you need to build an entities
message.
The message must include both the order lists and the matching sites list
Sending Orders with matching Sites
{
"type": "SET_SDK_ENTITIES",
"payload": {
"sites": [
{
"id": "MOULINS",
"coordinates": {
"longitude": 3.327869,
"latitude": 46.559176
}
},
{
"id": "AXIOROUTE",
"coordinates": {
"longitude": -0.561642,
"latitude": 47.462544
}
},
{
"id": "CJM",
"coordinates": {
"longitude": -0.345602,
"latitude": 48.597481
}
},
{
"id": "COFISOFT",
"coordinates": {
"longitude": 1.697037,
"latitude": 46.816713
}
},
{
"id": "GPI",
"coordinates": {
"longitude": 4.740329,
"latitude": 45.752201
}
},
{
"id": "SINARI",
"coordinates": {
"longitude": -1.604869,
"latitude": 48.113197
},
"isDepot": true
},
{
"id": "XYRIC",
"coordinates": {
"longitude": 5.09304,
"latitude": 47.310967
}
}
],
"operations": [
{
"id": "OPERATION_07",
"type": "DELIVERY",
"idSiteDestination": "MOULINS"
},
{
"id": "OPERATION_01",
"type": "DELIVERY",
"idSiteDestination": "AXIOROUTE"
},
{
"id": "OPERATION_02",
"type": "DELIVERY",
"idSiteDestination": "COFISOFT"
},
{
"id": "OPERATION_03",
"type": "DELIVERY",
"idSiteDestination": "CJM"
},
{
"id": "OPERATION_04",
"type": "DELIVERY",
"idSiteDestination": "GPI"
},
{
"id": "OPERATION_05",
"type": "DELIVERY",
"idSiteDestination": "XYRIC"
}
],
},
"author": "<author id>",
"recipients": [
"<recipient id>"
],
"status": "SENT"
}
See the orders on the Map
The orders are automatically transmitted by the SDK to any active MapViewer associated to your SDK user. The Mapviewers automatically display the orders and sites they receive from the SDK.
Note that Sites and Orders have distinct representations on the map.
Site SINARI is not linked to any order, thus it is represented as a site.
The other sites are all associated to at least one delivery order, thus they are represented as deliveries.
Send predefined routes
Prepare the list of routes
To send a list of predefined routes to the SDK, you need to build a data
object containing:
- The list of
orders
- The matching list of
sites
- The list of
trucks
associated with the routes - The description of
routes
Here is an example of a simple predefined route
Predefined Route
"referencePlanning": {
"vehicleRoutes": [
{
"truck": "VEHICLE_01",
"period": "PERIOD_01",
"routes": [
{
"id": "000ZYX1DH01",
"activities": [
{
"activity": "ROUTE_START",
"site": "SINARI",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "LOADING",
"site": "SINARI",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_03",
"type": "LOADING"
},
{
"id": "OPERATION_05",
"type": "LOADING"
},
{
"id": "OPERATION_04",
"type": "LOADING"
},
{
"id": "OPERATION_02",
"type": "LOADING"
},
{
"id": "OPERATION_01",
"type": "LOADING"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "CJM",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_03",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "XYRIC",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_05",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "GPI",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_04",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "COFISOFT",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_02",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "AXIOROUTE",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_01",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "ROUTE_END",
"site": "SINARI",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"distance": 0,
"nominalDuration": 0,
"notWorked": false
}
],
"status": "FREE"
}
]
}
]
}
Send predefined routes to the SDK
To send the list of predefined routes to the SDK, you need to build an entities
message.
The message must include the orders list,the matching sites list, the routes list and the matching Trucks list.
Sending Predefined Routes
{
"type": "SET_SDK_ENTITIES",
"payload": {
"sites": [
{
"id": "MOULINS",
"coordinates": {
"longitude": 3.327869,
"latitude": 46.559176
},
"isDepot": false
},
{
"id": "AXIOROUTE",
"coordinates": {
"longitude": -0.561642,
"latitude": 47.462544
},
"isDepot": false
},
{
"id": "CJM",
"coordinates": {
"longitude": -0.345602,
"latitude": 48.597481
},
"isDepot": false
},
{
"id": "COFISOFT",
"coordinates": {
"longitude": 1.697037,
"latitude": 46.816713
},
"isDepot": false
},
{
"id": "GPI",
"coordinates": {
"longitude": 4.740329,
"latitude": 45.752201
},
"isDepot": false
},
{
"id": "SINARI",
"coordinates": {
"longitude": -1.604869,
"latitude": 48.113197
},
"isDepot": true
},
{
"id": "XYRIC",
"coordinates": {
"longitude": 5.09304,
"latitude": 47.310967
},
"isDepot": false
}
],
"trucks": [
{
"id": "VEHICLE_01",
"availablePeriods": [
{
"id": "PERIOD_01",
"timeWindow": {
"start": "2022-11-01T04:30:00.000+01:00",
"end": "2022-11-02T12:00:00.000+01:00"
},
"departureSite": "SINARI",
"arrivalSite": "SINARI"
}
],
"entityType": "TRUCK"
}
],
"operations": [
{
"id": "OPERATION_07",
"type": "DELIVERY",
"idSiteDestination": "MOULINS",
"splittable": false,
"fixedProduct": true,
"entityType": "OPERATION",
"isAffected": false,
"isRejected": false
},
{
"id": "OPERATION_01",
"type": "DELIVERY",
"idSiteDestination": "AXIOROUTE",
"splittable": false,
"fixedProduct": true,
"entityType": "OPERATION",
"isAffected": false,
"isRejected": false
},
{
"id": "OPERATION_02",
"type": "DELIVERY",
"idSiteDestination": "COFISOFT",
"splittable": false,
"fixedProduct": true,
"entityType": "OPERATION",
"isAffected": false,
"isRejected": false
},
{
"id": "OPERATION_03",
"type": "DELIVERY",
"idSiteDestination": "CJM",
"splittable": false,
"fixedProduct": true,
"entityType": "OPERATION",
"isAffected": false,
"isRejected": false
},
{
"id": "OPERATION_04",
"type": "DELIVERY",
"idSiteDestination": "GPI",
"splittable": false,
"fixedProduct": true,
"entityType": "OPERATION",
"isAffected": false,
"isRejected": false
},
{
"id": "OPERATION_05",
"type": "DELIVERY",
"idSiteDestination": "XYRIC",
"splittable": false,
"fixedProduct": true,
"entityType": "OPERATION",
"isAffected": false,
"isRejected": false
}
],
"referencePlanning": {
"vehicleRoutes": [
{
"truck": "VEHICLE_01",
"period": "PERIOD_01",
"routes": [
{
"id": "000ZYX1DH01",
"activities": [
{
"activity": "ROUTE_START",
"site": "SINARI",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "LOADING",
"site": "SINARI",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_03",
"type": "LOADING"
},
{
"id": "OPERATION_05",
"type": "LOADING"
},
{
"id": "OPERATION_04",
"type": "LOADING"
},
{
"id": "OPERATION_02",
"type": "LOADING"
},
{
"id": "OPERATION_01",
"type": "LOADING"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "CJM",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_03",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "XYRIC",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_05",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "GPI",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_04",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "COFISOFT",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_02",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "DELIVERY",
"site": "AXIOROUTE",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"operations": [
{
"id": "OPERATION_01",
"type": "DELIVERY"
}
],
"distance": 0,
"nominalDuration": 0,
"notWorked": false
},
{
"activity": "ROUTE_END",
"site": "SINARI",
"fixedTimeSite": 0,
"volume": 0,
"weight": 0,
"distance": 0,
"nominalDuration": 0,
"notWorked": false
}
],
"status": "FREE"
}
]
}
]
}
},
"author": "<author id>",
"recipients": [
"<recipient id>"
],
"status": "SENT"
}
See the routes on the Map
The routes and all the associated datas are automatically transmitted by the SDK to any active MapViewer associated to your SDK user. The Mapviewers automatically display the routes, sites and orders they receive from the SDK.