One way to show multiple locations on a map in Python is by using the folium
library. Here's an example code snippet:
main.py372 chars15 lines
In this example, we first create a map object centered at a specific latitude and longitude using the folium.Map()
function. Next, we create a list of the locations we want to mark on the map, and use a for
loop to add a marker for each location using the folium.Marker()
function.
Finally, we save the map as an HTML file using the save()
method. When we open the HTML file, we should see a map with markers at each of the specified locations.
gistlibby LogSnag