@@ -269,7 +269,7 @@ def add_layers_to_map(self):
269269 @iter_obj ('simple' )
270270 def simple_marker (self , location = None , popup = 'Pop Text' , popup_on = True ,
271271 marker_color = 'blue' , marker_icon = 'info-sign' ,
272- clustered_marker = False , icon_angle = 0 ):
272+ clustered_marker = False , icon_angle = 0 , width = 300 ):
273273 '''Create a simple stock Leaflet marker on the map, with optional
274274 popup text or Vincent visualization.
275275
@@ -280,6 +280,8 @@ def simple_marker(self, location=None, popup='Pop Text', popup_on=True,
280280 popup: string or tuple, default 'Pop Text'
281281 Input text or visualization for object. Can pass either text,
282282 or a tuple of the form (Vincent object, 'vis_path.json')
283+ It is possible to adjust the width of text/HTML popups
284+ using the optional keywords `width`. (Leaflet default is 300px.)
283285 popup_on: boolean, default True
284286 Pass false for no popup information on the marker
285287 marker_color
@@ -322,8 +324,8 @@ def simple_marker(self, location=None, popup='Pop Text', popup_on=True,
322324 })
323325
324326 popup_out = self ._popup_render (popup = popup , mk_name = 'marker_' ,
325- count = count ,
326- popup_on = popup_on )
327+ count = count , popup_on = popup_on ,
328+ width = width )
327329
328330
329331
@@ -597,7 +599,7 @@ def click_for_marker(self, popup=None):
597599 self .template_vars .update ({'click_pop' : click_str })
598600
599601 def _popup_render (self , popup = None , mk_name = None , count = None ,
600- popup_on = True ):
602+ popup_on = True , width = 300 ):
601603 '''Popup renderer: either text or Vincent/Vega.
602604
603605 Parameters
@@ -617,7 +619,8 @@ def _popup_render(self, popup=None, mk_name=None, count=None,
617619 if isinstance (popup , str ):
618620 popup_temp = self .env .get_template ('simple_popup.js' )
619621 return popup_temp .render ({'pop_name' : mk_name + str (count ),
620- 'pop_txt' : json .dumps (popup )})
622+ 'pop_txt' : json .dumps (popup ),
623+ 'width' : width })
621624 elif isinstance (popup , tuple ):
622625 #Update template with JS libs
623626 vega_temp = self .env .get_template ('vega_ref.txt' ).render ()
0 commit comments