How to set up an interactive map in 5 steps (PyCon SK 2022)
The PyCon SK 2022 conference, held in Bratislava, is an annual gathering of the Python community. It is organised by volunteers from the SPy organization dedicated to the propagation of the Python language and other open source technologies and ideas.
This year was also packed with interesting lectures and workshops, which attracted a lot of Python enthusiasts. In this article, we will present a topic that caught our attention for its simplicity, speed of implementation and the benefits it can bring.
The lecture is Set up an interactive map in browser in a few steps, presented by Mr. Vojta Filipec. What did we learn in it?
- How to make an interactive, easy-to-share map
- How to display points of interest (POIs)
- Set the colour, size and shape of POIs on the map
- Display a pop-up window with detailed POI information
With transformations we modify the data into the desired shape. The complete code can be found at this link
Use the folium package to create and display the map.
We add points of interest - POIs - to the map, for which we can define a color, for example, according to a certain condition, as shown in the example on github.
The result can be further configured, such as changing the underlying map, or using different icons instead of the circles that indicate POIs. If you are interested in this map creation option, feel free to watch this talk, which is available on YouTube.