﻿{{for layer in wms_layers:}}
  {{name = re.sub('\W', '_', layer)}}
    var wmsLayer{{=name}} = new OpenLayers.Layer.WMS( "{{=layer}}", "{{=wms_layers[layer].url}}", {
      {{if wms_layers[layer].base:}}
        isBaseLayer: 'true',
      {{pass}}
        wrapDateLine: 'true',
      {{if wms_layers[layer].map:}}
        map: '{{=wms_layers[layer].map}}',
      {{pass}}
      layers: '{{=wms_layers[layer].layers}}',
      {{if wms_layers[layer].format:}}
        type: '{{=wms_layers[layer].format}}',
      {{pass}}
      {{if wms_layers[layer].transparent:}}
        transparent: true,
      {{pass}}
      {{if wms_layers[layer].projection == 4326:}}
        projection: proj4326});
      {{else:}}
        projection: new OpenLayers.Projection('EPSG:{{=wms_layers[layer].projection}}')});
      {{pass}}  
    map.addLayer(wmsLayer{{=name}});
{{pass}}

@@ -168,92 +168,8 @@
  %7B%0D%0A
-      %7B%7Bif wms_layers%5Blayer%5D.base:%7D%7D%0D%0A        isBaseLayer: 'true',%0D%0A      %7B%7Bpass%7D%7D%0D%0A
     
@@ -613,19 +613,18 @@
 proj4326
+ 
 %7D
-);
 %0D%0A      
@@ -721,19 +721,125 @@
 tion%7D%7D')
-%7D);
+ %7D%0D%0A      %7B%7Bpass%7D%7D  %0D%0A      %7B%7Bif wms_layers%5Blayer%5D.base:%7D%7D%0D%0A      %7B%7Belse:%7D%7D%0D%0A        , %7B isBaseLayer: false %7D
 %0D%0A      
@@ -842,26 +842,36 @@
     %7B%7Bpass%7D%7D
-  
+%0D%0A        );
 %0D%0A    map.ad

Fix for WMS Overlays