Intro

To draw a map, we need at least 2 things:

  1. SDK (Software Development Kit) for rendering a map, which will display data on the screen and pass control when the user moves the map/clicks on the map;

  2. Basemap - data and styles for rendering basic geographic data (land, water, countries, roads, etc.);

I. Mapbox, and Google Maps - the giants in the field of visualization of data on the map that provide very sophisticated API for displaying data, navigation, searching on the map, and processing user actions. They have their own data for the basemap. Sophisticated new features, great support, and stability.

On the other hand, these services are not free. They have free quotas. If there are many users in the system, you will have to accurately calculate the costs of working with different APIs.

The second drawback is not so significant - the difficulty of setting up the library "for yourself". These libraries are not supposed to be extended by code, all display customization is done through the API, which is wide, but not limitless. However, in practice, it is difficult to encounter a problem that any extension via code or external plugin is required, because their APIs are outstanding in terms of features design and support.

II. Leaflet, OpenLayers, and OpenStreetMap

Leaflet and OpenLayers are free and open-source map rendering SDKs. They do not have their own data, so they are usually used in conjunction with any other basemap provider. For example, with OpenStreetMap.

OpenStreetMap is a free, publicly available basemap. The map here is passed as pictures, meaning you won't be able to modify the style of the base map. If the need arises, you will have to regularly download OpenStreetMap data (they are publicly available) and host your own basemap service, which can be quite resource intensive.

OpenLayers has a rich API similar in functionality to Mapbox. At the same time, part of the configuration is set by classes and functions, which opens up the developer to the full breadth of modification to suit the needs of the application. However, "with great power comes great responsibility" - you will have to constantly and independently take care of the performance of your code.

Leaflet provides basic APIs out of the box. You can expand its functionality as you like and by its plugin system. There are lists of plug-ins recognized by the Leaflet developers that extend the functionality. For elementary tasks, it is convenient to use, for more difficult ones it can be more difficult and require large development costs (for example, fragmented loading and displaying data).

Last updated