By: Alex Parlato and Kajari Ghosh
We’re launching two improvements for developers building navigation-related projects: brand new map styles optimized for navigation and the ability to display congestion along your upcoming route. These make navigating more intuitive, helping drivers quickly interpret critical map information and then return to focusing on the road.
New map styles
Our new navigation-specific map styles come in two types, Preview and Guidance. The Preview styles are designed for reviewing a route before you get moving, while the Guidance styles are for use while actually navigating. We have day and night versions for each:
Preview Maps:
Guidance Maps:
The data we’ve curated for each style is carefully displayed both in terms of hierarchy and color choice. For example in the Preview styles, traffic and parking are emphasized on all streets so users can plan ahead. In Guidance, we’ve enlarged highway shields and road labels, as well as reduced less-critical points of interest. This places more emphasis on the route-at-hand and helps to eliminate distractions.
These new maps styles also save on design time for anyone who just needs a quick navigation map to get started. And like all of our styles, you have access to the data in every layer for complete customization.
Display Route Line Congestion
We process over 225 million miles of sensor data per day to provide highly accurate traffic patterns, and we’re always finding new and interesting things to do with it. For example, you can now receive traffic congestion annotations for each section of your route and use these to not just style your map but perform calculations in your application. For drivers this means a better visualization of where they’re going and what to expect.
Get started with our nav maps
Create an account in Mapbox Studio to start exploring and customizing our new navigation map styles. If you want to build with our Navigation SDK for Android and iOS, Guidance (Day) is the default style. You can can manually set mapbox://styles/mapbox/navigation-guidance-night-v2 if you need the night style instead. Automatic time-of-day based style switching is coming this fall!
Build-in route line congestion styling
You can access congestion annotations through the web API, and it comes out-of-the-box in the Navigation SDK for both iOS and Android.
For the Web API, create a directions request formatted as follows. Find your access token from the Mapbox Studio Account Page and see the API documentation.
https://api.mapbox.com/directions/v5/mapbox/driving-traffic/-73.989%2C40.733%3B-74%2C40.733.json?overview=full&annotations=congestion&access_token=<your-mapbox-access-token>
A response with congestion annotations looks like:
Our recently updated help documentation for the Directions API and our more comprehensive technical documentation are also great resources for getting started. Tweet @mapbox with any questions, and share what you’re building with #BuiltWithMapbox.
Better maps for navigation was originally published in Points of interest on Medium, where people are continuing the conversation by highlighting and responding to this story.