Is Leaflet a better tool than Google Maps?

Joe Maddalone pits Google’s multimillion dollar-backed mapping service against its rather smaller, open source rival.

If you need to embed a map into your project, you could be forgiven for thinking Google Maps is your only choice. It's used by over 2 million sites and it's a proven technology, having been launched in 2005.

There's however an alternative – Leaflet. It's is an open source JavaScript library that provides mapping capabilities. It was developed by Vladimir Agafonkin, it launched in 2010 and is used by over 20,000 sites.

We pit the two technologies against each other and tell you which is right for your project.

Overview

Leaflet - Additional features can be added in by utilising plugins. Leaflet is usually used in conjunction with OpenStreetMaps, but can utilise other map data services, including Google Maps.

Google Maps - Google Maps requires very little knowledge to implement even some of its most complex features. However, end users have very little control over how the map data is presented.

The regular person case

Leaflet - Adding a map to a simple website is definitely a lot trickier for the average person using Leaflet. Many features will prove too much effort for those looking for a plug-and-play solution.

Google Maps - There is simply no easier way to add a fully featured map to a website, with directions, street view, distance data and more. There are some limitations in resolution and requests per day.

The developer case

Leaflet - The level of control over Leaflet is unparalleled, with an ever-growing collection of plugins and constantly updated, developer-driven API. The ability to design every aspect of your map implementation without fear of licensing or unexpected data changes makes Leaflet the clear development choice.

Google Maps - Developing a consumer-facing application based on Google Maps would require a huge leap of faith that Google won’t taint the experience with its own agenda. A dependency on Google’s backing service may present itself one day as unwanted ads, reviews, +1s and other distracting data.

Ever onwards

Leaflet - Leaflet’s development velocity is only matched by the pace of the open source projects it is partnered with and the number of third-party projects being built around the simple mapping library.

Google Maps - Street View and the acquisition of Skybox’s real-time micro-satellite service imply a clear path to a staggering amount of data unlikely to be seen in any open source counterpart.

Verdict

Need directions? Use Google Maps. Need to develop an application? Use Leaflet. The mere need to compare an application backed by billions of dollars to one where 90 per cent of the code is still contributed by a single developer from Kiev exposes the new ecosystem of web applications we have entered into recently.

Removed from the OS and low-level languages like C/C++, open source applications like Leaflet are the proverbial ‘barbarians’ once at the gate of the commercial incumbents, now building superior castles right next door.

Words: Joe Maddalone

Joe Maddalone is a JavaScript developer and an instructor at egghead.io. Follow him on Twitter at @joemaddalone.

Like this? Read these!

Have you found any great mapping tools or tips? Let us know in the Comments!