var mymap = L.map('mapid', {
  zoom: 2,
  fullscreenControl: true,
  timeDimension: true,
  timeDimensionOptions:{
    timeInterval: "2001-01-16T12:00:00Z/2005-12-16T12:00:00Z",
    period: "P1M"
  },
  timeDimensionControl: true,
  timeDimensionControlOptions:{
    timeSteps: 12
  },    
  center: [20.0, 0.0],
});

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'    
}).addTo(mymap);

var testWMS = "http://localhost:8080/ncWMS2/wms?DATASET=outputs/hummingbird/output-3d059bc0-5033-11e6-9fa2-af0ebe9e921e.nc"
//var testWMS = "https://localhost:8443/ows/proxy/wms?DATASET=outputs/hummingbird/output-3d059bc0-5033-11e6-9fa2-af0ebe9e921e.nc"
var testLayer = L.tileLayer.wms(testWMS, {
  layers: 'tasmax',
  format: 'image/png',
  transparent: true,
  styles: 'default-scalar/x-Rainbow',
  attribution: '<a href="http://bird-house.github.io/">Birdhouse</a>'
});
var testTimeLayer = L.timeDimension.layer.wms(testLayer);
testTimeLayer.addTo(mymap);








@@ -1,14 +1,12 @@
 var 
-my
 map = L.
@@ -20,16 +20,16 @@
 pid', %7B%0A
+
   zoom: 
@@ -465,26 +465,24 @@
   %0A%7D).addTo(
-my
 map);%0A%0Avar t
@@ -1028,17 +1028,426 @@
 .addTo(m
-y
+ap);%0A%0Avar testLegend = L.control(%7B%0A    position: 'topright'%0A%7D);%0AtestLegend.onAdd = function(map) %7B%0A    var src = testWMS + %22&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYERS=tasmax&STYLES=default-scalar/x-Rainbow&PALETTE=default&HEIGHT=300%22;%0A    var div = L.DomUtil.create('div', 'info legend');%0A    div.innerHTML +=%0A        '%3Cimg src=%22' + src + '%22 alt=%22legend%22%3E';%0A    return div;%0A%7D;%0AtestLegend.addTo(
 map);%0A%0A%0A

add map legend