@@ -363,7 +363,8 @@ def simple_marker(self, location=None, popup='Pop Text', popup_on=True,
363363
364364 @iter_obj ('line' )
365365 def line (self , locations ,
366- line_color = None , line_opacity = None , line_weight = None ):
366+ line_color = None , line_opacity = None , line_weight = None ,
367+ popup = 'Pop Text' , popup_on = True , popup_width = 300 ):
367368 """Add a line to the map with optional styles.
368369
369370 Parameters
@@ -373,6 +374,11 @@ def line(self, locations,
373374 line_color: string, default Leaflet's default ('#03f')
374375 line_opacity: float, default Leaflet's default (0.5)
375376 line_weight: float, default Leaflet's default (5)
377+ popup: string or tuple, default 'Pop Text'
378+ Input text or visualization for object. Can pass either text,
379+ or a tuple of the form (Vincent object, 'vis_path.json')
380+ popup_on: boolean, default True
381+ Pass false for no popup information on the marker
376382
377383 Note: If the optional styles are omitted, they will not be included
378384 in the HTML output and will obtain the Leaflet defaults listed above.
@@ -396,9 +402,13 @@ def line(self, locations,
396402 'locations' : locations ,
397403 'options' : polyline_opts })
398404
405+ popup_out = self ._popup_render (popup = popup , mk_name = 'line_' ,
406+ count = count , popup_on = popup_on ,
407+ width = popup_width )
408+
399409 add_line = 'map.addLayer({});' .format (varname )
400- self . template_vars . setdefault ( 'lines' , []). append (( line_rendered ,
401- add_line ))
410+ append = ( line_rendered , popup_out , add_line )
411+ self . template_vars . setdefault ( 'lines' , []). append (( append ))
402412
403413 @iter_obj ('multiline' )
404414 def multiline (self , locations , line_color = None , line_opacity = None ,
0 commit comments