Guide to Google Maps API - and 6 great alternatives
Wm Leler expands your mapping horizons by explaining Google Maps API's benefits - and some alternatives that could be even better.
Here are six great alternatives to Google Maps API.
01. Microsoft Bing
Microsoft has positioned Bing maps as an alternative to Google maps, especially for providing local information. A unique feature of Bing maps is their 'bird's eye' view, which gives aerial views from several perspective angles.
Free accounts for Bing maps limit you to 125K sessions or 500K transactions per year. Free accounts do not include 'bird's eye' or 'streetside' (streetview) maps. They also have educational and not-for-profit accounts, which do include free access to Streetside maps.
02. MapQuest
MapQuest was one of the first providers for maps on the web, and today it's encouraging the transition to open maps. MapQuest is the only company that lets you choose between using licensed maps or open maps. Even using licensed map data, it has free accounts with no limits on map views. However, it does limit you to 5K calls per day for routing (including for multiple destinations), geocoding, and search.
The open map option – which uses OpenStreetMap and free satellite and aerial data – has no limits at all, but does not provide routing or traffic services. Unlike most non-open-source APIs, the open map option can be used for paid (non-public or password-protected) applications.
MapQuest also has servers for map tiles, which it lets you use with other APIs for free, even for heavy use. Using MapQuest's tile servers with open source APIs such as OpenLayers or Leaflet is a popular option.
03. OpenLayers
The OpenLayers API is a project of the Open Source Geospatial Foundation, and is often used with OpenStreetMap maps and data. It is a very flexible and powerful API designed to be used in advanced mapping applications, but it is somewhat complicated and large. It is a mature API with lots of features, but it can be difficult to use in mobile applications since it was designed before they became popular.
Get the Creative Bloq Newsletter
Daily design news, reviews, how-tos and more, as picked by the editors.
04. Leaflet
Leaflet is the newest mapping API, but has gained popularity quickly. Many of the companies switching away from Google Maps use the Leaflet API, including Flightstats (the company I work for) and Foursquare. It was designed to work well with both desktop and mobile applications and is small and fast. Being newer, it is not as powerful as some of the other APIs, but what it lacks in features it makes up for in flexibility. It has a powerful object model that makes it easy to add features or customise existing features to your needs.
Leaflet specifies access to tile servers using templates, which means Leaflet can be used with almost any online map including proprietary tile servers. If you can figure out the URL for a tile server, you can probably use Leaflet to display its maps. For example, here is the template to access Google's map tile servers from Leaflet:
var tiles = new L.TileLayer(
'http://mt{s}.google.com/vt/v=w2.106&x={x}&y={y}&z={z}&s=',
{ subdomains:'0123', attribution:'© Google 2012' }
);
Note that it is unclear whether this violates Google's terms of service or copyright, and its servers can easily block your application if they want. Luckily, there are hundreds of non-proprietary map servers that you can access. Indeed, CloudMade, the company that created Leaflet and open sourced it, makes money by charging for their map servers.
05. Modest Maps
As its name implies, Modest Maps was designed to provide the minimal features to include maps inside applications. It originally used Adobe's Flash, but was later ported to JavaScript. There are a half dozen other ports, including for Python, PHP, Processing, and OpenFrameworks, which facilitate using Modest Maps in desktop (non-browser-based) applications, native mobile applications, and on servers.
06. Polymaps
Unlike other map APIs, Polymaps uses SVG to display geographic information, rendering this data directly on the browser. Other APIs use image tiles to render maps, but they still need to display geographic information (such as markers and routes) by rendering it directly. Map data can be loaded using standard formats such as GeoJSON and rendered directly.
The use of SVG enables you to use CSS rules for styling map features like roads and boundaries, including changing styles on the fly. It also allows the use of SVG transitions and animations on maps.
Polymaps makes it easy to visualise large datasets of geographic information (for example, population density, crime statistics or voting patterns). Level of detail is controlled by tiling the raw geographic data, rather than tiling rendered images, so it can be changed dynamically.
Polymaps also doesn't limit map display to fixed zoom levels, as with maps based on tiled images. And because SVG is resolution independent, it works well on devices with higher pixel count displays, such as Apple's Retina displays.
The main disadvantage of the use of SVG is that it is not fully supported on all mobile browsers; and even if supported, it uses a lot of processing power. It is also not supported at all on Internet Explorer prior to IE9 (IE8 and before used VML instead of SVG).
The future
When Google Maps was free it supressed the development of alternatives, but now the number of both proprietary and open mapping APIs has exploded. This competition is good news for developers of applications that involve maps. Different APIs have unique features and capabilities, enabling you to pick the API that best suits your needs.
Advances in mapping APIs are also being driven by the increasing capabilities and power of mobile devices including smartphones and tablets, where there is high demand for applications based on maps.
Mapping seems to be moving toward open solutions. Even proprietary mapping products from Google and Nokia encourage crowdsourcing, enabling users to add or edit their proprietary maps. It is impossible for even large companies to keep up with all the changes to maps around the world as roads are added or changed. But although this data is supplied by users (including governments and NGOs), once added to a proprietary map it becomes proprietary (even the user or organisation who added the data has to pay to use it). It makes more sense to keep this data open, using something like OpenStreetMap.
In the slightly more distant future, all-in-one APIs like Google's will likely be split up into separate APIs, so for example a developer can use an open API such as Leaflet to draw the map and an open map based on OpenStreetMap data, while still using (and paying for) proprietary APIs for advanced features such as traffic or routing.
In addition to APIs, there are companies that help you create and host your own maps (such as MapBox and CloudMade) so that the style of your maps can match the style of your applications. There are also new APIs and platforms emerging for developing location-based applications (GeoLoqi, for example). And marketplaces will emerge for sharing, buying, and selling geographic data (such as WeoGeo).
One thing is clear though – map APIs are going places quickly.
Words: Wm Leler
Wm Leler is a principal engineer at Flightstats, Inc, who draw lots of airplanes on maps. He has published two computer books, and started several computer companies. This article was first published in .net magazine.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1
The Creative Bloq team is made up of a group of design fans, and has changed and evolved since Creative Bloq began back in 2012. The current website team consists of eight full-time members of staff: Editor Georgia Coggan, Deputy Editor Rosie Hilder, Ecommerce Editor Beren Neale, Senior News Editor Daniel Piper, Editor, Digital Art and 3D Ian Dean, Tech Reviews Editor Erlingur Einarsson and Ecommerce Writer Beth Nicholls and Staff Writer Natalie Fear, as well as a roster of freelancers from around the world. The 3D World and ImagineFX magazine teams also pitch in, ensuring that content from 3D World and ImagineFX is represented on Creative Bloq.