From 806e129477d297332715be45cbd530170423b140 Mon Sep 17 00:00:00 2001 From: fbma Date: Thu, 29 Apr 2021 13:45:41 +0200 Subject: [PATCH] v1.0.1 --- .gitignore | 2 ++ dist/api.json | 5 +++-- dist/mirrorpanel.ol.min.js | 2 +- dist/mirrorpanel.ol.min.js.map | 2 +- package.json | 2 +- src/api.json | 5 +++-- test/dev.html | 6 +++--- test/prod.html | 6 +++--- 8 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5931ebc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +/src/index.js diff --git a/dist/api.json b/dist/api.json index 53c0a1a..2f6a182 100644 --- a/dist/api.json +++ b/dist/api.json @@ -80,12 +80,13 @@ "name": "Mirrorpanel", "description": "Plugin que permite comparar varias capas dividiendo la pantalla en varias partes.", "text": "Plugin que permite comparar varias capas dividiendo la pantalla en varias partes. Los mapas tienen sus vistas sincronizadas, y podemos ver la representación de una misma zona por distintas capas.", - "version": "1.0.0", - "date": "Julio, 2020", + "version": "1.0.1", + "date": "Abril, 2021", "author": "", "org": "", "tags": "mapea,plugin", "icon": "./facade/assets/icons/icons.svg", + "compatibility":["5","6"], "buttons": [ { "title": "", diff --git a/dist/mirrorpanel.ol.min.js b/dist/mirrorpanel.ol.min.js index 54d1fe4..0cf3e66 100644 --- a/dist/mirrorpanel.ol.min.js +++ b/dist/mirrorpanel.ol.min.js @@ -1,2 +1,2 @@ -!function(t){var e={};function o(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=5)}([function(t,e){t.exports='
\r\n
{{translations.title}}
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n'},function(t){t.exports=JSON.parse('{"tooltip":"Mirror Comparison","title":"Mirror Maps","modViz0":"Standard map","modViz1":"Vertical two maps","modViz2":"Horizontal two maps","modViz3":"Vertical three maps","modViz4":"Vertical four maps","modViz5":"Mosaic maps","modViz6":"Horizontal four maps","modViz7":"Vertical 2-1-1 proportional maps","modViz8":"One map above and two below","modViz9":"Two maps above and one below"}')},function(t){t.exports=JSON.parse('{"tooltip":"Comparador de mapas espejo","title":"Mapas espejo","modViz0":"Mapa standard","modViz1":"Dos mapas en vertical","modViz2":"Dos mapas en horizontal","modViz3":"Tres mapas en vertical","modViz4":"Cuatro mapas en vertical","modViz5":"Mosaico de mapas","modViz6":"Cuatro mapas en horizontal","modViz7":"Tres mapas en proporción 2-1-1","modViz8":"Un mapa arriba y dos abajo","modViz9":"Dos mapas arriba y uno abajo"}')},function(t){t.exports=JSON.parse('{"url":{"name":"mirrorpanel","separator":"*!"},"constructor":"M.plugin.Mirrorpanel","parameters":[{"type":"object","properties":[{"type":"simple","name":"position","possibleValues":["TL","TR","BL","BR"],"position":0},{"type":"boolean","name":"collapsed","position":1},{"type":"boolean","name":"collapsible","position":2},{"type":"simple","name":"modeViz","position":3},{"type":"boolean","name":"enabledKeyFunctions","position":4},{"type":"boolean","name":"showCursors","position":5},{"type":"simple","name":"mirrorLayers","position":6},{"type":"simple","name":"defaultBaseLyrs","position":7},{"type":"boolean","name":"interface","position":8},{"type":"boolean","name":"showToc","position":9}]}],"files":{"ol":{"scripts":["mirrorpanel.ol.min.js"],"styles":["mirrorpanel.ol.min.css"]}},"metadata":{"uuid_plugin":"","uuid_version_plugin":"","version_ficha_metadatos":"","name":"Mirrorpanel","description":"Plugin que permite comparar varias capas dividiendo la pantalla en varias partes.","text":"Plugin que permite comparar varias capas dividiendo la pantalla en varias partes. Los mapas tienen sus vistas sincronizadas, y podemos ver la representación de una misma zona por distintas capas.","version":"1.0.0","date":"Julio, 2020","author":"","org":"","tags":"mapea,plugin","icon":"./facade/assets/icons/icons.svg","buttons":[{"title":"","description":"","querySelector":""},{"title":"","description":"","querySelector":""}],"dependencies":{"modules":["",""],"plugins":[{"uuid":"","name":""}],"services":[{"name":"","description":""}]}}}')},function(t,e,o){},function(t,e,o){"use strict";o.r(e);o(4);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:y(),o=h(e),r="";return M.utils.isNullOrEmpty(o)?console.warn("The translation '".concat(e,"' has not been defined.")):r=t.split(".").reduce((function(t,e){return t[e]}),o),r};function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(t,e){for(var o=0;o0&&(this.mapL.A.addLayers(this.mirrorLayers),this.mapL.A.getLayers().forEach((function(t){0!==t.zindex_&&t.setVisible(!1)}))),this.showCursors&&this.addLayerCursor("A"),new Promise((function(t,o){var r;r={jsonp:!0,vars:{translations:{title:b("title"),modViz0:b("modViz0"),modViz1:b("modViz1"),modViz2:b("modViz2"),modViz3:b("modViz3"),modViz4:b("modViz4"),modViz5:b("modViz5"),modViz6:b("modViz6"),modViz7:b("modViz7"),modViz8:b("modViz8"),modViz9:b("modViz9")}}},e.template=M.template.compileSync(d.a,r),e.template.querySelectorAll('button[id^="set-mirror-"]').forEach((function(t,o){t.addEventListener("click",(function(t){e.manageVisionPanelByCSSGrid(o)}))})),e.manageVisionPanelByCSSGrid(e.modeViz),t(e.template)}))}},{key:"activate",value:function(){L(V(i.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){L(V(i.prototype),"deactivate",this).call(this)}},{key:"createMapContainers",value:function(){var t=document.createElement("div");t.id="lienzo",t.classList.add("mirrorpanel-grid");var e=document.getElementById("mapjs")||document.getElementById("map");document.body.insertBefore(t,e),e.classList.add("mirror1"),t.appendChild(e);var o=document.createElement("div");o.id="mapjsB",o.classList.add("mirror2"),t.appendChild(o);var r=document.createElement("div");r.id="mapjsC",r.classList.add("mirror3"),t.appendChild(r);var n=document.createElement("div");n.id="mapjsD",n.classList.add("mirror4"),t.appendChild(n)}},{key:"manageVisionPanelByCSSGrid",value:function(t){var e=this.modeViz;(document.getElementById("mapjs")||document.getElementById("map")).style.display="none",document.getElementById("mapjsB").style.display="none",document.getElementById("mapjsC").style.display="none",document.getElementById("mapjsD").style.display="none",this.template.querySelector("#set-mirror-"+e).classList.remove("buttom-pressed");for(var o=0;o<10;o++)document.getElementById("lienzo").classList.remove("modeViz"+o);document.getElementById("lienzo").classList.add("modeViz"+t),[1,2].includes(t)&&null==this.mapL.B&&this.createMapObjects("B"),[3,7,8,9].includes(t)&&(null==this.mapL.B&&this.createMapObjects("B"),null==this.mapL.C&&this.createMapObjects("C")),[4,5,6].includes(t)&&(null==this.mapL.B&&this.createMapObjects("B"),null==this.mapL.C&&this.createMapObjects("C"),null==this.mapL.D&&this.createMapObjects("D")),this.modeViz=t,this.template.querySelector("#set-mirror-"+t).classList.add("buttom-pressed"),this.map_.refresh(),null!==this.mapL.B&&this.mapL.B.refresh(),null!==this.mapL.C&&this.mapL.C.refresh(),null!==this.mapL.D&&this.mapL.D.refresh()}},{key:"createMapObjects",value:function(t){var e=null;switch(t){case"B":this.defaultBaseLyrs[1]&&(e=this.defaultBaseLyrs[0]);break;case"C":this.defaultBaseLyrs[2]&&(e=this.defaultBaseLyrs[1]);break;case"D":this.defaultBaseLyrs[3]&&(e=this.defaultBaseLyrs[2]);break;default:e=this.map_.getLayers()[0].setMap(this)}this.mapL[t]=M.map({container:"mapjs"+t,layers:e,controls:this.showTOC?["layerswitcher"]:"",center:this.map_.getCenter(),projection:this.map_.getProjection().code+"*"+this.map_.getProjection().units,zoom:this.map_.getZoom()}),this.mapL[t].getMapImpl().setView(this.map_.getMapImpl().getView()),this.showCursors&&this.addLayerCursor(t),this.mirrorLayers.length>0&&(this.mapL[t].addLayers(this.mirrorLayers),this.mapL[t].getLayers().forEach((function(t){0!==t.zindex_&&t.setVisible(!1)}))),this.mapL[t].refresh()}},{key:"addLayerCursor",value:function(t){var e=this;this.lyrCursor[t]=new M.layer.Vector({name:"Coordenadas centro "+t},{displayInLayerSwitcher:!1}),this.featureLyrCursor[t]=new M.Feature("Center"+t,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:this.mapL[t].getCenter()}}),this.lyrCursor[t].addFeatures([this.featureLyrCursor[t]]),this.lyrCursor[t].setStyle(this.styleCursor),this.lyrCursor[t].setZIndex(5e3),this.mapL[t].addLayers(this.lyrCursor[t]),this.mapL[t].getMapImpl().on("pointermove",(function(o){e.lyrCursor[t].setVisible(!1),Object.keys(e.featureLyrCursor).forEach((function(r){e.mapL[r]&&e.mapL[r].getMapImpl().setView(e.mapL[t].getMapImpl().getView()),r!=t&&null!==e.featureLyrCursor[r]&&(e.lyrCursor[r].setVisible(!0),e.featureLyrCursor[r].setGeometry({type:"Point",coordinates:o.coordinate}))}))}))}},{key:"removeMaps",value:function(){this.mapL.B=null,this.mapL.C=null,this.mapL.D=null}},{key:"destroyMapsContainer",value:function(){document.getElementById("mapjsB").remove(),document.getElementById("mapjsC").remove(),document.getElementById("mapjsD").remove();var t=document.getElementById("lienzo"),e=document.getElementById("mapjs")||document.getElementById("map");e.style.display="block",e.classList.remove("mirror1"),document.body.insertBefore(e,t),document.getElementById("lienzo").remove()}},{key:"equals",value:function(t){return t instanceof i}}])&&g(e.prototype,o),r&&g(e,r),i}(),O=o(3);function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{};j(this,i),(t=n.call(this)).name_="mirrorpanel",t.map_=null,t.controls_=[],t.className="m-plugin-mirrorpanel";var o=["TR","TL","BL","BR"];return t.position=o.includes(e.position)?e.position:"TR",t.collapsed=e.collapsed,void 0===t.collapsed&&(t.collapsed=!0),t.collapsible=e.collapsible,void 0===t.collapsible&&(t.collapsible=!0),t.modeViz=e.modeViz,void 0===t.modeViz&&(t.modeViz=0),t.enabledKeyFunctions=e.enabledKeyFunctions,void 0===t.enabledKeyFunctions&&(t.enabledKeyFunctions=!0),t.showCursors=e.showCursors,void 0===t.showCursors&&(t.showCursors=!0),t.mirrorLayers=[],void 0!==e.mirrorLayers&&(Array.isArray(e.mirrorLayers)?t.mirrorLayers=e.mirrorLayers:t.mirrorLayers=e.mirrorLayers.split(",")),t.defaultBaseLyrs=[],void 0!==e.defaultBaseLyrs&&(Array.isArray(e.defaultBaseLyrs)?t.defaultBaseLyrs=e.defaultBaseLyrs:t.defaultBaseLyrs=e.defaultBaseLyrs.split(",")),t.interface=void 0===e.interface||e.interface,t.showTOC=e.showTOC,void 0===t.showTOC&&(t.showTOC=!0),t.tooltip_=e.tooltip||b("tooltip"),t.metadata_=O.metadata,t}return e=i,(o=[{key:"addTo",value:function(t){var e=this,o={pluginOnLeft:!!["TL","BL"].includes(this.position),collapsible:this.collapsible,collapsed:this.collapsed,modeViz:this.modeViz,showCursors:this.showCursors,mirrorLayers:this.mirrorLayers,defaultBaseLyrs:this.defaultBaseLyrs,showTOC:this.showTOC};this.control_=new _(o),this.controls_.push(this.control_),this.map_=t,this.panel_=new M.ui.Panel("panelMirrorpanel",{collapsible:this.collapsible,collapsed:this.collapsed,position:M.ui.position[this.position],modeViz:this.modeViz,showCursors:this.showCursors,className:this.interface?"m-plugin-panelMirrorpanel":"m-plugin-panelMirrorpanel hidden",collapsedButtonClass:"mirrorpanel-icon",tooltip:this.tooltip_}),this.panel_.addControls(this.controls_),t.addPanels(this.panel_),document.addEventListener("keydown",(function(t){if(e.enabledKeyFunctions){for(var o=0;o<10;o++)t.ctrlKey&&t.shiftKey&&t.key==="F"+(o+1)&&e.control_.manageVisionPanelByCSSGrid(o);var r=["Control","Shift","Alt","Meta"].includes(t.key)?"":t.key;"Escape"==(t.ctrlKey?"Control ":"")+(t.shiftKey?"Shift ":"")+(t.altKey?"Alt ":"")+(t.metaKey?"Meta ":"")+r&&e.control_.manageVisionPanelByCSSGrid(0)}}))}},{key:"destroy",value:function(){document.removeEventListener("keydown",(function(t){})),this.control_.removeMaps(),this.control_.destroyMapsContainer(),this.map_.removeControls([this.control_]);var t=[null,null,null,null,null,null,null,null,null,null,null,null];this.control_=t[0],this.panel_=t[1],this.map_=t[2],this.collapsible=t[3],this.collapsed=t[4],this.modeViz=t[5],this.enabledKeyFunctions=t[6],this.showCursors=t[7],this.mirrorLayers=t[8],this.defaultBaseLyrs=t[9],this.interface=t[10],this.showTOC=t[11]}},{key:"getMetadata",value:function(){return this.metadata_}},{key:"getAPIRest",value:function(){return"".concat(this.name,"=").concat(this.position,"*!").concat(this.collapsed,"*!").concat(this.collapsible,"*!").concat(this.modeViz,"*!").concat(this.enabledKeyFunctions,"*!").concat(this.showCursors,"*!").concat(this.mirrorLayers,"*!").concat(this.defaultBaseLyrs,"*!").concat(this.interface,"*!").concat(this.showTOC)}},{key:"activate",value:function(){this.control_.activate()}},{key:"deactivate",value:function(){this.control_.deactivate()}},{key:"name",get:function(){return this.name_}}])&&S(e.prototype,o),r&&S(e,r),i}();window.M.plugin||(window.M.plugin={}),window.M.control||(window.M.control={}),window.M.impl||(window.M.impl={}),window.M.impl.control||(window.M.impl.control={}),window.M.plugin.Mirrorpanel=R,window.M.control.MirrorpanelControl=_,window.M.impl.control.MirrorpanelControl=p}]); +!function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=5)}([function(e,t){e.exports='
\r\n
{{translations.title}}
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n'},function(e){e.exports=JSON.parse('{"tooltip":"Mirror Comparison","title":"Mirror Maps","modViz0":"Standard map","modViz1":"Vertical two maps","modViz2":"Horizontal two maps","modViz3":"Vertical three maps","modViz4":"Vertical four maps","modViz5":"Mosaic maps","modViz6":"Horizontal four maps","modViz7":"Vertical 2-1-1 proportional maps","modViz8":"One map above and two below","modViz9":"Two maps above and one below"}')},function(e){e.exports=JSON.parse('{"tooltip":"Comparador de mapas espejo","title":"Mapas espejo","modViz0":"Mapa standard","modViz1":"Dos mapas en vertical","modViz2":"Dos mapas en horizontal","modViz3":"Tres mapas en vertical","modViz4":"Cuatro mapas en vertical","modViz5":"Mosaico de mapas","modViz6":"Cuatro mapas en horizontal","modViz7":"Tres mapas en proporción 2-1-1","modViz8":"Un mapa arriba y dos abajo","modViz9":"Dos mapas arriba y uno abajo"}')},function(e){e.exports=JSON.parse('{"url":{"name":"mirrorpanel","separator":"*!"},"constructor":"M.plugin.Mirrorpanel","parameters":[{"type":"object","properties":[{"type":"simple","name":"position","possibleValues":["TL","TR","BL","BR"],"position":0},{"type":"boolean","name":"collapsed","position":1},{"type":"boolean","name":"collapsible","position":2},{"type":"simple","name":"modeViz","position":3},{"type":"boolean","name":"enabledKeyFunctions","position":4},{"type":"boolean","name":"showCursors","position":5},{"type":"simple","name":"mirrorLayers","position":6},{"type":"simple","name":"defaultBaseLyrs","position":7},{"type":"boolean","name":"interface","position":8},{"type":"boolean","name":"showToc","position":9}]}],"files":{"ol":{"scripts":["mirrorpanel.ol.min.js"],"styles":["mirrorpanel.ol.min.css"]}},"metadata":{"uuid_plugin":"","uuid_version_plugin":"","version_ficha_metadatos":"","name":"Mirrorpanel","description":"Plugin que permite comparar varias capas dividiendo la pantalla en varias partes.","text":"Plugin que permite comparar varias capas dividiendo la pantalla en varias partes. Los mapas tienen sus vistas sincronizadas, y podemos ver la representación de una misma zona por distintas capas.","version":"1.0.1","date":"Abril, 2021","author":"","org":"","tags":"mapea,plugin","icon":"./facade/assets/icons/icons.svg","compatibility":["5","6"],"buttons":[{"title":"","description":"","querySelector":""},{"title":"","description":"","querySelector":""}],"dependencies":{"modules":["",""],"plugins":[{"uuid":"","name":""}],"services":[{"name":"","description":""}]}}}')},function(e,t,o){},function(e,t,o){"use strict";o.r(t);o(4);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:y(),o=h(t),r="";return M.utils.isNullOrEmpty(o)?console.warn("The translation '".concat(t,"' has not been defined.")):r=e.split(".").reduce((function(e,t){return e[t]}),o),r};function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){for(var o=0;o0&&(this.mapL.A.addLayers(this.mirrorLayers),this.mapL.A.getLayers().forEach((function(e){0!==e.zindex_&&e.setVisible(!1)}))),this.showCursors&&this.addLayerCursor("A"),new Promise((function(e,o){var r;r={jsonp:!0,vars:{translations:{title:b("title"),modViz0:b("modViz0"),modViz1:b("modViz1"),modViz2:b("modViz2"),modViz3:b("modViz3"),modViz4:b("modViz4"),modViz5:b("modViz5"),modViz6:b("modViz6"),modViz7:b("modViz7"),modViz8:b("modViz8"),modViz9:b("modViz9")}}},t.template=M.template.compileSync(d.a,r),t.template.querySelectorAll('button[id^="set-mirror-"]').forEach((function(e,o){e.addEventListener("click",(function(e){t.manageVisionPanelByCSSGrid(o)}))})),t.manageVisionPanelByCSSGrid(t.modeViz),e(t.template)}))}},{key:"activate",value:function(){L(V(i.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){L(V(i.prototype),"deactivate",this).call(this)}},{key:"createMapContainers",value:function(){var e=document.createElement("div");e.id="lienzo",e.classList.add("mirrorpanel-grid");var t=document.getElementById("mapjs")||document.getElementById("map");document.body.insertBefore(e,t),t.classList.add("mirror1"),e.appendChild(t);var o=document.createElement("div");o.id="mapjsB",o.classList.add("mirror2"),e.appendChild(o);var r=document.createElement("div");r.id="mapjsC",r.classList.add("mirror3"),e.appendChild(r);var n=document.createElement("div");n.id="mapjsD",n.classList.add("mirror4"),e.appendChild(n)}},{key:"manageVisionPanelByCSSGrid",value:function(e){var t=this.modeViz;(document.getElementById("mapjs")||document.getElementById("map")).style.display="none",document.getElementById("mapjsB").style.display="none",document.getElementById("mapjsC").style.display="none",document.getElementById("mapjsD").style.display="none",this.template.querySelector("#set-mirror-"+t).classList.remove("buttom-pressed");for(var o=0;o<10;o++)document.getElementById("lienzo").classList.remove("modeViz"+o);document.getElementById("lienzo").classList.add("modeViz"+e),[1,2].includes(e)&&null==this.mapL.B&&this.createMapObjects("B"),[3,7,8,9].includes(e)&&(null==this.mapL.B&&this.createMapObjects("B"),null==this.mapL.C&&this.createMapObjects("C")),[4,5,6].includes(e)&&(null==this.mapL.B&&this.createMapObjects("B"),null==this.mapL.C&&this.createMapObjects("C"),null==this.mapL.D&&this.createMapObjects("D")),this.modeViz=e,this.template.querySelector("#set-mirror-"+e).classList.add("buttom-pressed"),this.map_.refresh(),null!==this.mapL.B&&this.mapL.B.refresh(),null!==this.mapL.C&&this.mapL.C.refresh(),null!==this.mapL.D&&this.mapL.D.refresh()}},{key:"createMapObjects",value:function(e){var t=null;switch(e){case"B":this.defaultBaseLyrs[1]&&(t=this.defaultBaseLyrs[0]);break;case"C":this.defaultBaseLyrs[2]&&(t=this.defaultBaseLyrs[1]);break;case"D":this.defaultBaseLyrs[3]&&(t=this.defaultBaseLyrs[2]);break;default:t=this.map_.getLayers()[0].setMap(this)}this.mapL[e]=M.map({container:"mapjs"+e,layers:t,controls:this.showTOC?["layerswitcher"]:"",center:this.map_.getCenter(),projection:this.map_.getProjection().code+"*"+this.map_.getProjection().units,zoom:this.map_.getZoom()}),this.mapL[e].getMapImpl().setView(this.map_.getMapImpl().getView()),this.showCursors&&this.addLayerCursor(e),this.mirrorLayers.length>0&&(this.mapL[e].addLayers(this.mirrorLayers),this.mapL[e].getLayers().forEach((function(e){0!==e.zindex_&&e.setVisible(!1)}))),this.mapL[e].refresh()}},{key:"addLayerCursor",value:function(e){var t=this;this.lyrCursor[e]=new M.layer.Vector({name:"Coordenadas centro "+e},{displayInLayerSwitcher:!1}),this.featureLyrCursor[e]=new M.Feature("Center"+e,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:this.mapL[e].getCenter()}}),this.lyrCursor[e].addFeatures([this.featureLyrCursor[e]]),this.lyrCursor[e].setStyle(this.styleCursor),this.lyrCursor[e].setZIndex(5e3),this.mapL[e].addLayers(this.lyrCursor[e]),this.mapL[e].getMapImpl().on("pointermove",(function(o){t.lyrCursor[e].setVisible(!1),Object.keys(t.featureLyrCursor).forEach((function(r){t.mapL[r]&&t.mapL[r].getMapImpl().setView(t.mapL[e].getMapImpl().getView()),r!=e&&null!==t.featureLyrCursor[r]&&(t.lyrCursor[r].setVisible(!0),t.featureLyrCursor[r].setGeometry({type:"Point",coordinates:o.coordinate}))}))}))}},{key:"removeMaps",value:function(){this.mapL.B=null,this.mapL.C=null,this.mapL.D=null}},{key:"destroyMapsContainer",value:function(){document.getElementById("mapjsB").remove(),document.getElementById("mapjsC").remove(),document.getElementById("mapjsD").remove();var e=document.getElementById("lienzo"),t=document.getElementById("mapjs")||document.getElementById("map");t.style.display="block",t.classList.remove("mirror1"),document.body.insertBefore(t,e),document.getElementById("lienzo").remove()}},{key:"equals",value:function(e){return e instanceof i}}])&&g(t.prototype,o),r&&g(t,r),i}(),_=o(3);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{};j(this,i),(e=n.call(this)).name_="mirrorpanel",e.map_=null,e.controls_=[],e.className="m-plugin-mirrorpanel";var o=["TR","TL","BL","BR"];return e.position=o.includes(t.position)?t.position:"TR",e.collapsed=t.collapsed,void 0===e.collapsed&&(e.collapsed=!0),e.collapsible=t.collapsible,void 0===e.collapsible&&(e.collapsible=!0),e.modeViz=t.modeViz,void 0===e.modeViz&&(e.modeViz=0),e.enabledKeyFunctions=t.enabledKeyFunctions,void 0===e.enabledKeyFunctions&&(e.enabledKeyFunctions=!0),e.showCursors=t.showCursors,void 0===e.showCursors&&(e.showCursors=!0),e.mirrorLayers=[],void 0!==t.mirrorLayers&&(Array.isArray(t.mirrorLayers)?e.mirrorLayers=t.mirrorLayers:e.mirrorLayers=t.mirrorLayers.split(",")),e.defaultBaseLyrs=[],void 0!==t.defaultBaseLyrs&&(Array.isArray(t.defaultBaseLyrs)?e.defaultBaseLyrs=t.defaultBaseLyrs:e.defaultBaseLyrs=t.defaultBaseLyrs.split(",")),e.interface=void 0===t.interface||t.interface,e.showTOC=t.showTOC,void 0===e.showTOC&&(e.showTOC=!0),e.tooltip_=t.tooltip||b("tooltip"),e.metadata_=_.metadata,e}return t=i,(o=[{key:"addTo",value:function(e){var t=this,o={pluginOnLeft:!!["TL","BL"].includes(this.position),collapsible:this.collapsible,collapsed:this.collapsed,modeViz:this.modeViz,showCursors:this.showCursors,mirrorLayers:this.mirrorLayers,defaultBaseLyrs:this.defaultBaseLyrs,showTOC:this.showTOC};this.control_=new O(o),this.controls_.push(this.control_),this.map_=e,this.panel_=new M.ui.Panel("panelMirrorpanel",{collapsible:this.collapsible,collapsed:this.collapsed,position:M.ui.position[this.position],modeViz:this.modeViz,showCursors:this.showCursors,className:this.interface?"m-plugin-panelMirrorpanel":"m-plugin-panelMirrorpanel hidden",collapsedButtonClass:"mirrorpanel-icon",tooltip:this.tooltip_}),this.panel_.addControls(this.controls_),e.addPanels(this.panel_),document.addEventListener("keydown",(function(e){if(t.enabledKeyFunctions){for(var o=0;o<10;o++)e.ctrlKey&&e.shiftKey&&e.key==="F"+(o+1)&&t.control_.manageVisionPanelByCSSGrid(o);var r=["Control","Shift","Alt","Meta"].includes(e.key)?"":e.key;"Escape"==(e.ctrlKey?"Control ":"")+(e.shiftKey?"Shift ":"")+(e.altKey?"Alt ":"")+(e.metaKey?"Meta ":"")+r&&t.control_.manageVisionPanelByCSSGrid(0)}}))}},{key:"destroy",value:function(){document.removeEventListener("keydown",(function(e){})),this.control_.removeMaps(),this.control_.destroyMapsContainer(),this.map_.removeControls([this.control_]);var e=[null,null,null,null,null,null,null,null,null,null,null,null];this.control_=e[0],this.panel_=e[1],this.map_=e[2],this.collapsible=e[3],this.collapsed=e[4],this.modeViz=e[5],this.enabledKeyFunctions=e[6],this.showCursors=e[7],this.mirrorLayers=e[8],this.defaultBaseLyrs=e[9],this.interface=e[10],this.showTOC=e[11]}},{key:"name",get:function(){return this.name_}},{key:"getMetadata",value:function(){return this.metadata_}},{key:"getAPIRest",value:function(){return"".concat(this.name,"=").concat(this.position,"*!").concat(this.collapsed,"*!").concat(this.collapsible,"*!").concat(this.modeViz,"*!").concat(this.enabledKeyFunctions,"*!").concat(this.showCursors,"*!").concat(this.mirrorLayers,"*!").concat(this.defaultBaseLyrs,"*!").concat(this.interface,"*!").concat(this.showTOC)}},{key:"activate",value:function(){this.control_.activate()}},{key:"deactivate",value:function(){this.control_.deactivate()}}])&&S(t.prototype,o),r&&S(t,r),i}();window.M.plugin||(window.M.plugin={}),window.M.control||(window.M.control={}),window.M.impl||(window.M.impl={}),window.M.impl.control||(window.M.impl.control={}),window.M.plugin.Mirrorpanel=R,window.M.control.MirrorpanelControl=O,window.M.impl.control.MirrorpanelControl=p}]); //# sourceMappingURL=mirrorpanel.ol.min.js.map \ No newline at end of file diff --git a/dist/mirrorpanel.ol.min.js.map b/dist/mirrorpanel.ol.min.js.map index b18c62d..fd1077c 100644 --- a/dist/mirrorpanel.ol.min.js.map +++ b/dist/mirrorpanel.ol.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/templates/mirrorpanel.html","webpack:///./src/impl/ol/js/mirrorpanelcontrol.js","webpack:///./src/facade/js/i18n/language.js","webpack:///./src/facade/js/mirrorpanelcontrol.js","webpack:///./src/facade/js/mirrorpanel.js","webpack:///./src/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","MirrorpanelControl","M","impl","Control","map","html","getMapImpl","getInteractions","forEach","interaction","ol","DoubleClickZoom","dblClickInteraction_","translations","en","es","getLang","res","language","getTranslation","lang","getValue","keyPath","translation","utils","isNullOrEmpty","console","warn","split","reduce","prev","current","values","isUndefined","MirrorpanelImplControl","exception","template","modeViz","showCursors","mapL","A","B","C","D","lyrCursor","featureLyrCursor","styleCursor","style","Point","icon","form","CIRCLE","fontsize","radius","rotation","rotate","offset","color","fill","gradientcolor","opacity","defaultBaseLyrs","mirrorLayers","showTOC","createMapContainers","compileSync","string","options","parseToHtml","templateVars","vars","htmlText","Handlebars","compile","templateFn","stringToHtml","this","length","addLayers","getLayers","zindex_","setVisible","addLayerCursor","Promise","success","fail","templateOptions","jsonp","title","getValueTranslate","modViz0","modViz1","modViz2","modViz3","modViz4","modViz5","modViz6","modViz7","modViz8","modViz9","querySelectorAll","button","addEventListener","evt","manageVisionPanelByCSSGrid","bigContainer","document","createElement","id","classList","add","mapjsA","getElementById","body","insertBefore","appendChild","mapjsB","mapjsC","mapjsD","oldModeViz","display","querySelector","remove","includes","createMapObjects","map_","refresh","mapLyr","defLyr","setMap","container","layers","controls","center","getCenter","projection","getProjection","code","units","zoom","getZoom","setView","getView","layer","Vector","displayInLayerSwitcher","Feature","type","properties","geometry","coordinates","addFeatures","setStyle","setZIndex","on","event","keys","k","setGeometry","coordinate","lienzo","control","Mirrorpanel","Plugin","name_","controls_","className","positions","position","collapsed","undefined","collapsible","enabledKeyFunctions","Array","isArray","tooltip_","tooltip","metadata_","api","metadata","pluginOnLeft","control_","push","panel_","ui","Panel","collapsedButtonClass","addControls","addPanels","zEvent","ctrlKey","shiftKey","keyStr","altKey","metaKey","removeEventListener","removeMaps","destroyMapsContainer","removeControls","activate","deactivate","window","plugin","M$plugin$Mirrorpanel","M$control$MirrorpanelControl","M$impl$control$MirrorpanelControl"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAA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G,Y,mCAWZ,gBAAUrG,KAAKrG,KAAf,YAAuBqG,KAAK4F,SAA5B,aAAyC5F,KAAK6F,UAA9C,aAA4D7F,KAAK+F,YAAjE,aAAiF/F,KAAKvC,QAAtF,aAAkGuC,KAAKgG,oBAAvG,aAA+HhG,KAAKtC,YAApI,aAAoJsC,KAAKd,aAAzJ,aAA0Kc,KAAKf,gBAA/K,aAAmMe,KAAA,UAAnM,aAAsNA,KAAKb,W,iCAW3Na,KAAKyG,SAASkB,a,mCAWd3H,KAAKyG,SAASmB,e,2BA5Cd,OAAO5H,KAAKwF,W,gCCrPXqC,OAAOxM,EAAEyM,SAAQD,OAAOxM,EAAEyM,OAAS,IACnCD,OAAOxM,EAAEgK,UAASwC,OAAOxM,EAAEgK,QAAU,IACrCwC,OAAOxM,EAAEC,OAAMuM,OAAOxM,EAAEC,KAAO,IAC/BuM,OAAOxM,EAAEC,KAAK+J,UAASwC,OAAOxM,EAAEC,KAAK+J,QAAU,IACpDwC,OAAOxM,EAAEyM,OAAOxC,YAAcyC,EAC9BF,OAAOxM,EAAEgK,QAAQjK,mBAAqB4M,EACtCH,OAAOxM,EAAEC,KAAK+J,QAAQjK,mBAAqB6M","file":"mirrorpanel.ol.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = \"
\\r\\n
{{translations.title}}
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n\";","/**\r\n * @module M/impl/control/MirrorpanelControl\r\n */\r\nexport default class MirrorpanelControl extends M.impl.Control {\r\n /**\r\n * This function adds the control to the specified map\r\n *\r\n * @public\r\n * @function\r\n * @param {M.Map} map to add the plugin\r\n * @param {HTMLElement} html of the plugin\r\n * @api stable\r\n */\r\n addTo(map, html) {\r\n // obtengo la interacción por defecto del dblclick para manejarla\r\n const olMap = map.getMapImpl();\r\n olMap.getInteractions().forEach((interaction) => {\r\n if (interaction instanceof ol.interaction.DoubleClickZoom) {\r\n this.dblClickInteraction_ = interaction;\r\n }\r\n });\r\n super.addTo(map, html);\r\n }\r\n}\r\n","import en from './en';\nimport es from './es';\n\n/**\n * Default object with es and en translate.\n *\n * @const\n * @type {object}\n */\nconst translations = {\n en,\n es,\n};\n\nconst getLang = () => {\n let res = 'es';\n if (typeof M.language.getLang === 'function') {\n res = M.language.getLang();\n }\n\n return res;\n};\n\n/**\n * This function sets a new language translate.\n * @param {string} lang\n * @param {JSON} json\n * @public\n * @api\n */\nexport const addTranslation = (lang, json) => {\n translations[lang] = json;\n};\n\n/**\n * This function gets a language translate.\n *\n * @param {string} lang\n * @return {JSON}\n * @public\n * @api\n */\nexport const getTranslation = (lang) => {\n return translations[lang];\n};\n\n/**\n * This function gets a language value from key\n *\n * @public\n * @param {string}\n * @param {string}\n * @return {string}\n * @public\n * @api\n */\n\nexport const getValue = (keyPath, lang = getLang()) => {\n const translation = getTranslation(lang);\n let value = '';\n if (M.utils.isNullOrEmpty(translation)) {\n /* eslint-disable no-console */\n console.warn(`The translation '${lang}' has not been defined.`);\n } else {\n value = keyPath.split('.').reduce((prev, current) => prev[current], translation);\n }\n\n return value;\n};\n","/**\r\n * @module M/control/MirrorpanelControl\r\n */\r\n\r\nimport MirrorpanelImplControl from 'impl/mirrorpanelcontrol';\r\nimport template from 'templates/mirrorpanel';\r\nimport { getValue as getValueTranslate } from './i18n/language';\r\n\r\nexport default class MirrorpanelControl extends M.Control {\r\n /**\r\n * @classdesc\r\n * Main constructor of the class. Creates a PluginControl\r\n * control\r\n *\r\n * @constructor\r\n * @extends {M.Control}\r\n * @api stable\r\n */\r\n constructor(values) {\r\n // 1. checks if the implementation can create PluginControl\r\n if (M.utils.isUndefined(MirrorpanelImplControl)) {\r\n M.exception('La implementación usada no puede crear controles MirrorpanelControl');\r\n }\r\n // 2. implementation of this control\r\n const impl = new MirrorpanelImplControl();\r\n super(impl, 'Mirrorpanel');\r\n\r\n /**\r\n * Template\r\n * @public\r\n * @type { HTMLElement }\r\n */\r\n this.template = null;\r\n\r\n /**\r\n * Visual mode\r\n * @private\r\n * @type {Number}\r\n */\r\n this.modeViz = values.modeViz;\r\n\r\n /**\r\n * Mirror maps with plugins\r\n * @private\r\n * @type {boolean}\r\n */\r\n this.showCursors = values.showCursors;\r\n\r\n /**\r\n * Defining mirror maps variables\r\n */\r\n this.mapL = {\r\n A: null,\r\n B: null,\r\n C: null,\r\n D: null,\r\n }\r\n this.lyrCursor = {\r\n A: null,\r\n B: null,\r\n C: null,\r\n D: null,\r\n }\r\n this.featureLyrCursor = {\r\n A: null,\r\n B: null,\r\n C: null,\r\n D: null,\r\n }\r\n\r\n /**\r\n * Defining cursor style\r\n */\r\n this.styleCursor = new M.style.Point({\r\n icon: {\r\n form: M.style.form.CIRCLE,\r\n fontsize: 0.5,\r\n radius: 5,\r\n rotation: 0,\r\n rotate: false,\r\n offset: [0, 0],\r\n color: 'black',\r\n fill: 'red',\r\n gradientcolor: '#088A85',\r\n opacity: 0.8\r\n }\r\n });\r\n\r\n /**\r\n * Default layers for mirror maps\r\n * @public\r\n * @public {Array}\r\n */\r\n this.defaultBaseLyrs = values.defaultBaseLyrs;\r\n\r\n /**\r\n * All layers\r\n * @public\r\n * @public {Array}\r\n */\r\n this.mirrorLayers = values.mirrorLayers;\r\n\r\n /**\r\n * Enable layerswitcher control\r\n * @public\r\n * @public {Array}\r\n */\r\n this.showTOC = values.showTOC;\r\n\r\n this.createMapContainers();\r\n }\r\n\r\n\r\n /**\r\n * This function creates the view\r\n *\r\n * @public\r\n * @function\r\n * @param {M.Map} map to add the control\r\n * @api stable\r\n */\r\n createView(map) {\r\n if (!M.template.compileSync) {\r\n M.template.compileSync = (string, options) => {\r\n let templateCompiled;\r\n let templateVars = {};\r\n let parseToHtml;\r\n if (!M.utils.isUndefined(options)) {\r\n templateVars = M.utils.extends(templateVars, options.vars);\r\n parseToHtml = options.parseToHtml;\r\n }\r\n const templateFn = Handlebars.compile(string);\r\n const htmlText = templateFn(templateVars);\r\n if (parseToHtml !== false) {\r\n templateCompiled = M.utils.stringToHtml(htmlText);\r\n } else {\r\n templateCompiled = htmlText;\r\n }\r\n return templateCompiled;\r\n };\r\n }\r\n\r\n this.mapL['A'] = map;\r\n if (this.mirrorLayers.length > 0) {\r\n this.mapL['A'].addLayers(this.mirrorLayers);\r\n this.mapL['A'].getLayers().forEach((l) => {\r\n if (l.zindex_ !== 0) { l.setVisible(false); }\r\n });\r\n }\r\n if (this.showCursors) { this.addLayerCursor('A'); }\r\n return new Promise((success, fail) => {\r\n let templateOptions = '';\r\n templateOptions = {\r\n jsonp: true,\r\n vars: {\r\n translations: {\r\n title: getValueTranslate('title'),\r\n modViz0: getValueTranslate('modViz0'),\r\n modViz1: getValueTranslate('modViz1'),\r\n modViz2: getValueTranslate('modViz2'),\r\n modViz3: getValueTranslate('modViz3'),\r\n modViz4: getValueTranslate('modViz4'),\r\n modViz5: getValueTranslate('modViz5'),\r\n modViz6: getValueTranslate('modViz6'),\r\n modViz7: getValueTranslate('modViz7'),\r\n modViz8: getValueTranslate('modViz8'),\r\n modViz9: getValueTranslate('modViz9')\r\n }\r\n }\r\n };\r\n\r\n this.template = M.template.compileSync(template, templateOptions);\r\n\r\n // Button's click events\r\n this.template.querySelectorAll('button[id^=\"set-mirror-\"]')\r\n .forEach((button, modeViz) => {\r\n button.addEventListener('click', evt => {\r\n this.manageVisionPanelByCSSGrid(modeViz);\r\n })\r\n });\r\n\r\n // Apply default vision\r\n this.manageVisionPanelByCSSGrid(this.modeViz);\r\n success(this.template);\r\n });\r\n\r\n }\r\n\r\n /**\r\n * This function is called on the control activation\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n activate() {\r\n super.activate();\r\n }\r\n /**\r\n * This function is called on the control deactivation\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n deactivate() {\r\n super.deactivate();\r\n }\r\n\r\n /**\r\n * Initial configurations for applying CSS grid.\r\n * \r\n */\r\n createMapContainers() {\r\n const bigContainer = document.createElement('div');\r\n bigContainer.id = \"lienzo\";\r\n bigContainer.classList.add('mirrorpanel-grid');\r\n\r\n const mapjsA = document.getElementById(\"mapjs\") || document.getElementById(\"map\");\r\n document.body.insertBefore(bigContainer, mapjsA);\r\n mapjsA.classList.add('mirror1');\r\n bigContainer.appendChild(mapjsA);\r\n\r\n const mapjsB = document.createElement('div');\r\n mapjsB.id = \"mapjsB\";\r\n mapjsB.classList.add('mirror2');\r\n bigContainer.appendChild(mapjsB);\r\n\r\n const mapjsC = document.createElement('div');\r\n mapjsC.id = \"mapjsC\";\r\n mapjsC.classList.add('mirror3');\r\n bigContainer.appendChild(mapjsC);\r\n\r\n const mapjsD = document.createElement('div');\r\n mapjsD.id = \"mapjsD\";\r\n mapjsD.classList.add('mirror4');\r\n bigContainer.appendChild(mapjsD);\r\n }\r\n\r\n /**\r\n * This function shows/hides panel for differents viz options.\r\n * The mirror maps are launched from here\r\n * \r\n */\r\n manageVisionPanelByCSSGrid(modeViz) {\r\n let oldModeViz = this.modeViz;\r\n let map0 = document.getElementById('mapjs') || document.getElementById('map');\r\n map0.style.display = 'none';\r\n document.getElementById('mapjsB').style.display = 'none';\r\n document.getElementById('mapjsC').style.display = 'none';\r\n document.getElementById('mapjsD').style.display = 'none';\r\n this.template.querySelector('#set-mirror-' + oldModeViz).classList.remove('buttom-pressed');\r\n\r\n for (let i = 0; i < 10; i++) {\r\n document.getElementById('lienzo').classList.remove('modeViz' + i);\r\n }\r\n document.getElementById('lienzo').classList.add('modeViz' + modeViz);\r\n\r\n //Create map objects by modeviz\r\n if ([1, 2].includes(modeViz)) {\r\n if (this.mapL['B'] == null) {\r\n this.createMapObjects('B');//Create MapB\r\n }\r\n }\r\n if ([3, 7, 8, 9].includes(modeViz)) {\r\n if (this.mapL['B'] == null) {\r\n this.createMapObjects('B');//Create MapB\r\n }\r\n if (this.mapL['C'] == null) {\r\n this.createMapObjects('C');//Create MapC\r\n }\r\n }\r\n if ([4, 5, 6].includes(modeViz)) {\r\n if (this.mapL['B'] == null) {\r\n this.createMapObjects('B');//Create MapB\r\n }\r\n if (this.mapL['C'] == null) {\r\n this.createMapObjects('C');//Create MapC\r\n }\r\n if (this.mapL['D'] == null) {\r\n this.createMapObjects('D');//Create MapD\r\n }\r\n }\r\n\r\n this.modeViz = modeViz;\r\n this.template.querySelector('#set-mirror-' + modeViz).classList.add('buttom-pressed');\r\n this.map_.refresh();\r\n if (this.mapL['B'] !== null) { this.mapL['B'].refresh(); }\r\n if (this.mapL['C'] !== null) { this.mapL['C'].refresh(); }\r\n if (this.mapL['D'] !== null) { this.mapL['D'].refresh(); }\r\n }\r\n\r\n /**\r\n * Create mirror map object synchro with the main map\r\n */\r\n createMapObjects(mapLyr) {\r\n let defLyr = null;\r\n switch (mapLyr) {\r\n case 'B':\r\n if (this.defaultBaseLyrs[1]) defLyr = this.defaultBaseLyrs[0];\r\n break;\r\n case 'C':\r\n if (this.defaultBaseLyrs[2]) defLyr = this.defaultBaseLyrs[1];\r\n break;\r\n case 'D':\r\n if (this.defaultBaseLyrs[3]) defLyr = this.defaultBaseLyrs[2];\r\n break;\r\n default:\r\n defLyr = this.map_.getLayers()[0].setMap(this);\r\n break;\r\n }\r\n this.mapL[mapLyr] = M.map({\r\n container: 'mapjs' + mapLyr,\r\n layers: defLyr,\r\n controls: this.showTOC ? ['layerswitcher'] : '',\r\n center: this.map_.getCenter(),\r\n projection: this.map_.getProjection().code + '*' + this.map_.getProjection().units,\r\n zoom: this.map_.getZoom(),\r\n });\r\n this.mapL[mapLyr].getMapImpl().setView(this.map_.getMapImpl().getView());\r\n\r\n if (this.showCursors) { this.addLayerCursor(mapLyr); }\r\n if (this.mirrorLayers.length > 0) {\r\n this.mapL[mapLyr].addLayers(this.mirrorLayers);\r\n this.mapL[mapLyr].getLayers().forEach((l) => {\r\n if (l.zindex_ !== 0) { l.setVisible(false); }\r\n });\r\n }\r\n this.mapL[mapLyr].refresh();\r\n }\r\n\r\n /**\r\n * Adding a layer for cursor on Map\r\n */\r\n addLayerCursor(mapLyr) {\r\n // Cursor Layer\r\n this.lyrCursor[mapLyr] = new M.layer.Vector({\r\n name: 'Coordenadas centro ' + mapLyr,\r\n }, { displayInLayerSwitcher: false });\r\n\r\n this.featureLyrCursor[mapLyr] = new M.Feature('Center' + mapLyr, {\r\n type: 'Feature',\r\n properties: {},\r\n geometry: {\r\n type: 'Point',\r\n coordinates: this.mapL[mapLyr].getCenter(),\r\n },\r\n });\r\n\r\n this.lyrCursor[mapLyr].addFeatures([this.featureLyrCursor[mapLyr]]);\r\n this.lyrCursor[mapLyr].setStyle(this.styleCursor);\r\n this.lyrCursor[mapLyr].setZIndex(5000);\r\n this.mapL[mapLyr].addLayers(this.lyrCursor[mapLyr]);\r\n\r\n this.mapL[mapLyr].getMapImpl().on('pointermove', (event) => {\r\n this.lyrCursor[mapLyr].setVisible(false);\r\n Object.keys(this.featureLyrCursor).forEach(k => {\r\n if (this.mapL[k]) {\r\n this.mapL[k].getMapImpl().setView(this.mapL[mapLyr].getMapImpl().getView());\r\n }\r\n if (k != mapLyr) {\r\n if (this.featureLyrCursor[k] !== null) {\r\n this.lyrCursor[k].setVisible(true);\r\n this.featureLyrCursor[k].setGeometry({\r\n type: 'Point',\r\n coordinates: event.coordinate,\r\n });\r\n }\r\n }\r\n })\r\n });\r\n\r\n }\r\n\r\n /**\r\n * This function is called to remove the effects\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n removeMaps() {\r\n this.mapL['B'] = null;\r\n this.mapL['C'] = null;\r\n this.mapL['D'] = null;\r\n }\r\n\r\n destroyMapsContainer() {\r\n // Remove mirrors containers\r\n document.getElementById(\"mapjsB\").remove();\r\n document.getElementById(\"mapjsC\").remove();\r\n document.getElementById(\"mapjsD\").remove();\r\n\r\n // Take the main map out of the container\r\n const lienzo = document.getElementById(\"lienzo\");\r\n const mapjsA = document.getElementById(\"mapjs\") || document.getElementById(\"map\");\r\n mapjsA.style.display = \"block\";\r\n mapjsA.classList.remove('mirror1');\r\n document.body.insertBefore(mapjsA, lienzo);\r\n\r\n // Load the main container\r\n document.getElementById(\"lienzo\").remove();\r\n }\r\n\r\n /**\r\n * This function compares controls\r\n *\r\n * @public\r\n * @function\r\n * @param {M.Control} control to compare\r\n * @api stable\r\n */\r\n equals(control) {\r\n return control instanceof MirrorpanelControl;\r\n }\r\n}\r\n","/**\r\n * @module M/plugin/Mirrorpanel\r\n */\r\nimport 'assets/css/mirrorpanel';\r\nimport MirrorpanelControl from './mirrorpanelcontrol';\r\nimport api from '../../api';\r\nimport { getValue } from './i18n/language'; //e2m: Multilanguage support\r\n\r\nexport default class Mirrorpanel extends M.Plugin {\r\n /**\r\n * @classdesc\r\n * Main facade plugin object. This class creates a plugin\r\n * object which has an implementation Object\r\n *\r\n * @constructor\r\n * @extends {M.Plugin}\r\n * @param {Object} impl implementation object\r\n * @api stable\r\n */\r\n constructor(options = {}) {\r\n super();\r\n\r\n /**\r\n * Name plugin\r\n * @private\r\n * @type {String}\r\n */\r\n this.name_ = 'mirrorpanel';\r\n\r\n /**\r\n * Facade of the map\r\n * @private\r\n * @type {M.Map}\r\n */\r\n this.map_ = null;\r\n\r\n /**\r\n * Array of controls\r\n * @private\r\n * @type {Array}\r\n */\r\n this.controls_ = [];\r\n\r\n /**\r\n * Class name of the html view Plugin\r\n * @public\r\n * @type {string}\r\n */\r\n this.className = 'm-plugin-mirrorpanel';\r\n\r\n /**\r\n * Position of the Plugin\r\n * @public\r\n * Posible values: TR | TL | BL | BR\r\n * @type {String}\r\n */\r\n const positions = ['TR', 'TL', 'BL', 'BR'];\r\n this.position = positions.includes(options.position) ? options.position : 'TR';\r\n\r\n /**\r\n * Collapsed attribute\r\n * @public\r\n * @type {boolean}\r\n */\r\n this.collapsed = options.collapsed;\r\n if (this.collapsed === undefined) this.collapsed = true;\r\n\r\n /**\r\n * Collapsible attribute\r\n * @public\r\n * @type {boolean}\r\n */\r\n this.collapsible = options.collapsible;\r\n if (this.collapsible === undefined) this.collapsible = true;\r\n\r\n /**\r\n * Modo de visualización\r\n * Value: number in range 0 - 9\r\n * @type {number}\r\n * @public\r\n */\r\n this.modeViz = options.modeViz;\r\n if (this.modeViz === undefined) this.modeViz = 0;\r\n\r\n /**\r\n * Enabled key functions\r\n * @type {boolean}\r\n * @public\r\n */\r\n this.enabledKeyFunctions = options.enabledKeyFunctions;\r\n if (this.enabledKeyFunctions === undefined) this.enabledKeyFunctions = true;\r\n\r\n /**\r\n * Enabled synchro cursors\r\n * @type {boolean}\r\n * @public\r\n */\r\n this.showCursors = options.showCursors;\r\n if (this.showCursors === undefined) this.showCursors = true;\r\n\r\n /**\r\n * Layer names that will have effects\r\n * @public\r\n * Value: the names separated with coma\r\n * @type {string}\r\n */\r\n\r\n this.mirrorLayers = [];\r\n if (options.mirrorLayers !== undefined) {\r\n if (Array.isArray(options.mirrorLayers)) {\r\n this.mirrorLayers = options.mirrorLayers;\r\n } else {\r\n this.mirrorLayers = options.mirrorLayers.split(\",\");\r\n }\r\n }\r\n\r\n /**\r\n * Layer base for the three mirror maps\r\n * @public\r\n * Value: the names separated with coma\r\n * @type {string}\r\n */\r\n\r\n this.defaultBaseLyrs = [];\r\n if (options.defaultBaseLyrs !== undefined) {\r\n if (Array.isArray(options.defaultBaseLyrs)) {\r\n this.defaultBaseLyrs = options.defaultBaseLyrs;\r\n } else {\r\n this.defaultBaseLyrs = options.defaultBaseLyrs.split(\",\");\r\n }\r\n }\r\n\r\n /** \r\n * Show interface\r\n *@public\r\n *@type{boolean}\r\n */\r\n this.interface = options.interface === undefined ? true : options.interface;\r\n\r\n /**\r\n * Enabled layerswitcher control on mirrors \r\n * @type {boolean}\r\n * @public\r\n */\r\n this.showTOC = options.showTOC;\r\n if (this.showTOC === undefined) this.showTOC = true;\r\n\r\n\r\n /**\r\n *@private\r\n *@type { string }\r\n */\r\n this.tooltip_ = options.tooltip || getValue('tooltip');\r\n\r\n\r\n /**\r\n * Metadata from api.json\r\n * @private\r\n * @type {Object}\r\n */\r\n this.metadata_ = api.metadata;\r\n }\r\n\r\n /**\r\n * This function adds this plugin into the map\r\n *\r\n * @public\r\n * @function\r\n * @param {M.Map} map the map to add the plugin\r\n * @api stable\r\n */\r\n addTo(map) {\r\n const pluginOnLeft = !!(['TL', 'BL'].includes(this.position));\r\n\r\n const values = {\r\n pluginOnLeft,\r\n collapsible: this.collapsible,\r\n collapsed: this.collapsed,\r\n modeViz: this.modeViz,\r\n showCursors: this.showCursors,\r\n mirrorLayers: this.mirrorLayers,\r\n defaultBaseLyrs: this.defaultBaseLyrs,\r\n showTOC: this.showTOC\r\n };\r\n\r\n this.control_ = new MirrorpanelControl(values);\r\n this.controls_.push(this.control_);\r\n this.map_ = map;\r\n\r\n this.panel_ = new M.ui.Panel('panelMirrorpanel', {\r\n collapsible: this.collapsible,\r\n collapsed: this.collapsed,\r\n position: M.ui.position[this.position],\r\n modeViz: this.modeViz,\r\n showCursors: this.showCursors,\r\n className: this.interface ? 'm-plugin-panelMirrorpanel' : 'm-plugin-panelMirrorpanel hidden',\r\n collapsedButtonClass: 'mirrorpanel-icon',\r\n tooltip: this.tooltip_,\r\n });\r\n this.panel_.addControls(this.controls_);\r\n map.addPanels(this.panel_);\r\n\r\n // Keybindings for Ctrl + Shift + (F1-F8) / ESC\r\n document.addEventListener('keydown', (zEvent) => {\r\n if (!this.enabledKeyFunctions) {\r\n return;\r\n }\r\n for (let i = 0; i < 10; i++) {\r\n if (zEvent.ctrlKey && zEvent.shiftKey && zEvent.key === \"F\" + (i + 1)) { // case sensitive\r\n this.control_.manageVisionPanelByCSSGrid(i);\r\n }\r\n }\r\n var keyStr = [\"Control\", \"Shift\", \"Alt\", \"Meta\"].includes(zEvent.key) ? \"\" : zEvent.key;\r\n\r\n var combinedKeys = (zEvent.ctrlKey ? \"Control \" : \"\") +\r\n (zEvent.shiftKey ? \"Shift \" : \"\") +\r\n (zEvent.altKey ? \"Alt \" : \"\") +\r\n (zEvent.metaKey ? \"Meta \" : \"\") + keyStr;\r\n if (combinedKeys === \"Escape\") {\r\n this.control_.manageVisionPanelByCSSGrid(0);\r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n /**\r\n * This function destroys this plugin\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n destroy() {\r\n document.removeEventListener('keydown', (zEvent) => { });\r\n this.control_.removeMaps();\r\n this.control_.destroyMapsContainer();\r\n this.map_.removeControls([this.control_]);\r\n [this.control_, this.panel_, this.map_, this.collapsible, this.collapsed, this.modeViz, this.enabledKeyFunctions, this.showCursors, this.mirrorLayers, this.defaultBaseLyrs, this.interface, this.showTOC] = [null, null, null, null, null, null, null, null, null, null, null, null];\r\n }\r\n\r\n /**\r\n * This function gets name plugin\r\n * @getter\r\n * @public\r\n * @returns {string}\r\n * @api stable\r\n */\r\n get name() {\r\n return this.name_;\r\n }\r\n\r\n /**\r\n * This function gets metadata plugin\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n getMetadata() {\r\n return this.metadata_;\r\n }\r\n\r\n /**\r\n * Get the API REST Parameters of the plugin\r\n *\r\n * @function\r\n * @public\r\n * @api\r\n */\r\n getAPIRest() {\r\n return `${this.name}=${this.position}*!${this.collapsed}*!${this.collapsible}*!${this.modeViz}*!${this.enabledKeyFunctions}*!${this.showCursors}*!${this.mirrorLayers}*!${this.defaultBaseLyrs}*!${this.interface}*!${this.showTOC}`;\r\n }\r\n\r\n /**\r\n * Activate plugin\r\n *\r\n * @function\r\n * @public\r\n * @api\r\n */\r\n activate() {\r\n this.control_.activate();\r\n }\r\n\r\n /**\r\n * Desactivate plugin\r\n *\r\n * @function\r\n * @public\r\n * @api\r\n */\r\n deactivate() {\r\n this.control_.deactivate();\r\n }\r\n\r\n\r\n}\r\n","import M$plugin$Mirrorpanel from '/home/irenevinas/m5/mapea-publico/src/plugins/v5/mirrorpanel/src/facade/js/mirrorpanel';\nimport M$control$MirrorpanelControl from '/home/irenevinas/m5/mapea-publico/src/plugins/v5/mirrorpanel/src/facade/js/mirrorpanelcontrol';\nimport M$impl$control$MirrorpanelControl from '/home/irenevinas/m5/mapea-publico/src/plugins/v5/mirrorpanel/src/impl/ol/js/mirrorpanelcontrol';\n\nif (!window.M.plugin) window.M.plugin = {};\nif (!window.M.control) window.M.control = {};\nif (!window.M.impl) window.M.impl = {};\nif (!window.M.impl.control) window.M.impl.control = {};\nwindow.M.plugin.Mirrorpanel = M$plugin$Mirrorpanel;\nwindow.M.control.MirrorpanelControl = M$control$MirrorpanelControl;\nwindow.M.impl.control.MirrorpanelControl = M$impl$control$MirrorpanelControl;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/templates/mirrorpanel.html","webpack:///./src/impl/ol/js/mirrorpanelcontrol.js","webpack:///./src/facade/js/i18n/language.js","webpack:///./src/facade/js/mirrorpanelcontrol.js","webpack:///./src/facade/js/mirrorpanel.js","webpack:///./src/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","MirrorpanelControl","M","impl","Control","map","html","getMapImpl","getInteractions","forEach","interaction","ol","DoubleClickZoom","dblClickInteraction_","translations","en","es","getLang","res","language","getTranslation","lang","getValue","keyPath","translation","utils","isNullOrEmpty","console","warn","split","reduce","prev","current","values","isUndefined","MirrorpanelImplControl","exception","template","modeViz","showCursors","mapL","A","B","C","D","lyrCursor","featureLyrCursor","styleCursor","style","Point","icon","form","CIRCLE","fontsize","radius","rotation","rotate","offset","color","fill","gradientcolor","opacity","defaultBaseLyrs","mirrorLayers","showTOC","createMapContainers","compileSync","string","options","parseToHtml","templateVars","vars","htmlText","Handlebars","compile","templateFn","stringToHtml","this","length","addLayers","getLayers","zindex_","setVisible","addLayerCursor","Promise","success","fail","templateOptions","jsonp","title","getValueTranslate","modViz0","modViz1","modViz2","modViz3","modViz4","modViz5","modViz6","modViz7","modViz8","modViz9","querySelectorAll","button","addEventListener","evt","manageVisionPanelByCSSGrid","bigContainer","document","createElement","id","classList","add","mapjsA","getElementById","body","insertBefore","appendChild","mapjsB","mapjsC","mapjsD","oldModeViz","display","querySelector","remove","includes","createMapObjects","map_","refresh","mapLyr","defLyr","setMap","container","layers","controls","center","getCenter","projection","getProjection","code","units","zoom","getZoom","setView","getView","layer","Vector","displayInLayerSwitcher","Feature","type","properties","geometry","coordinates","addFeatures","setStyle","setZIndex","on","event","keys","k","setGeometry","coordinate","lienzo","control","Mirrorpanel","Plugin","name_","controls_","className","positions","position","collapsed","undefined","collapsible","enabledKeyFunctions","Array","isArray","tooltip_","tooltip","metadata_","api","metadata","pluginOnLeft","control_","push","panel_","ui","Panel","collapsedButtonClass","addControls","addPanels","zEvent","ctrlKey","shiftKey","keyStr","altKey","metaKey","removeEventListener","removeMaps","destroyMapsContainer","removeControls","activate","deactivate","window","plugin","M$plugin$Mirrorpanel","M$control$MirrorpanelControl","M$impl$control$MirrorpanelControl"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM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J,aAA0Kc,KAAKf,gBAA/K,aAAmMe,KAAA,UAAnM,aAAsNA,KAAKb,W,sBAU7N,WACEa,KAAKyG,SAASkB,a,wBAUhB,WACE3H,KAAKyG,SAASmB,kB,gCCjSbC,OAAOxM,EAAEyM,SAAQD,OAAOxM,EAAEyM,OAAS,IACnCD,OAAOxM,EAAEgK,UAASwC,OAAOxM,EAAEgK,QAAU,IACrCwC,OAAOxM,EAAEC,OAAMuM,OAAOxM,EAAEC,KAAO,IAC/BuM,OAAOxM,EAAEC,KAAK+J,UAASwC,OAAOxM,EAAEC,KAAK+J,QAAU,IACpDwC,OAAOxM,EAAEyM,OAAOxC,YAAcyC,EAC9BF,OAAOxM,EAAEgK,QAAQjK,mBAAqB4M,EACtCH,OAAOxM,EAAEC,KAAK+J,QAAQjK,mBAAqB6M","file":"mirrorpanel.ol.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = \"
\\r\\n
{{translations.title}}
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n\";","/**\r\n * @module M/impl/control/MirrorpanelControl\r\n */\r\nexport default class MirrorpanelControl extends M.impl.Control {\r\n /**\r\n * This function adds the control to the specified map\r\n *\r\n * @public\r\n * @function\r\n * @param {M.Map} map to add the plugin\r\n * @param {HTMLElement} html of the plugin\r\n * @api stable\r\n */\r\n addTo(map, html) {\r\n // obtengo la interacción por defecto del dblclick para manejarla\r\n const olMap = map.getMapImpl();\r\n olMap.getInteractions().forEach((interaction) => {\r\n if (interaction instanceof ol.interaction.DoubleClickZoom) {\r\n this.dblClickInteraction_ = interaction;\r\n }\r\n });\r\n super.addTo(map, html);\r\n }\r\n}\r\n","import en from './en';\nimport es from './es';\n\n/**\n * Default object with es and en translate.\n *\n * @const\n * @type {object}\n */\nconst translations = {\n en,\n es,\n};\n\nconst getLang = () => {\n let res = 'es';\n if (typeof M.language.getLang === 'function') {\n res = M.language.getLang();\n }\n\n return res;\n};\n\n/**\n * This function sets a new language translate.\n * @param {string} lang\n * @param {JSON} json\n * @public\n * @api\n */\nexport const addTranslation = (lang, json) => {\n translations[lang] = json;\n};\n\n/**\n * This function gets a language translate.\n *\n * @param {string} lang\n * @return {JSON}\n * @public\n * @api\n */\nexport const getTranslation = (lang) => {\n return translations[lang];\n};\n\n/**\n * This function gets a language value from key\n *\n * @public\n * @param {string}\n * @param {string}\n * @return {string}\n * @public\n * @api\n */\n\nexport const getValue = (keyPath, lang = getLang()) => {\n const translation = getTranslation(lang);\n let value = '';\n if (M.utils.isNullOrEmpty(translation)) {\n /* eslint-disable no-console */\n console.warn(`The translation '${lang}' has not been defined.`);\n } else {\n value = keyPath.split('.').reduce((prev, current) => prev[current], translation);\n }\n\n return value;\n};\n","/**\r\n * @module M/control/MirrorpanelControl\r\n */\r\n\r\nimport MirrorpanelImplControl from 'impl/mirrorpanelcontrol';\r\nimport template from 'templates/mirrorpanel';\r\nimport { getValue as getValueTranslate } from './i18n/language';\r\n\r\nexport default class MirrorpanelControl extends M.Control {\r\n /**\r\n * @classdesc\r\n * Main constructor of the class. Creates a PluginControl\r\n * control\r\n *\r\n * @constructor\r\n * @extends {M.Control}\r\n * @api stable\r\n */\r\n constructor(values) {\r\n // 1. checks if the implementation can create PluginControl\r\n if (M.utils.isUndefined(MirrorpanelImplControl)) {\r\n M.exception('La implementación usada no puede crear controles MirrorpanelControl');\r\n }\r\n // 2. implementation of this control\r\n const impl = new MirrorpanelImplControl();\r\n super(impl, 'Mirrorpanel');\r\n\r\n /**\r\n * Template\r\n * @public\r\n * @type { HTMLElement }\r\n */\r\n this.template = null;\r\n\r\n /**\r\n * Visual mode\r\n * @private\r\n * @type {Number}\r\n */\r\n this.modeViz = values.modeViz;\r\n\r\n /**\r\n * Mirror maps with plugins\r\n * @private\r\n * @type {boolean}\r\n */\r\n this.showCursors = values.showCursors;\r\n\r\n /**\r\n * Defining mirror maps variables\r\n */\r\n this.mapL = { A: null, B: null, C: null, D: null, }\r\n this.lyrCursor = { A: null, B: null, C: null, D: null, }\r\n this.featureLyrCursor = { A: null, B: null, C: null, D: null, }\r\n\r\n /**\r\n * Defining cursor style\r\n */\r\n this.styleCursor = new M.style.Point({\r\n icon: {\r\n form: M.style.form.CIRCLE,\r\n fontsize: 0.5,\r\n radius: 5,\r\n rotation: 0,\r\n rotate: false,\r\n offset: [0, 0],\r\n color: 'black',\r\n fill: 'red',\r\n gradientcolor: '#088A85',\r\n opacity: 0.8\r\n }\r\n });\r\n\r\n /**\r\n * Default layers for mirror maps\r\n * @public\r\n * @public {Array}\r\n */\r\n this.defaultBaseLyrs = values.defaultBaseLyrs;\r\n\r\n /**\r\n * All layers\r\n * @public\r\n * @public {Array}\r\n */\r\n this.mirrorLayers = values.mirrorLayers;\r\n\r\n /**\r\n * Enable layerswitcher control\r\n * @public\r\n * @public {Array}\r\n */\r\n this.showTOC = values.showTOC;\r\n\r\n this.createMapContainers();\r\n }\r\n\r\n\r\n /**\r\n * This function creates the view\r\n *\r\n * @public\r\n * @function\r\n * @param {M.Map} map to add the control\r\n * @api stable\r\n */\r\n createView(map) {\r\n if (!M.template.compileSync) {\r\n M.template.compileSync = (string, options) => {\r\n let templateCompiled;\r\n let templateVars = {};\r\n let parseToHtml;\r\n if (!M.utils.isUndefined(options)) {\r\n templateVars = M.utils.extends(templateVars, options.vars);\r\n parseToHtml = options.parseToHtml;\r\n }\r\n const templateFn = Handlebars.compile(string);\r\n const htmlText = templateFn(templateVars);\r\n if (parseToHtml !== false) {\r\n templateCompiled = M.utils.stringToHtml(htmlText);\r\n } else {\r\n templateCompiled = htmlText;\r\n }\r\n return templateCompiled;\r\n };\r\n }\r\n\r\n this.mapL['A'] = map;\r\n if (this.mirrorLayers.length > 0) {\r\n this.mapL['A'].addLayers(this.mirrorLayers);\r\n this.mapL['A'].getLayers().forEach((l) => {\r\n if (l.zindex_ !== 0) { l.setVisible(false); }\r\n });\r\n }\r\n if (this.showCursors) { this.addLayerCursor('A'); }\r\n return new Promise((success, fail) => {\r\n let templateOptions = '';\r\n templateOptions = {\r\n jsonp: true,\r\n vars: {\r\n translations: {\r\n title: getValueTranslate('title'),\r\n modViz0: getValueTranslate('modViz0'),\r\n modViz1: getValueTranslate('modViz1'),\r\n modViz2: getValueTranslate('modViz2'),\r\n modViz3: getValueTranslate('modViz3'),\r\n modViz4: getValueTranslate('modViz4'),\r\n modViz5: getValueTranslate('modViz5'),\r\n modViz6: getValueTranslate('modViz6'),\r\n modViz7: getValueTranslate('modViz7'),\r\n modViz8: getValueTranslate('modViz8'),\r\n modViz9: getValueTranslate('modViz9')\r\n }\r\n }\r\n };\r\n\r\n this.template = M.template.compileSync(template, templateOptions);\r\n\r\n // Button's click events\r\n this.template.querySelectorAll('button[id^=\"set-mirror-\"]')\r\n .forEach((button, modeViz) => {\r\n button.addEventListener('click', evt => {\r\n this.manageVisionPanelByCSSGrid(modeViz);\r\n })\r\n });\r\n\r\n // Apply default vision\r\n this.manageVisionPanelByCSSGrid(this.modeViz);\r\n success(this.template);\r\n });\r\n\r\n }\r\n\r\n /**\r\n * This function is called on the control activation\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n activate() {\r\n super.activate();\r\n }\r\n /**\r\n * This function is called on the control deactivation\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n deactivate() {\r\n super.deactivate();\r\n }\r\n\r\n /**\r\n * Initial configurations for applying CSS grid.\r\n * \r\n */\r\n createMapContainers() {\r\n const bigContainer = document.createElement('div');\r\n bigContainer.id = \"lienzo\";\r\n bigContainer.classList.add('mirrorpanel-grid');\r\n\r\n const mapjsA = document.getElementById(\"mapjs\") || document.getElementById(\"map\");\r\n document.body.insertBefore(bigContainer, mapjsA);\r\n mapjsA.classList.add('mirror1');\r\n bigContainer.appendChild(mapjsA);\r\n\r\n const mapjsB = document.createElement('div');\r\n mapjsB.id = \"mapjsB\";\r\n mapjsB.classList.add('mirror2');\r\n bigContainer.appendChild(mapjsB);\r\n\r\n const mapjsC = document.createElement('div');\r\n mapjsC.id = \"mapjsC\";\r\n mapjsC.classList.add('mirror3');\r\n bigContainer.appendChild(mapjsC);\r\n\r\n const mapjsD = document.createElement('div');\r\n mapjsD.id = \"mapjsD\";\r\n mapjsD.classList.add('mirror4');\r\n bigContainer.appendChild(mapjsD);\r\n }\r\n\r\n /**\r\n * This function shows/hides panel for differents viz options.\r\n * The mirror maps are launched from here\r\n * \r\n */\r\n manageVisionPanelByCSSGrid(modeViz) {\r\n let oldModeViz = this.modeViz;\r\n let map0 = document.getElementById('mapjs') || document.getElementById('map');\r\n map0.style.display = 'none';\r\n document.getElementById('mapjsB').style.display = 'none';\r\n document.getElementById('mapjsC').style.display = 'none';\r\n document.getElementById('mapjsD').style.display = 'none';\r\n this.template.querySelector('#set-mirror-' + oldModeViz).classList.remove('buttom-pressed');\r\n\r\n for (let i = 0; i < 10; i++) {\r\n document.getElementById('lienzo').classList.remove('modeViz' + i);\r\n }\r\n document.getElementById('lienzo').classList.add('modeViz' + modeViz);\r\n\r\n //Create map objects by modeviz\r\n if ([1, 2].includes(modeViz)) {\r\n if (this.mapL['B'] == null) {\r\n this.createMapObjects('B');//Create MapB\r\n }\r\n }\r\n if ([3, 7, 8, 9].includes(modeViz)) {\r\n if (this.mapL['B'] == null) {\r\n this.createMapObjects('B');//Create MapB\r\n }\r\n if (this.mapL['C'] == null) {\r\n this.createMapObjects('C');//Create MapC\r\n }\r\n }\r\n if ([4, 5, 6].includes(modeViz)) {\r\n if (this.mapL['B'] == null) {\r\n this.createMapObjects('B');//Create MapB\r\n }\r\n if (this.mapL['C'] == null) {\r\n this.createMapObjects('C');//Create MapC\r\n }\r\n if (this.mapL['D'] == null) {\r\n this.createMapObjects('D');//Create MapD\r\n }\r\n }\r\n\r\n this.modeViz = modeViz;\r\n this.template.querySelector('#set-mirror-' + modeViz).classList.add('buttom-pressed');\r\n this.map_.refresh();\r\n if (this.mapL['B'] !== null) { this.mapL['B'].refresh(); }\r\n if (this.mapL['C'] !== null) { this.mapL['C'].refresh(); }\r\n if (this.mapL['D'] !== null) { this.mapL['D'].refresh(); }\r\n }\r\n\r\n /**\r\n * Create mirror map object synchro with the main map\r\n */\r\n createMapObjects(mapLyr) {\r\n let defLyr = null;\r\n switch (mapLyr) {\r\n case 'B':\r\n if (this.defaultBaseLyrs[1]) defLyr = this.defaultBaseLyrs[0];\r\n break;\r\n case 'C':\r\n if (this.defaultBaseLyrs[2]) defLyr = this.defaultBaseLyrs[1];\r\n break;\r\n case 'D':\r\n if (this.defaultBaseLyrs[3]) defLyr = this.defaultBaseLyrs[2];\r\n break;\r\n default:\r\n defLyr = this.map_.getLayers()[0].setMap(this);\r\n break;\r\n }\r\n this.mapL[mapLyr] = M.map({\r\n container: 'mapjs' + mapLyr,\r\n layers: defLyr,\r\n controls: this.showTOC ? ['layerswitcher'] : '',\r\n center: this.map_.getCenter(),\r\n projection: this.map_.getProjection().code + '*' + this.map_.getProjection().units,\r\n zoom: this.map_.getZoom(),\r\n });\r\n this.mapL[mapLyr].getMapImpl().setView(this.map_.getMapImpl().getView());\r\n\r\n if (this.showCursors) { this.addLayerCursor(mapLyr); }\r\n if (this.mirrorLayers.length > 0) {\r\n this.mapL[mapLyr].addLayers(this.mirrorLayers);\r\n this.mapL[mapLyr].getLayers().forEach((l) => {\r\n if (l.zindex_ !== 0) { l.setVisible(false); }\r\n });\r\n }\r\n this.mapL[mapLyr].refresh();\r\n }\r\n\r\n /**\r\n * Adding a layer for cursor on Map\r\n */\r\n addLayerCursor(mapLyr) {\r\n // Cursor Layer\r\n this.lyrCursor[mapLyr] = new M.layer.Vector({\r\n name: 'Coordenadas centro ' + mapLyr,\r\n }, { displayInLayerSwitcher: false });\r\n\r\n this.featureLyrCursor[mapLyr] = new M.Feature('Center' + mapLyr, {\r\n type: 'Feature',\r\n properties: {},\r\n geometry: {\r\n type: 'Point',\r\n coordinates: this.mapL[mapLyr].getCenter(),\r\n },\r\n });\r\n\r\n this.lyrCursor[mapLyr].addFeatures([this.featureLyrCursor[mapLyr]]);\r\n this.lyrCursor[mapLyr].setStyle(this.styleCursor);\r\n this.lyrCursor[mapLyr].setZIndex(5000);\r\n this.mapL[mapLyr].addLayers(this.lyrCursor[mapLyr]);\r\n\r\n this.mapL[mapLyr].getMapImpl().on('pointermove', (event) => {\r\n this.lyrCursor[mapLyr].setVisible(false);\r\n Object.keys(this.featureLyrCursor).forEach(k => {\r\n if (this.mapL[k]) {\r\n this.mapL[k].getMapImpl().setView(this.mapL[mapLyr].getMapImpl().getView());\r\n }\r\n if (k != mapLyr) {\r\n if (this.featureLyrCursor[k] !== null) {\r\n this.lyrCursor[k].setVisible(true);\r\n this.featureLyrCursor[k].setGeometry({\r\n type: 'Point',\r\n coordinates: event.coordinate,\r\n });\r\n }\r\n }\r\n })\r\n });\r\n\r\n }\r\n\r\n /**\r\n * This function is called to remove the effects\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n removeMaps() {\r\n this.mapL['B'] = null;\r\n this.mapL['C'] = null;\r\n this.mapL['D'] = null;\r\n }\r\n\r\n destroyMapsContainer() {\r\n // Remove mirrors containers\r\n document.getElementById(\"mapjsB\").remove();\r\n document.getElementById(\"mapjsC\").remove();\r\n document.getElementById(\"mapjsD\").remove();\r\n\r\n // Take the main map out of the container\r\n const lienzo = document.getElementById(\"lienzo\");\r\n const mapjsA = document.getElementById(\"mapjs\") || document.getElementById(\"map\");\r\n mapjsA.style.display = \"block\";\r\n mapjsA.classList.remove('mirror1');\r\n document.body.insertBefore(mapjsA, lienzo);\r\n\r\n // Load the main container\r\n document.getElementById(\"lienzo\").remove();\r\n }\r\n\r\n /**\r\n * This function compares controls\r\n *\r\n * @public\r\n * @function\r\n * @param {M.Control} control to compare\r\n * @api stable\r\n */\r\n equals(control) {\r\n return control instanceof MirrorpanelControl;\r\n }\r\n}\r\n","/**\r\n * @module M/plugin/Mirrorpanel\r\n */\r\nimport 'assets/css/mirrorpanel';\r\nimport MirrorpanelControl from './mirrorpanelcontrol';\r\nimport api from '../../api';\r\nimport { getValue } from './i18n/language'; //e2m: Multilanguage support\r\n\r\nexport default class Mirrorpanel extends M.Plugin {\r\n /**\r\n * @classdesc\r\n * Main facade plugin object. This class creates a plugin\r\n * object which has an implementation Object\r\n *\r\n * @constructor\r\n * @extends {M.Plugin}\r\n * @param {Object} impl implementation object\r\n * @api stable\r\n */\r\n constructor(options = {}) {\r\n super();\r\n\r\n /**\r\n * Name plugin\r\n * @private\r\n * @type {String}\r\n */\r\n this.name_ = 'mirrorpanel';\r\n\r\n /**\r\n * Facade of the map\r\n * @private\r\n * @type {M.Map}\r\n */\r\n this.map_ = null;\r\n\r\n /**\r\n * Array of controls\r\n * @private\r\n * @type {Array}\r\n */\r\n this.controls_ = [];\r\n\r\n /**\r\n * Class name of the html view Plugin\r\n * @public\r\n * @type {string}\r\n */\r\n this.className = 'm-plugin-mirrorpanel';\r\n\r\n /**\r\n * Position of the Plugin\r\n * @public\r\n * Posible values: TR | TL | BL | BR\r\n * @type {String}\r\n */\r\n const positions = ['TR', 'TL', 'BL', 'BR'];\r\n this.position = positions.includes(options.position) ? options.position : 'TR';\r\n\r\n /**\r\n * Collapsed attribute\r\n * @public\r\n * @type {boolean}\r\n */\r\n this.collapsed = options.collapsed;\r\n if (this.collapsed === undefined) this.collapsed = true;\r\n\r\n /**\r\n * Collapsible attribute\r\n * @public\r\n * @type {boolean}\r\n */\r\n this.collapsible = options.collapsible;\r\n if (this.collapsible === undefined) this.collapsible = true;\r\n\r\n /**\r\n * Modo de visualización\r\n * Value: number in range 0 - 9\r\n * @type {number}\r\n * @public\r\n */\r\n this.modeViz = options.modeViz;\r\n if (this.modeViz === undefined) this.modeViz = 0;\r\n\r\n /**\r\n * Enabled key functions\r\n * @type {boolean}\r\n * @public\r\n */\r\n this.enabledKeyFunctions = options.enabledKeyFunctions;\r\n if (this.enabledKeyFunctions === undefined) this.enabledKeyFunctions = true;\r\n\r\n /**\r\n * Enabled synchro cursors\r\n * @type {boolean}\r\n * @public\r\n */\r\n this.showCursors = options.showCursors;\r\n if (this.showCursors === undefined) this.showCursors = true;\r\n\r\n /**\r\n * Layer names that will have effects\r\n * @public\r\n * Value: the names separated with coma\r\n * @type {string}\r\n */\r\n\r\n this.mirrorLayers = [];\r\n if (options.mirrorLayers !== undefined) {\r\n if (Array.isArray(options.mirrorLayers)) {\r\n this.mirrorLayers = options.mirrorLayers;\r\n } else {\r\n this.mirrorLayers = options.mirrorLayers.split(\",\");\r\n }\r\n }\r\n\r\n /**\r\n * Layer base for the three mirror maps\r\n * @public\r\n * Value: the names separated with coma\r\n * @type {string}\r\n */\r\n\r\n this.defaultBaseLyrs = [];\r\n if (options.defaultBaseLyrs !== undefined) {\r\n if (Array.isArray(options.defaultBaseLyrs)) {\r\n this.defaultBaseLyrs = options.defaultBaseLyrs;\r\n } else {\r\n this.defaultBaseLyrs = options.defaultBaseLyrs.split(\",\");\r\n }\r\n }\r\n\r\n /** \r\n * Show interface\r\n *@public\r\n *@type{boolean}\r\n */\r\n this.interface = options.interface === undefined ? true : options.interface;\r\n\r\n /**\r\n * Enabled layerswitcher control on mirrors \r\n * @type {boolean}\r\n * @public\r\n */\r\n this.showTOC = options.showTOC;\r\n if (this.showTOC === undefined) this.showTOC = true;\r\n\r\n\r\n /**\r\n *@private\r\n *@type { string }\r\n */\r\n this.tooltip_ = options.tooltip || getValue('tooltip');\r\n\r\n\r\n /**\r\n * Metadata from api.json\r\n * @private\r\n * @type {Object}\r\n */\r\n this.metadata_ = api.metadata;\r\n }\r\n\r\n /**\r\n * This function adds this plugin into the map\r\n *\r\n * @public\r\n * @function\r\n * @param {M.Map} map the map to add the plugin\r\n * @api stable\r\n */\r\n addTo(map) {\r\n const pluginOnLeft = !!(['TL', 'BL'].includes(this.position));\r\n\r\n const values = {\r\n pluginOnLeft,\r\n collapsible: this.collapsible,\r\n collapsed: this.collapsed,\r\n modeViz: this.modeViz,\r\n showCursors: this.showCursors,\r\n mirrorLayers: this.mirrorLayers,\r\n defaultBaseLyrs: this.defaultBaseLyrs,\r\n showTOC: this.showTOC\r\n };\r\n\r\n this.control_ = new MirrorpanelControl(values);\r\n this.controls_.push(this.control_);\r\n this.map_ = map;\r\n\r\n this.panel_ = new M.ui.Panel('panelMirrorpanel', {\r\n collapsible: this.collapsible,\r\n collapsed: this.collapsed,\r\n position: M.ui.position[this.position],\r\n modeViz: this.modeViz,\r\n showCursors: this.showCursors,\r\n className: this.interface ? 'm-plugin-panelMirrorpanel' : 'm-plugin-panelMirrorpanel hidden',\r\n collapsedButtonClass: 'mirrorpanel-icon',\r\n tooltip: this.tooltip_,\r\n });\r\n this.panel_.addControls(this.controls_);\r\n map.addPanels(this.panel_);\r\n\r\n // Keybindings for Ctrl + Shift + (F1-F8) / ESC\r\n document.addEventListener('keydown', (zEvent) => {\r\n if (!this.enabledKeyFunctions) {\r\n return;\r\n }\r\n for (let i = 0; i < 10; i++) {\r\n if (zEvent.ctrlKey && zEvent.shiftKey && zEvent.key === \"F\" + (i + 1)) { // case sensitive\r\n this.control_.manageVisionPanelByCSSGrid(i);\r\n }\r\n }\r\n var keyStr = [\"Control\", \"Shift\", \"Alt\", \"Meta\"].includes(zEvent.key) ? \"\" : zEvent.key;\r\n\r\n var combinedKeys = (zEvent.ctrlKey ? \"Control \" : \"\") +\r\n (zEvent.shiftKey ? \"Shift \" : \"\") +\r\n (zEvent.altKey ? \"Alt \" : \"\") +\r\n (zEvent.metaKey ? \"Meta \" : \"\") + keyStr;\r\n if (combinedKeys === \"Escape\") {\r\n this.control_.manageVisionPanelByCSSGrid(0);\r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n /**\r\n * This function destroys this plugin\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n destroy() {\r\n document.removeEventListener('keydown', (zEvent) => { });\r\n this.control_.removeMaps();\r\n this.control_.destroyMapsContainer();\r\n this.map_.removeControls([this.control_]);\r\n [this.control_, this.panel_, this.map_, this.collapsible, this.collapsed, this.modeViz, this.enabledKeyFunctions, this.showCursors, this.mirrorLayers, this.defaultBaseLyrs, this.interface, this.showTOC] = [null, null, null, null, null, null, null, null, null, null, null, null];\r\n }\r\n\r\n /**\r\n * This function gets name plugin\r\n * @getter\r\n * @public\r\n * @returns {string}\r\n * @api stable\r\n */\r\n get name() {\r\n return this.name_;\r\n }\r\n\r\n /**\r\n * This function gets metadata plugin\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n getMetadata() {\r\n return this.metadata_;\r\n }\r\n\r\n /**\r\n * Get the API REST Parameters of the plugin\r\n *\r\n * @function\r\n * @public\r\n * @api\r\n */\r\n getAPIRest() {\r\n return `${this.name}=${this.position}*!${this.collapsed}*!${this.collapsible}*!${this.modeViz}*!${this.enabledKeyFunctions}*!${this.showCursors}*!${this.mirrorLayers}*!${this.defaultBaseLyrs}*!${this.interface}*!${this.showTOC}`;\r\n }\r\n\r\n /**\r\n * Activate plugin\r\n *\r\n * @function\r\n * @public\r\n * @api\r\n */\r\n activate() {\r\n this.control_.activate();\r\n }\r\n\r\n /**\r\n * Desactivate plugin\r\n *\r\n * @function\r\n * @public\r\n * @api\r\n */\r\n deactivate() {\r\n this.control_.deactivate();\r\n }\r\n\r\n\r\n}\r\n","import M$plugin$Mirrorpanel from '/home/fbmanas/Documentos/git-sigc/mirrorpanel/src/facade/js/mirrorpanel';\nimport M$control$MirrorpanelControl from '/home/fbmanas/Documentos/git-sigc/mirrorpanel/src/facade/js/mirrorpanelcontrol';\nimport M$impl$control$MirrorpanelControl from '/home/fbmanas/Documentos/git-sigc/mirrorpanel/src/impl/ol/js/mirrorpanelcontrol';\n\nif (!window.M.plugin) window.M.plugin = {};\nif (!window.M.control) window.M.control = {};\nif (!window.M.impl) window.M.impl = {};\nif (!window.M.impl.control) window.M.impl.control = {};\nwindow.M.plugin.Mirrorpanel = M$plugin$Mirrorpanel;\nwindow.M.control.MirrorpanelControl = M$control$MirrorpanelControl;\nwindow.M.impl.control.MirrorpanelControl = M$impl$control$MirrorpanelControl;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index c0c4932..11998d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Mirrorpanel", - "version": "1.0.0", + "version": "1.0.1", "description": "", "keywords": [ "map", diff --git a/src/api.json b/src/api.json index 53c0a1a..2f6a182 100644 --- a/src/api.json +++ b/src/api.json @@ -80,12 +80,13 @@ "name": "Mirrorpanel", "description": "Plugin que permite comparar varias capas dividiendo la pantalla en varias partes.", "text": "Plugin que permite comparar varias capas dividiendo la pantalla en varias partes. Los mapas tienen sus vistas sincronizadas, y podemos ver la representación de una misma zona por distintas capas.", - "version": "1.0.0", - "date": "Julio, 2020", + "version": "1.0.1", + "date": "Abril, 2021", "author": "", "org": "", "tags": "mapea,plugin", "icon": "./facade/assets/icons/icons.svg", + "compatibility":["5","6"], "buttons": [ { "title": "", diff --git a/test/dev.html b/test/dev.html index a08c477..f4500d6 100644 --- a/test/dev.html +++ b/test/dev.html @@ -7,7 +7,7 @@ Mirrorpanel TEST - +