Leaflet – Potentially Better Alternative to Google Maps

Leaflet – Potentially Better Alternative to Google Maps

How to create an individual and customized online map?

Kepler's world map in Tabulae Rudolphinae (1627)

The Leaflet library is an open-source JavaScript library that includes all the features that most developers need to create online maps. This is a nice alternative to Google Maps, because it can be customizationed, utilizes different map layers, has customizable icons and pop-ups, as well as several other features that will be highlighted in this article.

Leaflet has several features that allow the developer to customize a map for specific purposes. Some of these features include the ability to create map layers, markers, pop-ups, custom icons, geo-location, GeoJSON layers, zoom with animation, tile and pop-up animation with fade effects, and much more.

These features include an easy-to-use customization property, which allows the developer to control with CSS3, a simple interface that allows for the implementation of custom map layers, as well as object-oriented programing facilities which, in turn, allow for the extention of any existing class.

Custom map projections can also be created with EPSG:4326, EPSG:3857, and EPSG:3395 right out of the box—this will also be explained later in this document.

GeoJSON, as the name indicates, is a format for encoding geographic data structures using the JavaScript object-orientation notation (JSON), which is used to represent simple data structures and associative arrays as objects. A GeoJSON object can be described as a geometric figure which can be represented by figures such as a point, line, or polygon, etc. A data structure in GeoJSON is always a JSON object.

An EPSG (European Petroleum Survey Group) code is nothing more than a dataset to request the image of a map, or, in other words, a way to create a connection between a GPS coordinate and a world map using a consistent scale. These projections are followed by a code that allows instant representation of a certain zone of the world map.

Some of these freely available codes can be found at http://spatialreference.org/ref/epsg/.

Leaflet API [application programming interface]

Leaflet has a powerful API that allows the developer to interact with the created customizable map. There is also a list of useful plugins created by the Leaflet users’ community. Leaflet users who need more documentation can go to the Leaflet website http://leafletjs.com. A nice set of tutorials that will get you started in creating your own map can be found there.

Another important feature is Leaflet's portability, which includes portable devices and all of the most common browsers. It is lightweight, and the fact that it has no external dependencies is a big advantage, too.

We can conclude that for coders who are bored by the ever-conformist Google Maps application, Leaflet is an easy-to-use JavaScript library. It allows the creation of customizable maps in an open-source mode, with your own layers, pop-ups, icons, and many more features that you can find on the Leaflet website. It is the customization that makes Leaflet a very good alternative to other map interfaces to your web browser.

Go back