0
# Download the OSM map data for the bounding box
G = ox.graph_from_bbox(north, south, east, west, network_type='drive')

# Convert the graph to a GeoDataFrame
gdf = ox.graph_to_gdfs(G, nodes=False, edges=True)

# Create a folium map centered on Singapore
m = folium.Map(location=[1.3521, 103.8198], zoom_start=11)

# Add the Draw plugin to the map
draw = Draw(export=True)
draw.add_to(m)
# Display the map
m

enter image description here

After drawing either a polyline or polygon, I would want to add in some meta data info for e.g. Road Name ect. Trying to find a solution to this using folium if possible ?

1 Answers1

0

Can probably use DivIcon to put anything on Folium map, like this:

from folium.features import DivIcon

folium.map.Marker(
        location=(latitude, longitude),
        icon=DivIcon(
            icon_size=(30,30),
            icon_anchor=(-2,-2), # x, y shift relative to location
            html=f'<div style="font-size: 14pt">Whatever</div>')).add_to(m)