Skip to content

Commit

Permalink
PNG Overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
n_gavi01 committed Jan 17, 2017
1 parent 053870a commit 51ea2ab
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Binary file added images/sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sample_transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 17 additions & 4 deletions js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,26 +185,39 @@ function createMap(position){
"Light Map": light
};

wmsLayer = L.tileLayer.wms('http://demo.opengeo.org/geoserver/ows?', {layers: 'nasa:bluemarble'}); /*WMS Layer to be received from WPS Team */
//Load image from WMS
//wmsLayer = L.tileLayer.wms('http://demo.opengeo.org/geoserver/ows?', {layers: 'nasa:bluemarble'}); /*WMS Layer to be received from WPS Team */

// Load image as layer from URL
//var imageUrl = 'http://www.getpaint.net/doc/latest/images/layerswindow/appletransparentbg.png';
//var image = L.imageOverlay(imageUrl, imageBounds).addTo(map);

// Load image as layer LOCALLY
var imageBounds = [[51.404102,-0.332827], [51.677422,0.131346]]; //bottom-left corner coordinates, top-right corner coordinates
var image = L.imageOverlay('images/sample_transparent.png', imageBounds).addTo(map)

var overlays = {
"Density": wmsLayer
//"Density": wmsLayer
"Heat Map": image
};

ctrl = L.control.layers(baseLayers, overlays).addTo(map); /*After creating WMS, should be: baseLayers,density */
getWMS();
//getWMS();
}

/**
* getWMS and add it to legend every 90 seconds from server
*/

/*
function getWMS(){
ctrl.removeLayer(wmsLayer);
wmsLayer = L.tileLayer.wms('http://demo.opengeo.org/geoserver/ows?', {layers: 'nasa:bluemarble'});
ctrl.addOverlay(wmsLayer, 'NASA');
console.log("WMS Added");
setTimeout(getWMS, 90000); //every 90 seconds
}
}
*/


/**
Expand Down

0 comments on commit 51ea2ab

Please sign in to comment.