anchor.diff:  <% @service_base = SiteConfig.geoserver_url + "/" + @workspace %>
  -
   
   <div class="content">
     <h1><%= @doc.title %></h1>
   
  -  <select onchange="changeLayer();">
  +  <select id="layer-switcher">
       <% @doc.layers.each do |layer| %>
         <%# TODO: extract to method %>
  -      <% clean_layer = /\:(.*)/.match(layer.text)[1].to_s %>
  -      <option value="<%= clean_layer %>"><%= clean_layer %></option>
  +    <% clean_layer = /\:(.*)/.match(layer.text)[1].to_s %>
  +    <option value="<%= clean_layer %>"><%= clean_layer %></option>
     <% end %>
     </select>
   
     <div id="item_map"></div>
     <div id="layerswitcher" class="olControlLayerSwitcher"></div>
   
  -      <div id="layers">
  +  <div id="layers">
   
       <h2>Individual Layers</h2>
   
       <% @doc.layers.each do |layer| %>
         <p>
  -      <strong><%= layer.content %></strong> (
  -        <%= link_to(pdf_url(layer.text), 'PDF') %>,
  -        <%= link_to(kml_url(layer.text), 'KML') %>,
  -        <%= link_to(jpeg_url(layer.text), 'JPEG', :class => 'ajax') %>,
  -        <%= link_to(ol_url(layer.text), 'Web Map', :class => 'cboxElement ajax') %>
  -        )
  -      </p>
  +    <strong><%= layer.content %></strong> (
  +    <%= link_to(pdf_url(layer.text), 'PDF') %>,
  +    <%= link_to(kml_url(layer.text), 'KML') %>,
  +    <%= link_to(jpeg_url(layer.text), 'JPEG', :class => 'ajax') %>,
  +    <%= link_to(ol_url(layer.text), 'Web Map', :class => 'cboxElement ajax') %>
  +    )
  +    </p>
     <% end %>
   
     </div>
  
positive.code: 
  <% content_for :jsfooter do %>
    <%# TODO: refactor in to partial %>
   <script>
  
  (function() {
    "use strict";
  //todo make this modular
    OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
    OpenLayers.Util.onImageLoadErrorColor = "transparent";
    OpenLayers.ImgPath = "http://js.mapbox.com/theme/dark/";
  
negative.code: 
    var activeLayer = null;
  
  
    $('#layer-switcher').change(function() {
      var layer = map.getLayersByName(this.value)[0];
  
      console.log('layer', map.getLayersByName(this.value));
  
      if(activeLayer != null) {
        activeLayer.setVisibility(false);
      }
  
      layer.setVisibility(true);
      activeLayer = layer;
      console.log('activeLayer', activeLayer);
  
    });
  
  })();
  
  </script>
  
  
  