Adding Markers to Map Object

  • Share this:

Code introduction


This function adds markers to a map object from a list of locations. Each location will be marked on the map, with the location information displayed.


Technology Stack : Folium

Code Type : Map marker

Code Difficulty : Intermediate


                
                    
def add_markers_to_map(location_list, map_obj):
    for location in location_list:
        latitude, longitude = location
        marker = folium.Marker([latitude, longitude], popup=str(location))
        marker.add_to(map_obj)
    return map_obj                
              
Tags: