@@ -261,19 +261,17 @@ def add_wms_layer(self, wms_name=None, wms_url=None, wms_format=None,
261
261
def add_layers_to_map (self ):
262
262
"""
263
263
Required function to actually add the layers to the HTML packet.
264
- """
265
- layers_temp = self .env .get_template ('add_layers.js' )
266
264
267
- data_string = ''
268
- for i , layer in enumerate (self .added_layers ):
265
+ """
266
+ data_layers = ''
267
+ for k , layer in enumerate (self .added_layers ):
269
268
name = list (layer .keys ())[0 ]
270
- if i < len (self .added_layers )- 1 :
271
- term_string = ",\n "
269
+ data_layers += '\" {}\" : {}' .format (name , name )
270
+ if k < len (self .added_layers )- 1 :
271
+ data_layers += ",\n "
272
272
else :
273
- term_string += "\n "
274
- data_string += '\" {}\" : {}' .format (name , name , term_string )
273
+ data_layers += "\n "
275
274
276
- data_layers = layers_temp .render ({'layers' : data_string })
277
275
self .template_vars .setdefault ('data_layers' , []).append ((data_layers ))
278
276
279
277
@iter_obj ('simple' )
@@ -1058,7 +1056,9 @@ def image_overlay(self, data, image_opacity=1, min_lat=-90.0, max_lat=90.0,
1058
1056
'image_opacity' : image_opacity })
1059
1057
1060
1058
self .template_vars ['image_layers' ].append (image )
1061
- self .added_layers .append (image_name )
1059
+ # FIXME: I am excluding the image_overlay from the layer
1060
+ # control for now. There is a bug and I cannot find it.
1061
+ # self.added_layers.append({image_name: image_url})
1062
1062
1063
1063
def _build_map (self , html_templ = None , templ_type = 'string' ):
1064
1064
self ._auto_bounds ()
0 commit comments