Best Mapping API: Mapbox, Google Maps, or OpenStreetMap?
Discover the possibility of finding a budget-friendly alternative to Google Maps without compromising on functionality in this in-depth analysis.
Join the DZone community and get the full member experience.
Join For FreeGoogle Maps has long been the go-to maps and location data API provider – and it makes sense. Google's solutions are robust and reliable, with a wealth of mapping data available for over 200 countries. With 1 billion monthly active users (and over 5 million active sites and apps using it), you would think that Google Maps is uncontestable. However, ever since Google hiked its Maps API prices back in 2018, developers have been turning to more affordable options. Is it possible to find a budget-friendly alternative to Google Maps without compromising on functionality? Let's find out.
The Google Maps API Dilemma
Google Maps APIs have left a bitter taste in the mouths of many developers. A price hike is understandable – but raising prices this drastically was a controversial move. Before the 2018 pricing change, if a website or app exceeded 25,000 dynamic map views per day, they would need to pay $0.50 for every 1,000 additional requests. That price rose to $5 per 1,000 requests: an increase of 1,400%.
This was especially harmful to small and medium-sized projects, which saw their monthly Google Maps API costs rise by over $10,000 per month. A change of this size just couldn't fit into their budget anymore – so it makes sense that so many developers are seeking more affordable Google Maps alternatives.
That isn't to say that Google Maps is terrible; it's still one of the most powerful solutions out there – but it only does you any good if you can afford it.
Google Maps API Services
There are three categories that Google Maps APIs fall under: Maps, Routes, and Places.
- Maps: Static Street View, Dynamic Street View, Local Context Map, Static Maps, Dynamic Maps, Mobile Maps
- Routes: Directions, Distance Matrix, Route Traveled, Nearest Road, Speed Limits
- Places: Autocomplete Request, Places Details, Find Current Place, Places Photo, Geocoding, Geolocation, Time Zone, Elevation
Google Maps Console
Pros and Cons of Working With Google Maps API
Pros:
- Rich database of locations.
- Geocoding, street view, and routing are available.
- Decent visual customization.
- $200 credit per month.
Cons:
- Heavy to render (first time rendering freezes the app for a second).
- Drains battery and requires some workarounds to improve energy consumption.
- Markers and shapes are 100% static.
- Routing is expensive.
- Not open-source.
- Unpredictable changes to pricing.
Main Alternative Solutions – And Market Distribution
It's no surprise that Google Maps is the biggest player in the mapping industry. With its huge library of related APIs and comprehensive documentation, millions of third-party applications have decided to use Google's mapping tools, regardless of the expense. However, while Google Maps might be the biggest fish in the sea, there are other contenders.
According to research from Datanyze, the market makeup is as follows:
- Google Maps Platform (Google Maps API 86.25% market share, Google Places API 1.7% market share) - 87.95% market share, 2,580,916 domains
- Mapbox - 4.46% market share, 159,618 domains
- Google Places - 4.15% market share, 148,445 domains
- Leaflet – 3.71% market share, 132,883 domains
- Baidu Ibsuyn – 0.93%, 33,248 domains
- OpenStreetMap – 0.64%, 23,010 domains
Besides these, there are over 80 other companies producing Mapping and GIS technologies for the market. But today, we are going to look at two powerful alternatives to Google Maps: Mapbox and OpenStreetMap.
Mapbox API: Overview, Pros, and Cons
Services
The full list of Mapbox services can be seen here, but some of the most popular ones include:
- Matrix API: This API will always show you the length or duration of the matrix element's fastest route. An element is considered to be an origin-destination pair within the matrix. The API does not return route geometries, but it does return distances in meters and durations in seconds. The distances and durations between points might not be symmetric, as one-way streets and turn restrictions are factored in. In other words, the duration from Point A to Point B might not be the same as from B to A. Using the Matrix API, you can efficiently filter points by travel time, check the reachability of coordinates from one another, and run algorithms to solve optimization issues.
- Geocoding API: It does two things: forward and reverse geocoding. Forward geocoding transforms location text into geographic coordinates – for instance, input “2 Lincoln Memorial Circle NW” is converted into -77.050,38.899. And reverse geocoding does the opposite: changing coordinates into place names.
- React Native SDK: Mapbox's Maps SDK for React Native is a library that offers reusable JavaScript components to integrate Mapbox maps into Android and iOS apps. This is a community-maintained library, and getting components is much easier than for Google Maps. Pull and issue requests are opened in the project's GitHub repository.
- Directions: The Mapbox Directions API can produce turn-by-turn instructions for 4 different routing profiles: walking, driving, cycling, and driving with traffic. Optimal routes and turn-by-turn instructions are calculated using traffic- and incident-aware routing.
PROFILE | DESCRIPTION |
---|---|
mapbox/driving-traffic | This profile is for automotive routing, and it factors in both historic and current traffic conditions to avoid slowdowns. Routes for this profile can contain up to 3 coordinates |
mapbox/driving | This profile is also for automotive routing, and it shows the fastest route possible. High-speed roads are prioritized. Routes for this profile can contain up to 25 coordinates. |
mapbox/walking | This profile is for hiking and pedestrian routing. The shortest path possible is shown, and trails and sidewalks are used. Routes for this profile can contain up to 25 coordinates. |
mapbox/cycling | This profile is for bicycle routing. Short and safe routes are shown, with bike lines prioritized. Routes for this profile can contain up to 25 coordinates. |
Price Comparison: Google Maps vs Mapbox
In practically every area, Mapbox is significantly more affordable than Google Maps APIs.
MAPBOX | GOOGLE MAPS | |
---|---|---|
Static Maps | Free for first 50,000, then $0.60 - $1.00 per 1,000 requests | Free for mobile, $2 per 1,000 requests after $200 credit is used up |
Directions | Free for first 100,000, then $1.20 - $2 per 1,000 requests | $5 per 1,000 requests after $200 credit is used up |
Permanent Geocoding | Free for first 100,000, then $4 - $5 per 1,000 requests | $5/1,000 requests after $200 credit is used up |
Matrix | Free for first 100,000, then $1.20 - $2 per 1,000 elements | $5 per 1,000 elements after $200 credit is used up |
Pros
- Well-organized documentation.
- Customization of maps is easy.
- Visually pleasing base map.
- Easy to integrate on web and mobile apps.
Cons
- Steep learning curve.
- It's not a free service.
- Geared towards larger projects.
- The API is not highly customizable.
What Apps Use Them
- Snap Inc.
- Shopify.
- Facebook.
OpenStreetMap API: Overview, Cons, and Pros
Services
OpenStreetMaps (OSM) offers very rudimentary features. While Google Maps and Mapbox offer everything out of the box, you will have to get features from third-party services when working with OSM. Direction services, traffic information, 3D mode, etc., will all need to be integrated from third-party services. So, what features does OpenStreetMaps directly provide?
- Editing API: Used for fetching and saving raw geodata to & from the OSM database. This is the documentation entry page and is provided in order to edit map data. If a client affects the service level for other users or corrupt data, they can be blocked without notice.
- Overpass API: It provides read-only API access. This API acts as a database over the web, meaning that the client sends a query and gets back a corresponding data set from the API. Unlike the Editing API, Overpass API was made for data consumers that need to quickly grab a few elements instantaneously (or up to 10 million elements in several minutes). Elements can be selected by search criteria such as object type, locations, proximity, or tag properties.
While you can't do much out-of-the-box, there are dozens upon dozens of third-party services that work with OMS data.
- Geofabrik: Enables downloading of pre-selected regions (such as states of the US)
- ProtoMaps: A system for vector basemap cartography, with customizable languages, labels, and appearance
Price Comparison
If you are looking for the most affordable mapping API, it doesn't get any cheaper than OpenStreetMaps. It is completely open-source, meaning that it's free for you to use.
Pros
- No cost to use.
- You can edit map data as needed.
- It can be quickly updated.
Cons
- Lower coverage.
- No systematic quality check of data.
- Fewer features than Google Maps and Mapbox.
What Apps Use Them
- TripAdvisor.
- Pokemon Go.
- MapFactor Navigator.
Key Differences Between Mapbox, OpenStreetMap and Google Maps API
The main differences between OpenStreetMaps, Mapbox, and Google Maps can be summed up as follows:
- Operating expenses: OSM is clearly the least expensive, as it's free – but you need to consider the costs of building infrastructure to make up for its lack of features. With Google Maps and Mapbox, you'll need to compare costs on a case-by-case basis, but Mapbox typically has the edge.
- Feature value: OSM has a low feature value. Google Maps definitely wins the feature count, but you likely won't need to add on all the bells and whistles. Again, this is something assessed on a case-by-case basis; you'll need to determine which specific features your integrated map app needs.
- Customization: Mapbox has the best customization features, hands down. Google Maps is less flexible – for instance, it forces you to use its default base layer, while Mapbox does not.
- Ease of Integration: This really depends on the experience that your developers and designers have with the APIs and their SDKs. Many developers are more familiar with Google Maps due to its popularity.
Which Map API Service Is Right for You?
Running the risk of sounding cliché, there is no "right" solution – just one that works best for your business. So, when choosing which map API to use, ask yourself these four questions:
- Does the open-source model appeal to you? If so, OSM ticks this box.
- Where does your business operate? Google Maps will almost certainly cover your region, no matter where you're located. OpenStreetMaps, on the other hand? Data is added by the community, and some regions are sparser than others. North America and countries in Europe have the best coverage, and urban areas are almost completely mapped. More rural areas, though, might just have the most important roads mapped. Mapbox falls between the two: it might not have as much coverage as Google Maps, but it's close. What's more, they are pretty transparent about which features are available – for instance, you can see in which countries real-time and typical traffic data is calculated.
- What kinds of functionality do you need for your business? OpenStreetMaps does not have much standalone functionality, which pretty much knocks it out of the running – unless you are willing to build the infrastructure or work with third-party solutions that are based on OSM data. And at the end of the day, that could negate any costs that you had saved by choosing an alternative to Google Maps.
- How large is your user base now, and do you anticipate significant growth? If you don't anticipate getting loads of user queries, you might get a lot out of Google Maps API's $200 monthly credit. But once you pass that limit, financially, it makes sense to go with Mapbox, as pretty much every service is more affordable.
If you can afford Google Maps, appreciate its 99 percent coverage, and want to make use of its vast set of features, by all means, go full speed ahead! But by going with Mapbox, you'll get more customization, sufficient coverage, and a much more affordable price.
Published at DZone with permission of maksym Sergiiets. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments