jwass / mplleaflet

Easily convert matplotlib plots from Python into interactive Leaflet web maps.
BSD 3-Clause "New" or "Revised" License
522 stars 76 forks source link

Popup text for exported features #53

Open jni opened 6 years ago

jni commented 6 years ago

Hi!

Is there any way to annotate matplotlib points/line segments in such a way that they become marker popups in leaflet? To clarify, I'd like reproduce the following effect:

import os
import folium
mapit = folium.Map()
PER = (-31.940, 115.967)
MEL = (-37.673, 144.843)
folium.CircleMarker(location=MEL, color='#ff0000',
                        fill_color='#ff0000', popup='Melbourne airport',
                        radius=4).add_to(mapit)
folium.CircleMarker(location=PER, color='#ff0000',
                        fill_color='#ff0000', popup='Perth airport',
                        radius=4).add_to(mapit)
folium.PolyLine([PER, MEL], color='#ffff00', popup='MEL-PER').add_to(mapit)
mapit.save(os.path.expanduser('~/Desktop/perth.html'))

Maybe this is impossible but I thought I'd ask. =) Thanks!