Editor’s note: This is a cross-post from Mapbox‘s Peter Liu. It’s a sneak peek of a larger collaboration between Mapbox, the building block for maps, and Layer, the building block for communications. More to come!

Technology is reinventing on-demand services to include everything from shipping to laundry, and the central innovation is realtime logistics. Delivery-on-demand services like Postmates or Shyp work at the intersection of location, time, and economics. Assigning the right jobs to the right people – within seconds – is the challenge.

The dispatcher of the future is a stack built with Layer for communications and Mapbox for geo. Customers request a delivery at an address, which Mapbox’s geocoding API transforms into a latitude, longitude point. Turf.js assigns the nearest and oldest outstanding order to each available courier, sending them an instant push notification with Layer. When the courier accepts a task, Smart Directions generates a route specifically for their mode of transportation.

This is a full-featured logistical system in the browser (check out a preview).

  • Layer: realtime messaging layer that connects couriers to assignments.
  • Geocoding: converts addresses into geographical locations.
  • Turf: geospatial analysis fast enough to provide understanding of spatial relationships on the fly, as the foundation for more complex scheduling algorithms.
  • Smart Directions: instant routing from couriers to drop points.

Layer connects people with push notifications, text messages, and alerts – getting customers, couriers, and dispatchers on the same page, in realtime. Mapbox’s geographic technology provides analysis, visualization, and data. Mapbox and Layer are building modular components and APIs for developers, and it’s exciting to see that they can be assembled into real-world applications.

1 – Customer places order

Customer shares their location with the courier.

2 – Courier receives notice of new order

The customer’s location is visible on courier’s device.

3 – Courier plans route and begins trip

Given their two locations, courier is guided to the customer’s location.

4 – Customer is updated of courier’s progress

Trip updates can be sent automatically, so couriers can focus on getting to the destination.

5 – Customer is notified that their order has arrived

With Mapbox and Layer, we can build a great customer experience for any application. Real-time push notifications let customers and couriers stay on the same page without having to actually jump on a call.