Added Capability for ImageOverlay

Bounds are a 2 Dimensional Array that define the top left and bottom right coordinates (lat lng) wher the Image should be placed
This commit is contained in:
andreas-froelich 2017-06-19 09:33:27 +01:00
parent e71332dc15
commit 6d77caa0d2

View File

@ -1042,6 +1042,11 @@ function doCommand(cmd) {
overlays[cmd.map.name] = L.tileLayer.wms(cmd.map.url, cmd.map.opt); overlays[cmd.map.name] = L.tileLayer.wms(cmd.map.url, cmd.map.opt);
} }
} }
else if (cmd.map.hasOwnProperty("bounds")) { //Image Overlay in the bounds specified (2D Array)
if (cmd.map.bounds.length === 2 && cmd.map.bounds[0].length === 2 && cmd.map.bounds[1].length === 2) {
overlays[cmd.map.overlay] = new L.imageOverlay(cmd.map.url, L.latLngBounds(cmd.map.bounds));
}
}
else { else {
overlays[cmd.map.overlay] = L.tileLayer(cmd.map.url, cmd.map.opt); overlays[cmd.map.overlay] = L.tileLayer(cmd.map.url, cmd.map.opt);
} }