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 3a2f792..bb9d77a 100644 --- a/dist/api.json +++ b/dist/api.json @@ -44,12 +44,13 @@ "name": "Transparency", "description": "Efecto transparencia sobre capa", "text": "Plugin que permite realizar un efecto de transparencia sobre una capa. En caso de indicar varias capas, se realizará el efecto sobre la capa seleccionada en el selector. ", - "version": "1.0.0", - "date": "Junio, 2020", + "version": "1.0.1", + "date": "Mayo, 2021", "author": "", "org": "Consejería de Hacienda, Industria y Energía. Junta de Andalucía.", "tags": "mapea,plugin", "icon": "./facade/assets/icons/icons.svg", - "centralized": true + "centralized": true, + "compatibility": ["5","6"] } } diff --git a/dist/transparency.ol.min.js b/dist/transparency.ol.min.js index e21a0a1..5603e27 100644 --- a/dist/transparency.ol.min.js +++ b/dist/transparency.ol.min.js @@ -1,2 +1,2 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e){e.exports=JSON.parse('{"url":{"name":"transparency","separator":"*!"},"constructor":"M.plugin.Transparency","parameters":[{"type":"object","properties":[{"type":"simple","name":"position","possibleValues":["TL","TR","BL","BR"],"position":0},{"type":"simple","name":"layers","position":1},{"type":"simple","name":"radius","position":2},{"type":"boolean","name":"border","position":3},{"type":"simple","name":"borderColor","position":4}]}],"files":{"ol":{"scripts":["transparency.ol.min.js"],"styles":["transparency.ol.min.css"]}},"metadata":{"name":"Transparency","description":"Efecto transparencia sobre capa","text":"Plugin que permite realizar un efecto de transparencia sobre una capa. En caso de indicar varias capas, se realizará el efecto sobre la capa seleccionada en el selector. ","version":"1.0.0","date":"Junio, 2020","author":"","org":"Consejería de Hacienda, Industria y Energía. Junta de Andalucía.","tags":"mapea,plugin","icon":"./facade/assets/icons/icons.svg","centralized":true}}')},function(e,t){e.exports='
\r\n
{{translations.transparency}}
\r\n
\r\n
\r\n \r\n
\r\n
\r\n

{{translations.radius}}:

\r\n \r\n
\r\n {{#if options}}\r\n
\r\n

{{translations.layers}}:

\r\n \r\n
\r\n
\r\n
\r\n {{/if}}\r\n
\r\n
'},function(e){e.exports=JSON.parse('{"tooltip":"Transparency","layers":"Layers","radius":"Radius","transparency":"Transparency","errorLayer":"Transparency: No valid layer specified on which to apply the effect","excepcion":"The implementation used cannot create TransparencyControl controls"}')},function(e){e.exports=JSON.parse('{"tooltip":"Transparencia","layers":"Capas","radius":"Radio","transparency":"Transparencia","errorLayer":"Transparency: No se ha especificado una capa válida sobre la que aplicar el efecto","excepcion":"La implementación usada no puede crear controles TransparencyControl"}')},function(e,t,r){},function(e,t,r){"use strict";r.r(t);r(4);function n(e){return(n="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 o(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:_(),r=O(t),n="";return M.utils.isNullOrEmpty(r)?console.warn("The translation '".concat(t,"' has not been defined.")):n=e.split(".").reduce((function(e,t){return e[t]}),r),n};function w(e){return(w="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 L(e,t){for(var r=0;r=1&&(o.vars.options=n),t.template=M.template.compileSync(v.a,o),t.template.querySelector("#input-transparent-radius").value=t.radius,t.template.querySelector("#input-transparent-radius").addEventListener("change",(function(e){t.radius=Number(e.target.value),t.getImpl().setRadius(t.radius)})),0==t.layers.length||""==t.layers?M.dialog.error(S("errorLayer")):(t.template.querySelector("#m-transparency-transparent").addEventListener("click",(function(e){0==document.getElementsByClassName("buttom-pressed").length?t.activate():t.deactivate()})),""!==o&&(t.template.querySelector("select").disabled=!0,t.template.querySelector("input").disabled=!0,t.template.querySelector("select").addEventListener("change",(function(e){t.layerSelected.setVisible(!1),t.removeEffects();var r=t.layers.filter((function(t){return t.name===e.target.value}));t.layerSelected=r[0],t.getImpl().effectSelected({layers:t.layerSelected,radius:t.radius,border:t.border,borderColor:t.borderColor})})))),e(t.template)}))}},{key:"activate",value:function(){null===this.layerSelected&&(this.layerSelected=this.layers[0]);var e=this.layers.map((function(e){return e instanceof Object?{name:e.name}:{name:e}}));this.template.querySelector("#m-transparency-transparent").classList.add("buttom-pressed"),this.getImpl().effectSelected({layers:this.layerSelected,radius:this.radius,border:this.border,borderColor:this.borderColor}),e.length>=1&&(this.template.querySelector("select").disabled=!1,this.template.querySelector("input").disabled=!1)}},{key:"deactivate",value:function(){null===this.layerSelected&&(this.layerSelected=this.layers[0]);var e=this.layers.map((function(e){return e instanceof Object?{name:e.name}:{name:e}}));this.template.querySelector("#m-transparency-transparent").classList.remove("buttom-pressed"),this.removeEffects(),this.layerSelected.setVisible(!1),e.length>=1&&(this.template.querySelector("select").disabled=!0,this.template.querySelector("input").disabled=!0)}},{key:"removeEffects",value:function(){this.getImpl().removeEffects()}},{key:"removeTransparencyLayers",value:function(e){var t=this;e.forEach((function(e){if(e instanceof Object){if(e instanceof Object){var r=t.map.getLayers().filter((function(t){return e.name.includes(t.name)}))[0];t.map.removeLayers(r)}}else if(e.indexOf("*")>=0){var n=e.split("*")[3],o=t.map.getLayers().filter((function(e){return n.includes(e.name)}))[0];t.map.removeLayers(o)}else{var a=t.map.getLayers().filter((function(t){return e.includes(t.name)}))[0];t.map.removeLayers(a)}}))}},{key:"transformToLayers",value:function(e){var t=e.map((function(e){var t=null;if(e instanceof Object){if(e instanceof Object){var r=this.map.getLayers().filter((function(t){return e.name.includes(t.name)}))[0];t=this.isValidLayer(r)?r:null}}else if(e.indexOf("*")>=0){var n=e.split("*");"WMS"==n[0].toUpperCase()?(t=new M.layer.WMS({url:n[2],name:n[3]}),this.map.addLayers(t)):"WMTS"==n[0].toUpperCase()&&(t=new M.layer.WMTS({url:n[1],name:n[2],matrixSet:n[3]}),this.map.addLayers(t))}else{var o=this.map.getLayers().filter((function(t){return e.includes(t.name)}))[0];t=this.isValidLayer(o)?o:null}if(null!==t)return t.displayInLayerSwitcher=!1,t.setVisible(!1),t;this.layers.remove(e)}),this);return void 0===t[0]?[]:t}},{key:"isValidLayer",value:function(e){return"WMTS"===e.type||"WMS"===e.type}},{key:"equals",value:function(e){return e instanceof t}},{key:"getLayersNames",value:function(){return this.layers.map((function(e){return e.name}))}}])&&L(r.prototype,n),o&&L(r,o),t}(),C=r(0);function E(e){return(E="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 x(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=I(this,R(t).call(this))).name_="transparency",e.map_=null,e.controls_=[],e.className="m-plugin-transparency";return e.position=["TR","TL","BL","BR"].includes(r.position)?r.position:"TR",void 0===r.layers||""===r.layers?(M.dialog.error(S("errorLayer")),e.layers=[]):Array.isArray(r.layers)?e.layers=r.layers:e.layers=r.layers.split(","),isNaN(parseInt(r.radius))?e.radius=100:r.radius>=30&&r.radius<=200?e.radius=parseInt(r.radius):r.radius>200?e.radius=200:r.radius<30&&(e.radius=30),e.border=r.border,void 0===e.border&&(e.border=!0),e.borderColor=r.borderColor||"white",e.metadata_=C.metadata,e.separatorApiJson=C.url.separator,e.tooltip_=r.tooltip||S("tooltip"),e}var r,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}(t,M.Plugin),r=t,(n=[{key:"addTo",value:function(e){var t={pluginOnLeft:!!["TL","BL"].includes(this.position),layers:this.layers,radius:this.radius,border:this.border,borderColor:this.borderColor};this.control_=new k(t),this.controls_.push(this.control_),this.map_=e,this.panel_=new M.ui.Panel("panelTransparency",{collapsible:!0,position:M.ui.position[this.position],className:this.className,collapsedButtonClass:"g-cartografia-gps4",tooltip:this.tooltip_}),this.panel_.addControls(this.controls_),e.addPanels(this.panel_)}},{key:"destroy",value:function(){this.control_.removeEffects(),this.control_.removeTransparencyLayers(this.control_.getLayersNames()),this.map_.removeControls([this.control_]);var e=[null,null,null,null,null,null,null];this.control_=e[0],this.panel_=e[1],this.map_=e[2],this.layers=e[3],this.radius=e[4],this.border=e[5],this.borderColor=e[6]}},{key:"getMetadata",value:function(){return this.metadata_}},{key:"getAPIRest",value:function(){var e=this.control_.getLayersNames();return"".concat(this.name,"=").concat(this.position).concat(this.separatorApiJson).concat(e.join(",")).concat(this.separatorApiJson).concat(this.radius).concat(this.separatorApiJson).concat(this.border).concat(this.separatorApiJson).concat(this.borderColor)}},{key:"activate",value:function(){this.control_.activate()}},{key:"deactivate",value:function(){this.control_.deactivate()}},{key:"equals",value:function(e){return e instanceof t}},{key:"name",get:function(){return this.name_}}])&&x(r.prototype,n),o&&x(r,o),t}();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.Transparency=N,window.M.control.TransparencyControl=k,window.M.impl.control.TransparentInteraction=c,window.M.impl.control.TransparencyControl=h}]); +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e){e.exports=JSON.parse('{"url":{"name":"transparency","separator":"*!"},"constructor":"M.plugin.Transparency","parameters":[{"type":"object","properties":[{"type":"simple","name":"position","possibleValues":["TL","TR","BL","BR"],"position":0},{"type":"simple","name":"layers","position":1},{"type":"simple","name":"radius","position":2},{"type":"boolean","name":"border","position":3},{"type":"simple","name":"borderColor","position":4}]}],"files":{"ol":{"scripts":["transparency.ol.min.js"],"styles":["transparency.ol.min.css"]}},"metadata":{"name":"Transparency","description":"Efecto transparencia sobre capa","text":"Plugin que permite realizar un efecto de transparencia sobre una capa. En caso de indicar varias capas, se realizará el efecto sobre la capa seleccionada en el selector. ","version":"1.0.1","date":"Mayo, 2021","author":"","org":"Consejería de Hacienda, Industria y Energía. Junta de Andalucía.","tags":"mapea,plugin","icon":"./facade/assets/icons/icons.svg","centralized":true,"compatibility":["5","6"]}}')},function(e,t){e.exports='
\r\n
{{translations.transparency}}
\r\n
\r\n
\r\n \r\n
\r\n
\r\n

{{translations.radius}}:

\r\n \r\n
\r\n {{#if options}}\r\n
\r\n

{{translations.layers}}:

\r\n \r\n
\r\n
\r\n
\r\n {{/if}}\r\n
\r\n
'},function(e){e.exports=JSON.parse('{"tooltip":"Transparency","layers":"Layers","radius":"Radius","transparency":"Transparency","errorLayer":"Transparency: No valid layer specified on which to apply the effect","excepcion":"The implementation used cannot create TransparencyControl controls"}')},function(e){e.exports=JSON.parse('{"tooltip":"Transparencia","layers":"Capas","radius":"Radio","transparency":"Transparencia","errorLayer":"Transparency: No se ha especificado una capa válida sobre la que aplicar el efecto","excepcion":"La implementación usada no puede crear controles TransparencyControl"}')},function(e,t,r){},function(e,t,r){"use strict";r.r(t);r(4);function n(e){return(n="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 o(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:L(),r=j(t),n="";return M.utils.isNullOrEmpty(r)?console.warn("The translation '".concat(t,"' has not been defined.")):n=e.split(".").reduce((function(e,t){return e[t]}),r),n};function T(e){return(T="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 R(e,t){for(var r=0;r=1&&(o.vars.options=n),t.template=M.template.compileSync(S.a,o),t.template.querySelector("#input-transparent-radius").value=t.radius,t.template.querySelector("#input-transparent-radius").addEventListener("change",(function(e){t.radius=Number(e.target.value),t.getImpl().setRadius(t.radius)})),0==t.layers.length||""==t.layers?M.dialog.error(P("errorLayer")):(t.template.querySelector("#m-transparency-transparent").addEventListener("click",(function(e){0==document.getElementsByClassName("buttom-pressed").length?t.activate():t.deactivate()})),""!==o&&(t.template.querySelector("select").disabled=!0,t.template.querySelector("input").disabled=!0,t.template.querySelector("select").addEventListener("change",(function(e){t.layerSelected.setVisible(!1),t.removeEffects();var r=t.layers.filter((function(t){return t.name===e.target.value}));t.layerSelected=r[0],t.getImpl().effectSelected({layers:t.layerSelected,radius:t.radius,border:t.border,borderColor:t.borderColor})})))),e(t.template)}))}},{key:"activate",value:function(){null===this.layerSelected&&(this.layerSelected=this.layers[0]);var e=this.layers.map((function(e){return e instanceof Object?{name:e.name}:{name:e}}));this.template.querySelector("#m-transparency-transparent").classList.add("buttom-pressed"),this.getImpl().effectSelected({layers:this.layerSelected,radius:this.radius,border:this.border,borderColor:this.borderColor}),e.length>=1&&(this.template.querySelector("select").disabled=!1,this.template.querySelector("input").disabled=!1)}},{key:"deactivate",value:function(){null===this.layerSelected&&(this.layerSelected=this.layers[0]);var e=this.layers.map((function(e){return e instanceof Object?{name:e.name}:{name:e}}));this.template.querySelector("#m-transparency-transparent").classList.remove("buttom-pressed"),this.removeEffects(),this.layerSelected.setVisible(!1),e.length>=1&&(this.template.querySelector("select").disabled=!0,this.template.querySelector("input").disabled=!0)}},{key:"removeEffects",value:function(){this.getImpl().removeEffects()}},{key:"removeTransparencyLayers",value:function(e){var t=this;e.forEach((function(e){if(e instanceof Object){if(e instanceof Object){var r=t.map.getLayers().filter((function(t){return e.name.includes(t.name)}))[0];t.map.removeLayers(r)}}else if(e.indexOf("*")>=0){var n=e.split("*")[3],o=t.map.getLayers().filter((function(e){return n.includes(e.name)}))[0];t.map.removeLayers(o)}else{var a=t.map.getLayers().filter((function(t){return e.includes(t.name)}))[0];t.map.removeLayers(a)}}))}},{key:"transformToLayers",value:function(e){var t=e.map((function(e){var t=null;if(e instanceof Object){if(e instanceof Object){var r=this.map.getLayers().filter((function(t){return e.name.includes(t.name)}))[0];t=this.isValidLayer(r)?r:null}}else if(e.indexOf("*")>=0){var n=e.split("*");"WMS"==n[0].toUpperCase()?(t=new M.layer.WMS({url:n[2],name:n[3]}),this.map.addLayers(t)):"WMTS"==n[0].toUpperCase()&&(t=new M.layer.WMTS({url:n[1],name:n[2],matrixSet:n[3]}),this.map.addLayers(t))}else{var o=this.map.getLayers().filter((function(t){return e.includes(t.name)}))[0];t=this.isValidLayer(o)?o:null}if(null!==t)return t.displayInLayerSwitcher=!1,t.setVisible(!1),t;this.layers.remove(e)}),this);return void 0===t[0]?[]:t}},{key:"isValidLayer",value:function(e){return"WMTS"===e.type||"WMS"===e.type}},{key:"equals",value:function(e){return e instanceof a}},{key:"getLayersNames",value:function(){return this.layers.map((function(e){return e.name}))}}])&&R(t.prototype,r),n&&R(t,n),a}(),q=r(0);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 N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};N(this,a),(e=o.call(this)).name_="transparency",e.map_=null,e.controls_=[],e.className="m-plugin-transparency";var r=["TR","TL","BL","BR"];return e.position=r.includes(t.position)?t.position:"TR",void 0===t.layers||""===t.layers?(M.dialog.error(P("errorLayer")),e.layers=[]):Array.isArray(t.layers)?e.layers=t.layers:e.layers=t.layers.split(","),isNaN(parseInt(t.radius))?e.radius=100:t.radius>=30&&t.radius<=200?e.radius=parseInt(t.radius):t.radius>200?e.radius=200:t.radius<30&&(e.radius=30),e.border=t.border,void 0===e.border&&(e.border=!0),e.borderColor=t.borderColor||"white",e.metadata_=q.metadata,e.separatorApiJson=q.url.separator,e.tooltip_=t.tooltip||P("tooltip"),e}return t=a,(r=[{key:"addTo",value:function(e){var t={pluginOnLeft:!!["TL","BL"].includes(this.position),layers:this.layers,radius:this.radius,border:this.border,borderColor:this.borderColor};this.control_=new I(t),this.controls_.push(this.control_),this.map_=e,this.panel_=new M.ui.Panel("panelTransparency",{collapsible:!0,position:M.ui.position[this.position],className:this.className,collapsedButtonClass:"g-cartografia-gps4",tooltip:this.tooltip_}),this.panel_.addControls(this.controls_),e.addPanels(this.panel_)}},{key:"destroy",value:function(){this.control_.removeEffects(),this.control_.removeTransparencyLayers(this.control_.getLayersNames()),this.map_.removeControls([this.control_]);var e=[null,null,null,null,null,null,null];this.control_=e[0],this.panel_=e[1],this.map_=e[2],this.layers=e[3],this.radius=e[4],this.border=e[5],this.borderColor=e[6]}},{key:"name",get:function(){return this.name_}},{key:"getMetadata",value:function(){return this.metadata_}},{key:"getAPIRest",value:function(){var e=this.control_.getLayersNames();return"".concat(this.name,"=").concat(this.position).concat(this.separatorApiJson).concat(e.join(",")).concat(this.separatorApiJson).concat(this.radius).concat(this.separatorApiJson).concat(this.border).concat(this.separatorApiJson).concat(this.borderColor)}},{key:"activate",value:function(){this.control_.activate()}},{key:"deactivate",value:function(){this.control_.deactivate()}},{key:"equals",value:function(e){return e instanceof a}}])&&A(t.prototype,r),n&&A(t,n),a}();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.Transparency=K,window.M.control.TransparencyControl=I,window.M.impl.control.TransparentInteraction=p,window.M.impl.control.TransparencyControl=_}]); //# sourceMappingURL=transparency.ol.min.js.map \ No newline at end of file diff --git a/dist/transparency.ol.min.js.map b/dist/transparency.ol.min.js.map index 66d3ddb..6ca525d 100644 --- a/dist/transparency.ol.min.js.map +++ b/dist/transparency.ol.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/templates/transparency.html","webpack:///./src/impl/ol/js/TransparentInteraction.js","webpack:///./src/impl/ol/js/transparencycontrol.js","webpack:///./src/facade/js/i18n/language.js","webpack:///./src/facade/js/transparencycontrol.js","webpack:///./src/facade/js/transparency.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","TransparentInteraction","options","layers_","ol","interaction","Pointer","handleDownEvent","setPosition","handleMoveEvent","optionsE","pos","radius","border","borderColor","layers","layer","map","getImpl","getOL3Layer","filter","addLayer","this","getMap","length","precompose","Observable","unByKey","postcompose","renderSync","setMap","on","precompose_","postcompose_","Array","push","k","splice","e","pixel","ctx","context","ratio","frameState","pixelRatio","save","beginPath","arc","Math","PI","lineWidth","strokeStyle","stroke","clip","restore","b","TransparencyControl","M","impl","Control","html","olMap","getMapImpl","setVisible","setZIndex","transparentInteraction_","addInteraction","undefined","setRadius","removeInteraction","removeLayer","translations","en","es","getLang","res","language","getTranslation","lang","getValue","keyPath","translation","utils","isNullOrEmpty","console","warn","split","reduce","prev","current","values","isUndefined","TransparencyImplControl","exception","pluginOnLeft","layerSelected","template","Promise","success","fail","transformToLayers","document","querySelector","addEventListener","evt","buttonOpened","classList","add","names","jsonp","vars","transparency","compileSync","Number","target","dialog","error","getElementsByClassName","activate","deactivate","disabled","removeEffects","effectSelected","remove","forEach","layerByObject","getLayers","includes","removeLayers","indexOf","layerByUrl","layerByName","transform","newLayer","isValidLayer","urlLayer","toUpperCase","WMS","url","addLayers","WMTS","matrixSet","displayInLayerSwitcher","type","control","Transparency","name_","map_","controls_","className","position","isArray","isNaN","parseInt","metadata_","api","metadata","separatorApiJson","separator","tooltip_","tooltip","Plugin","control_","panel_","ui","Panel","collapsible","collapsedButtonClass","addControls","addPanels","removeTransparencyLayers","getLayersNames","removeControls","layersTransparency","join","plugin","window","M$plugin$Transparency","M$control$TransparencyControl","M$impl$control$TransparentInteraction","M$impl$control$TransparencyControl"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,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kBAAnG,OAAsHvI,KAAKV,QAA3H,OAAoIU,KAAKuI,kBAAzI,OAA4JvI,KAAKT,QAAjK,OAA0KS,KAAKuI,kBAA/K,OAAkMvI,KAAKR,e,iCAWvMQ,KAAK4I,SAAS5C,a,mCAWdhG,KAAK4I,SAAS3C,e,6BAaTwD,GACL,OAAIA,aAAkB9B,I,2BA7DtB,OAAO3H,KAAK4H,W,gCCtLX8B,OAAOvH,EAAEsH,SAAQC,OAAOvH,EAAEsH,OAAS,IACnCC,OAAOvH,EAAEuF,UAASgC,OAAOvH,EAAEuF,QAAU,IACrCgC,OAAOvH,EAAEC,OAAMsH,OAAOvH,EAAEC,KAAO,IAC/BsH,OAAOvH,EAAEC,KAAKsF,UAASgC,OAAOvH,EAAEC,KAAKsF,QAAU,IACpDgC,OAAOvH,EAAEsH,OAAO9B,aAAegC,EAC/BD,OAAOvH,EAAEuF,QAAQxF,oBAAsB0H,EACvCF,OAAOvH,EAAEC,KAAKsF,QAAQ/I,uBAAyBkL,EAC/CH,OAAOvH,EAAEC,KAAKsF,QAAQxF,oBAAsB4H","file":"transparency.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.transparency}}
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n

{{translations.radius}}:

\\r\\n \\r\\n
\\r\\n {{#if options}}\\r\\n
\\r\\n

{{translations.layers}}:

\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n {{/if}}\\r\\n
\\r\\n
\";","/**\n * @module M/impl/control/TransparentInteraction\n\n */\nexport default class TransparentInteraction extends ol.interaction.Pointer {\n /**\n * @classdesc\n * Main constructor of the TransparentInteraction.\n *\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @api stable\n */\n constructor(options) {\n super(options);\n this.layers_ = [];\n\n ol.interaction.Pointer.call(this, {\n handleDownEvent: this.setPosition,\n handleMoveEvent: this.setPosition,\n });\n\n // Default options\n const optionsE = options || {};\n\n this.pos = false;\n this.radius = (optionsE.radius || 100);\n this.border = optionsE.border;\n this.borderColor = optionsE.borderColor;\n \n if (optionsE.layers) {\n optionsE.layers = [optionsE.layers];\n const layer = optionsE.layers.map(layer => layer.getImpl().getOL3Layer())\n .filter(layer => layer != null);\n this.addLayer(layer);\n }\n }\n\n /** Set the map > start postcompose\n */\n setMap(map) {\n let i;\n if (this.getMap()) {\n for (i = 0; i < this.layers_.length; i += 1) {\n if (this.layers_[i].precompose) ol.Observable.unByKey(this.layers_[i].precompose);\n if (this.layers_[i].postcompose) ol.Observable.unByKey(this.layers_[i].postcompose);\n this.layers_[i].precompose = this.layers_[i].postcompose = null;\n }\n this.getMap().renderSync();\n }\n\n ol.interaction.Pointer.prototype.setMap.call(this, map);\n\n if (map) {\n for (i = 0; i < this.layers_.length; i += 1) {\n this.layers_[i].precompose = this.layers_[i].on('precompose', this.precompose_.bind(this));\n this.layers_[i].postcompose = this.layers_[i].on('postcompose', this.postcompose_.bind(this));\n this.layers_[i].precompose = this.layers_[i].on('prerender', this.precompose_.bind(this));\n this.layers_[i].postcompose = this.layers_[i].on('postrender', this.postcompose_.bind(this));\n }\n map.renderSync();\n }\n }\n\n /** Set clip radius\n * @param {integer} radius\n */\n setRadius(radius) {\n this.radius = radius;\n if (this.getMap()) this.getMap().renderSync();\n }\n\n /** Add a layer to clip\n * @param {ol.layer|Array} layer to clip\n */\n addLayer(layers) {\n if (!(layers instanceof Array)) layers = [layers];\n for (let i = 0; i < layers.length; i += 1) {\n const l = { layer: layers[i] };\n if (this.getMap()) {\n l.precompose = layers[i].on('precompose', this.precompose_.bind(this));\n l.postcompose = layers[i].on('postcompose', this.postcompose_.bind(this));\n l.precompose = layers[i].on('prerender', this.precompose_.bind(this));\n l.postcompose = layers[i].on('postrender', this.postcompose_.bind(this));\n this.getMap().renderSync();\n }\n this.layers_.push(layers[i]);\n }\n }\n\n /** Remove a layer to clip\n * @param {ol.layer|Array} layer to clip\n */\n removeLayer(layers) {\n if (!(layers instanceof Array)) layers = [layers];\n for (let i = 0; i < layers.length; i += 1) {\n let k;\n for (k = 0; k < this.layers_.length; k += 1) {\n if (this.layers_[k] === layers[i]) {\n break;\n }\n }\n if (k !== this.layers_.length && this.getMap()) {\n if (this.layers_[k].precompose) ol.Observable.unByKey(this.layers_[k].precompose);\n if (this.layers_[k].postcompose) ol.Observable.unByKey(this.layers_[k].postcompose);\n this.layers_.splice(k, 1);\n this.getMap().renderSync();\n }\n }\n }\n\n /** Set position of the clip\n * @param {ol.Pixel|ol.MapBrowserEvent}\n */\n setPosition(e) {\n if (e.pixel) {\n this.pos = e.pixel;\n } else if (e && e instanceof Array) {\n this.pos = e;\n } else {\n e = [-10000000, -10000000];\n\n }\n if (this.getMap()) this.getMap().renderSync();\n }\n\n /* @private\n */\n precompose_(e) {\n const ctx = e.context;\n const ratio = e.frameState.pixelRatio;\n\n ctx.save();\n if(this.border){\n ctx.beginPath();\n ctx.arc(this.pos[0] * ratio, this.pos[1] * ratio, this.radius+2.5 * ratio, 0, 2 * Math.PI);\n ctx.lineWidth = 5;\n ctx.strokeStyle = this.borderColor;\n ctx.stroke();\n }\n ctx.beginPath();\n ctx.arc(this.pos[0] * ratio, this.pos[1] * ratio, this.radius * ratio, 0, 2 * Math.PI);\n ctx.clip();\n \n }\n\n /* @private\n */\n postcompose_(e) {\n e.context.restore();\n }\n\n /**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\n setActive(b) {\n super.setActive(b);\n }\n}\n","/**\r\n * @module M/impl/control/TransparencyControl\r\n */\r\nimport TransparentInteraction from 'impl/TransparentInteraction';\r\n\r\n\r\nexport default class TransparencyControl 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 // super addTo - don't delete\r\n this.map = map;\r\n this.olMap = map.getMapImpl();\r\n\r\n super.addTo(map, html);\r\n }\r\n\r\n /**\r\n * Effects on the layer\r\n *\r\n * @public\r\n * @function\r\n * @param { M.Layer } layer layer to which to assign an effect\r\n * @param { Number } radius radius to assign\r\n * @api stable\r\n */\r\n effectSelected(options) {\r\n options.layers.setVisible(true);\r\n options.layers.setZIndex(90000);\r\n this.transparentInteraction_ = new TransparentInteraction(options);\r\n\r\n this.olMap.addInteraction(this.transparentInteraction_);\r\n }\r\n\r\n /**\r\n * Set radius\r\n *\r\n * @public\r\n * @function\r\n * @param { Number } radius radius to assign\r\n * @api stable\r\n */\r\n setRadius(radius) {\r\n if (this.transparentInteraction_ !== undefined) this.transparentInteraction_.setRadius(radius);\r\n }\r\n\r\n /**\r\n * Set layer\r\n *\r\n * @public\r\n * @function\r\n * @param { M.layer } layer layer to assign effect\r\n * @api stable\r\n */\r\n addLayer(layer) {\r\n this.transparentInteraction_.addLayer(layer.getImpl().getOL3Layer());\r\n }\r\n\r\n /**\r\n * Remove effects\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n removeEffects() {\r\n this.olMap.removeInteraction(this.transparentInteraction_);\r\n }\r\n\r\n\r\n /**\r\n * Remove layer\r\n *\r\n * @public\r\n * @function\r\n * @param { M.layer } layer to remove\r\n * @api stable\r\n */\r\n removeLayer(layer) {\r\n this.transparentInteraction_.removeLayer(layer.getImpl().getOL3Layer());\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/TransparencyControl\r\n */\r\n\r\nimport TransparencyImplControl from 'impl/transparencycontrol';\r\nimport template from 'templates/transparency';\r\nimport { getValue } from './i18n/language';\r\n\r\nexport default class TransparencyControl 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(TransparencyImplControl)) {\r\n M.exception(getValue('exception'));\r\n }\r\n // 2. implementation of this control\r\n const impl = new TransparencyImplControl();\r\n super(impl, 'Transparency');\r\n\r\n /**\r\n * Position plugin\r\n * @public\r\n * @type {String}\r\n */\r\n this.pluginOnLeft = values.pluginOnLeft;\r\n /**\r\n * All layers\r\n * @public\r\n * @public {Array}\r\n */\r\n this.layers = values.layers;\r\n /**\r\n * Radius selected\r\n * @private\r\n * @type {Number}\r\n */\r\n this.radius = values.radius;\r\n /**\r\n * Layer selected\r\n * @public\r\n * @type {M.layer}\r\n */\r\n this.layerSelected = null;\r\n /**\r\n * Enable/disable Border\r\n * @private\r\n * @type {boolean}\r\n */\r\n this.border = values.border;\r\n /**\r\n * Border color selected\r\n * @private\r\n * @type {string}\r\n */\r\n this.borderColor = values.borderColor;\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 /**\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 this.map = map;\r\n return new Promise((success, fail) => {\r\n this.layers = this.transformToLayers(this.layers);\r\n\r\n if (this.pluginOnLeft) {\r\n document.querySelector('.m-panel.m-plugin-transparency').querySelector('.m-panel-btn.g-cartografia-gps4').addEventListener('click', (evt) => {\r\n let buttonOpened = document.querySelector('.m-panel.m-plugin-transparency.opened');\r\n if (buttonOpened !== null) {\r\n buttonOpened = buttonOpened.querySelector('.m-panel-btn.g-cartografia-flecha-izquierda');\r\n }\r\n if (buttonOpened && this.pluginOnLeft) {\r\n buttonOpened.classList.add('opened-left');\r\n }\r\n });\r\n }\r\n\r\n let names = this.layers.map(function(layer) {\r\n return layer instanceof Object ? { name: layer.name } : { name: layer };\r\n });\r\n\r\n let options = {\r\n jsonp: true,\r\n vars: {\r\n translations: {\r\n transparency: getValue('transparency'),\r\n radius: getValue('radius'),\r\n layers: getValue('layers'),\r\n }\r\n }\r\n };\r\n\r\n if (names.length >= 1) {\r\n options.vars.options = names;\r\n }\r\n\r\n this.template = M.template.compileSync(template, options);\r\n\r\n // Radius\r\n this.template.querySelector('#input-transparent-radius').value = this.radius;\r\n this.template.querySelector('#input-transparent-radius').addEventListener('change', (evt) => {\r\n this.radius = Number(evt.target.value);\r\n this.getImpl().setRadius(this.radius);\r\n });\r\n\r\n if (this.layers.length == 0 || this.layers == '') {\r\n M.dialog.error(getValue('errorLayer'));\r\n } else {\r\n // Botón efecto transparencia \r\n this.template.querySelector('#m-transparency-transparent').addEventListener('click', (evt) => {\r\n\r\n if (document.getElementsByClassName('buttom-pressed').length == 0) {\r\n this.activate();\r\n } else {\r\n this.deactivate();\r\n }\r\n\r\n });\r\n\r\n if (options !== '') {\r\n this.template.querySelector('select').disabled = true;\r\n this.template.querySelector('input').disabled = true;\r\n this.template.querySelector('select').addEventListener('change', (evt) => {\r\n this.layerSelected.setVisible(false);\r\n this.removeEffects();\r\n const layer = this.layers.filter(function(layer) {\r\n return layer.name === evt.target.value\r\n });\r\n this.layerSelected = layer[0];\r\n this.getImpl().effectSelected({\r\n layers: this.layerSelected,\r\n radius: this.radius,\r\n border: this.border,\r\n borderColor: this.borderColor,\r\n });\r\n });\r\n }\r\n }\r\n success(this.template);\r\n });\r\n }\r\n\r\n /**\r\n * Activate Select/Input\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n activate() {\r\n if (this.layerSelected === null) this.layerSelected = this.layers[0];\r\n let names = this.layers.map(function(layer) {\r\n return layer instanceof Object ? { name: layer.name } : { name: layer };\r\n });\r\n this.template.querySelector('#m-transparency-transparent').classList.add('buttom-pressed');\r\n this.getImpl().effectSelected({\r\n layers: this.layerSelected,\r\n radius: this.radius,\r\n border: this.border,\r\n borderColor: this.borderColor,\r\n });\r\n if (names.length >= 1) {\r\n this.template.querySelector('select').disabled = false;\r\n this.template.querySelector('input').disabled = false;\r\n }\r\n }\r\n\r\n /**\r\n * Deactivate Select/Input\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n deactivate() {\r\n if (this.layerSelected === null) this.layerSelected = this.layers[0];\r\n let names = this.layers.map(function(layer) {\r\n return layer instanceof Object ? { name: layer.name } : { name: layer };\r\n });\r\n this.template.querySelector('#m-transparency-transparent').classList.remove('buttom-pressed');\r\n this.removeEffects();\r\n this.layerSelected.setVisible(false);\r\n if (names.length >= 1) {\r\n this.template.querySelector('select').disabled = true;\r\n this.template.querySelector('input').disabled = true;\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 removeEffects() {\r\n this.getImpl().removeEffects();\r\n }\r\n\r\n /**\r\n * This function remove the transparency layers\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n removeTransparencyLayers(layers) {\r\n layers.forEach(layer => {\r\n if (!(layer instanceof Object)) {\r\n if (layer.indexOf('*') >= 0) {\r\n const urlLayer = layer.split('*');\r\n let name = urlLayer[3]\r\n const layerByUrl = this.map.getLayers().filter(l => name.includes(l.name))[0];\r\n this.map.removeLayers(layerByUrl);\r\n } else {\r\n const layerByName = this.map.getLayers().filter(l => layer.includes(l.name))[0];\r\n this.map.removeLayers(layerByName);\r\n }\r\n } else if (layer instanceof Object) {\r\n const layerByObject = this.map.getLayers().filter(l => layer.name.includes(l.name))[0];\r\n this.map.removeLayers(layerByObject);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * This function transform string to M.Layer\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n * @param {string}\r\n * @return\r\n */\r\n transformToLayers(layers) {\r\n const transform = layers.map(function(layer) {\r\n let newLayer = null;\r\n if (!(layer instanceof Object)) {\r\n if (layer.indexOf('*') >= 0) {\r\n const urlLayer = layer.split('*');\r\n if (urlLayer[0].toUpperCase() == 'WMS') {\r\n newLayer = new M.layer.WMS({\r\n url: urlLayer[2],\r\n name: urlLayer[3]\r\n });\r\n this.map.addLayers(newLayer);\r\n } else if (urlLayer[0].toUpperCase() == 'WMTS') {\r\n newLayer = new M.layer.WMTS({\r\n url: urlLayer[1],\r\n name: urlLayer[2],\r\n matrixSet: urlLayer[3],\r\n });\r\n this.map.addLayers(newLayer);\r\n }\r\n } else {\r\n const layerByName = this.map.getLayers().filter(l => layer.includes(l.name))[0];\r\n newLayer = this.isValidLayer(layerByName) ? layerByName : null;\r\n }\r\n } else if (layer instanceof Object) {\r\n const layerByObject = this.map.getLayers().filter(l => layer.name.includes(l.name))[0];\r\n newLayer = this.isValidLayer(layerByObject) ? layerByObject : null;\r\n }\r\n if (newLayer !== null) {\r\n newLayer.displayInLayerSwitcher = false;\r\n newLayer.setVisible(false);\r\n return newLayer\r\n\r\n } else {\r\n this.layers.remove(layer);\r\n }\r\n }, this);\r\n return (transform[0] === undefined) ? [] : transform;\r\n }\r\n\r\n /**\r\n * This function transform string to M.Layer\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n * @param {string}\r\n * @return {Boolean}\r\n */\r\n isValidLayer(layer) {\r\n return layer.type === 'WMTS' || layer.type === 'WMS';\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 * @return {Boolean}\r\n */\r\n equals(control) {\r\n return control instanceof TransparencyControl;\r\n }\r\n\r\n getLayersNames() {\r\n return this.layers.map(l => l.name);\r\n }\r\n}\r\n","/**\r\n * @module M/plugin/Transparency\r\n */\r\nimport 'assets/css/transparency';\r\nimport TransparencyControl from './transparencycontrol';\r\nimport api from '../../api';\r\nimport { getValue } from './i18n/language';\r\n// import { isArray } from '../../../../../facade/js/util/Utils';\r\n\r\nexport default class Transparency 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_ = 'transparency';\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-transparency';\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 * 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 if (options.layers === undefined || options.layers === '') {\r\n M.dialog.error(getValue('errorLayer'));\r\n this.layers = [];\r\n } else {\r\n if (Array.isArray(options.layers)) {\r\n this.layers = options.layers;\r\n } else {\r\n this.layers = options.layers.split(\",\");\r\n }\r\n }\r\n\r\n /**\r\n * Transparent effect radius\r\n * Value: number in range 30 - 200\r\n * @type {number}\r\n * @public\r\n */\r\n\r\n if (!isNaN(parseInt(options.radius))) {\r\n\r\n if (options.radius >= 30 && options.radius <= 200) {\r\n this.radius = parseInt(options.radius);\r\n } else if (options.radius > 200) {\r\n this.radius = 200;\r\n } else if (options.radius < 30) {\r\n this.radius = 30;\r\n }\r\n\r\n } else {\r\n this.radius = 100; // Default value\r\n }\r\n\r\n /**\r\n * Enable/disable border\r\n * @type {boolean}\r\n * @public\r\n */\r\n this.border = options.border;\r\n if (this.border === undefined) {\r\n this.border = true;\r\n }\r\n \r\n /**\r\n * Radius border color\r\n * Value: color value\r\n * @type {string}\r\n * @public\r\n */\r\n this.borderColor = options.borderColor || 'white';\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 this.separatorApiJson = api.url.separator;\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 * 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 layers: this.layers,\r\n radius: this.radius,\r\n border: this.border,\r\n borderColor: this.borderColor,\r\n };\r\n this.control_ = new TransparencyControl(values);\r\n this.controls_.push(this.control_);\r\n this.map_ = map;\r\n this.panel_ = new M.ui.Panel('panelTransparency', {\r\n collapsible: true,\r\n position: M.ui.position[this.position],\r\n className: this.className,\r\n collapsedButtonClass: 'g-cartografia-gps4',\r\n tooltip: this.tooltip_,\r\n });\r\n this.panel_.addControls(this.controls_);\r\n map.addPanels(this.panel_);\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 this.control_.removeEffects();\r\n this.control_.removeTransparencyLayers(this.control_.getLayersNames());\r\n this.map_.removeControls([this.control_]);\r\n [this.control_, this.panel_, this.map_, this.layers, this.radius, this.border, this.borderColor] = [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 * @getter\r\n * @api stable\r\n * @return {Object}\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 let layersTransparency = this.control_.getLayersNames();\r\n\r\n return `${this.name}=${this.position}${this.separatorApiJson}${layersTransparency.join(',')}${this.separatorApiJson}${this.radius}${this.separatorApiJson}${this.border}${this.separatorApiJson}${this.borderColor}`;\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 * This\r\n function compare\r\n if pluging recieved by param is instance of M.plugin.Transparency\r\n *\r\n * @public\r\n * @function\r\n * @param {M.plugin} plugin to compare\r\n * @api stable\r\n */\r\n equals(plugin) {\r\n if (plugin instanceof Transparency) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n","import M$plugin$Transparency from '/home/irene/guadaltel/local/mapea-publico/src/plugins/v5/transparency/src/facade/js/transparency';\nimport M$control$TransparencyControl from '/home/irene/guadaltel/local/mapea-publico/src/plugins/v5/transparency/src/facade/js/transparencycontrol';\nimport M$impl$control$TransparentInteraction from '/home/irene/guadaltel/local/mapea-publico/src/plugins/v5/transparency/src/impl/ol/js/TransparentInteraction';\nimport M$impl$control$TransparencyControl from '/home/irene/guadaltel/local/mapea-publico/src/plugins/v5/transparency/src/impl/ol/js/transparencycontrol';\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.Transparency = M$plugin$Transparency;\nwindow.M.control.TransparencyControl = M$control$TransparencyControl;\nwindow.M.impl.control.TransparentInteraction = M$impl$control$TransparentInteraction;\nwindow.M.impl.control.TransparencyControl = M$impl$control$TransparencyControl;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/templates/transparency.html","webpack:///./src/impl/ol/js/TransparentInteraction.js","webpack:///./src/impl/ol/js/transparencycontrol.js","webpack:///./src/facade/js/i18n/language.js","webpack:///./src/facade/js/transparencycontrol.js","webpack:///./src/facade/js/transparency.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","TransparentInteraction","ol","interaction","Pointer","options","layers_","handleDownEvent","setPosition","handleMoveEvent","optionsE","pos","radius","border","borderColor","layers","layer","map","getImpl","getOL3Layer","filter","addLayer","this","getMap","length","precompose","Observable","unByKey","postcompose","renderSync","setMap","on","precompose_","postcompose_","Array","push","k","splice","e","pixel","ctx","context","ratio","frameState","pixelRatio","save","beginPath","arc","Math","PI","lineWidth","strokeStyle","stroke","clip","restore","b","TransparencyControl","M","impl","Control","html","olMap","getMapImpl","setVisible","setZIndex","transparentInteraction_","addInteraction","undefined","setRadius","removeInteraction","removeLayer","translations","en","es","getLang","res","language","getTranslation","lang","getValue","keyPath","translation","utils","isNullOrEmpty","console","warn","split","reduce","prev","current","values","isUndefined","TransparencyImplControl","exception","pluginOnLeft","layerSelected","template","Promise","success","fail","transformToLayers","document","querySelector","addEventListener","evt","buttonOpened","classList","add","names","jsonp","vars","transparency","compileSync","Number","target","dialog","error","getElementsByClassName","activate","deactivate","disabled","removeEffects","effectSelected","remove","forEach","layerByObject","getLayers","includes","removeLayers","indexOf","layerByUrl","layerByName","transform","newLayer","isValidLayer","urlLayer","toUpperCase","WMS","url","addLayers","WMTS","matrixSet","displayInLayerSwitcher","type","control","Transparency","Plugin","name_","map_","controls_","className","positions","position","isArray","isNaN","parseInt","metadata_","api","metadata","separatorApiJson","separator","tooltip_","tooltip","control_","panel_","ui","Panel","collapsible","collapsedButtonClass","addControls","addPanels","removeTransparencyLayers","getLayersNames","removeControls","layersTransparency","join","plugin","window","M$plugin$Transparency","M$control$TransparencyControl","M$impl$control$TransparentInteraction","M$impl$control$TransparencyControl"],"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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U,KAAKyI,kBAAzI,OAA4JzI,KAAKT,QAAjK,OAA0KS,KAAKyI,kBAA/K,OAAkMzI,KAAKR,e,sBAUzM,WACEQ,KAAK6I,SAAS7C,a,wBAUhB,WACEhG,KAAK6I,SAAS5C,e,oBAahB,SAAOyD,GACL,OAAIA,aAAkB/B,O,gCCnPrBgC,OAAOxH,EAAEuH,SAAQC,OAAOxH,EAAEuH,OAAS,IACnCC,OAAOxH,EAAEuF,UAASiC,OAAOxH,EAAEuF,QAAU,IACrCiC,OAAOxH,EAAEC,OAAMuH,OAAOxH,EAAEC,KAAO,IAC/BuH,OAAOxH,EAAEC,KAAKsF,UAASiC,OAAOxH,EAAEC,KAAKsF,QAAU,IACpDiC,OAAOxH,EAAEuH,OAAO/B,aAAeiC,EAC/BD,OAAOxH,EAAEuF,QAAQxF,oBAAsB2H,EACvCF,OAAOxH,EAAEC,KAAKsF,QAAQ/I,uBAAyBmL,EAC/CH,OAAOxH,EAAEC,KAAKsF,QAAQxF,oBAAsB6H","file":"transparency.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.transparency}}
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n

{{translations.radius}}:

\\r\\n \\r\\n
\\r\\n {{#if options}}\\r\\n
\\r\\n

{{translations.layers}}:

\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n {{/if}}\\r\\n
\\r\\n
\";","/**\n * @module M/impl/control/TransparentInteraction\n\n */\nexport default class TransparentInteraction extends ol.interaction.Pointer {\n /**\n * @classdesc\n * Main constructor of the TransparentInteraction.\n *\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @api stable\n */\n constructor(options) {\n super(options);\n this.layers_ = [];\n\n ol.interaction.Pointer.call(this, {\n handleDownEvent: this.setPosition,\n handleMoveEvent: this.setPosition,\n });\n\n // Default options\n const optionsE = options || {};\n\n this.pos = false;\n this.radius = (optionsE.radius || 100);\n this.border = optionsE.border;\n this.borderColor = optionsE.borderColor;\n \n if (optionsE.layers) {\n optionsE.layers = [optionsE.layers];\n const layer = optionsE.layers.map(layer => layer.getImpl().getOL3Layer())\n .filter(layer => layer != null);\n this.addLayer(layer);\n }\n }\n\n /** Set the map > start postcompose\n */\n setMap(map) {\n let i;\n if (this.getMap()) {\n for (i = 0; i < this.layers_.length; i += 1) {\n if (this.layers_[i].precompose) ol.Observable.unByKey(this.layers_[i].precompose);\n if (this.layers_[i].postcompose) ol.Observable.unByKey(this.layers_[i].postcompose);\n this.layers_[i].precompose = this.layers_[i].postcompose = null;\n }\n this.getMap().renderSync();\n }\n\n ol.interaction.Pointer.prototype.setMap.call(this, map);\n\n if (map) {\n for (i = 0; i < this.layers_.length; i += 1) {\n this.layers_[i].precompose = this.layers_[i].on('precompose', this.precompose_.bind(this));\n this.layers_[i].postcompose = this.layers_[i].on('postcompose', this.postcompose_.bind(this));\n this.layers_[i].precompose = this.layers_[i].on('prerender', this.precompose_.bind(this));\n this.layers_[i].postcompose = this.layers_[i].on('postrender', this.postcompose_.bind(this));\n }\n map.renderSync();\n }\n }\n\n /** Set clip radius\n * @param {integer} radius\n */\n setRadius(radius) {\n this.radius = radius;\n if (this.getMap()) this.getMap().renderSync();\n }\n\n /** Add a layer to clip\n * @param {ol.layer|Array} layer to clip\n */\n addLayer(layers) {\n if (!(layers instanceof Array)) layers = [layers];\n for (let i = 0; i < layers.length; i += 1) {\n const l = { layer: layers[i] };\n if (this.getMap()) {\n l.precompose = layers[i].on('precompose', this.precompose_.bind(this));\n l.postcompose = layers[i].on('postcompose', this.postcompose_.bind(this));\n l.precompose = layers[i].on('prerender', this.precompose_.bind(this));\n l.postcompose = layers[i].on('postrender', this.postcompose_.bind(this));\n this.getMap().renderSync();\n }\n this.layers_.push(layers[i]);\n }\n }\n\n /** Remove a layer to clip\n * @param {ol.layer|Array} layer to clip\n */\n removeLayer(layers) {\n if (!(layers instanceof Array)) layers = [layers];\n for (let i = 0; i < layers.length; i += 1) {\n let k;\n for (k = 0; k < this.layers_.length; k += 1) {\n if (this.layers_[k] === layers[i]) {\n break;\n }\n }\n if (k !== this.layers_.length && this.getMap()) {\n if (this.layers_[k].precompose) ol.Observable.unByKey(this.layers_[k].precompose);\n if (this.layers_[k].postcompose) ol.Observable.unByKey(this.layers_[k].postcompose);\n this.layers_.splice(k, 1);\n this.getMap().renderSync();\n }\n }\n }\n\n /** Set position of the clip\n * @param {ol.Pixel|ol.MapBrowserEvent}\n */\n setPosition(e) {\n if (e.pixel) {\n this.pos = e.pixel;\n } else if (e && e instanceof Array) {\n this.pos = e;\n } else {\n e = [-10000000, -10000000];\n\n }\n if (this.getMap()) this.getMap().renderSync();\n }\n\n /* @private\n */\n precompose_(e) {\n const ctx = e.context;\n const ratio = e.frameState.pixelRatio;\n\n ctx.save();\n if(this.border){\n ctx.beginPath();\n ctx.arc(this.pos[0] * ratio, this.pos[1] * ratio, this.radius+2.5 * ratio, 0, 2 * Math.PI);\n ctx.lineWidth = 5;\n ctx.strokeStyle = this.borderColor;\n ctx.stroke();\n }\n ctx.beginPath();\n ctx.arc(this.pos[0] * ratio, this.pos[1] * ratio, this.radius * ratio, 0, 2 * Math.PI);\n ctx.clip();\n \n }\n\n /* @private\n */\n postcompose_(e) {\n e.context.restore();\n }\n\n /**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\n setActive(b) {\n super.setActive(b);\n }\n}\n","/**\r\n * @module M/impl/control/TransparencyControl\r\n */\r\nimport TransparentInteraction from 'impl/TransparentInteraction';\r\n\r\n\r\nexport default class TransparencyControl 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 // super addTo - don't delete\r\n this.map = map;\r\n this.olMap = map.getMapImpl();\r\n\r\n super.addTo(map, html);\r\n }\r\n\r\n /**\r\n * Effects on the layer\r\n *\r\n * @public\r\n * @function\r\n * @param { M.Layer } layer layer to which to assign an effect\r\n * @param { Number } radius radius to assign\r\n * @api stable\r\n */\r\n effectSelected(options) {\r\n options.layers.setVisible(true);\r\n options.layers.setZIndex(90000);\r\n this.transparentInteraction_ = new TransparentInteraction(options);\r\n\r\n this.olMap.addInteraction(this.transparentInteraction_);\r\n }\r\n\r\n /**\r\n * Set radius\r\n *\r\n * @public\r\n * @function\r\n * @param { Number } radius radius to assign\r\n * @api stable\r\n */\r\n setRadius(radius) {\r\n if (this.transparentInteraction_ !== undefined) this.transparentInteraction_.setRadius(radius);\r\n }\r\n\r\n /**\r\n * Set layer\r\n *\r\n * @public\r\n * @function\r\n * @param { M.layer } layer layer to assign effect\r\n * @api stable\r\n */\r\n addLayer(layer) {\r\n this.transparentInteraction_.addLayer(layer.getImpl().getOL3Layer());\r\n }\r\n\r\n /**\r\n * Remove effects\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n removeEffects() {\r\n this.olMap.removeInteraction(this.transparentInteraction_);\r\n }\r\n\r\n\r\n /**\r\n * Remove layer\r\n *\r\n * @public\r\n * @function\r\n * @param { M.layer } layer to remove\r\n * @api stable\r\n */\r\n removeLayer(layer) {\r\n this.transparentInteraction_.removeLayer(layer.getImpl().getOL3Layer());\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/TransparencyControl\r\n */\r\n\r\nimport TransparencyImplControl from 'impl/transparencycontrol';\r\nimport template from 'templates/transparency';\r\nimport { getValue } from './i18n/language';\r\n\r\nexport default class TransparencyControl 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(TransparencyImplControl)) {\r\n M.exception(getValue('exception'));\r\n }\r\n // 2. implementation of this control\r\n const impl = new TransparencyImplControl();\r\n super(impl, 'Transparency');\r\n\r\n /**\r\n * Position plugin\r\n * @public\r\n * @type {String}\r\n */\r\n this.pluginOnLeft = values.pluginOnLeft;\r\n /**\r\n * All layers\r\n * @public\r\n * @public {Array}\r\n */\r\n this.layers = values.layers;\r\n /**\r\n * Radius selected\r\n * @private\r\n * @type {Number}\r\n */\r\n this.radius = values.radius;\r\n /**\r\n * Layer selected\r\n * @public\r\n * @type {M.layer}\r\n */\r\n this.layerSelected = null;\r\n /**\r\n * Enable/disable Border\r\n * @private\r\n * @type {boolean}\r\n */\r\n this.border = values.border;\r\n /**\r\n * Border color selected\r\n * @private\r\n * @type {string}\r\n */\r\n this.borderColor = values.borderColor;\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 /**\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 this.map = map;\r\n return new Promise((success, fail) => {\r\n this.layers = this.transformToLayers(this.layers);\r\n\r\n if (this.pluginOnLeft) {\r\n document.querySelector('.m-panel.m-plugin-transparency').querySelector('.m-panel-btn.g-cartografia-gps4').addEventListener('click', (evt) => {\r\n let buttonOpened = document.querySelector('.m-panel.m-plugin-transparency.opened');\r\n if (buttonOpened !== null) {\r\n buttonOpened = buttonOpened.querySelector('.m-panel-btn.g-cartografia-flecha-izquierda');\r\n }\r\n if (buttonOpened && this.pluginOnLeft) {\r\n buttonOpened.classList.add('opened-left');\r\n }\r\n });\r\n }\r\n\r\n let names = this.layers.map(function(layer) {\r\n return layer instanceof Object ? { name: layer.name } : { name: layer };\r\n });\r\n\r\n let options = {\r\n jsonp: true,\r\n vars: {\r\n translations: {\r\n transparency: getValue('transparency'),\r\n radius: getValue('radius'),\r\n layers: getValue('layers'),\r\n }\r\n }\r\n };\r\n\r\n if (names.length >= 1) {\r\n options.vars.options = names;\r\n }\r\n\r\n this.template = M.template.compileSync(template, options);\r\n\r\n // Radius\r\n this.template.querySelector('#input-transparent-radius').value = this.radius;\r\n this.template.querySelector('#input-transparent-radius').addEventListener('change', (evt) => {\r\n this.radius = Number(evt.target.value);\r\n this.getImpl().setRadius(this.radius);\r\n });\r\n\r\n if (this.layers.length == 0 || this.layers == '') {\r\n M.dialog.error(getValue('errorLayer'));\r\n } else {\r\n // Botón efecto transparencia \r\n this.template.querySelector('#m-transparency-transparent').addEventListener('click', (evt) => {\r\n\r\n if (document.getElementsByClassName('buttom-pressed').length == 0) {\r\n this.activate();\r\n } else {\r\n this.deactivate();\r\n }\r\n\r\n });\r\n\r\n if (options !== '') {\r\n this.template.querySelector('select').disabled = true;\r\n this.template.querySelector('input').disabled = true;\r\n this.template.querySelector('select').addEventListener('change', (evt) => {\r\n this.layerSelected.setVisible(false);\r\n this.removeEffects();\r\n const layer = this.layers.filter(function(layer) {\r\n return layer.name === evt.target.value\r\n });\r\n this.layerSelected = layer[0];\r\n this.getImpl().effectSelected({\r\n layers: this.layerSelected,\r\n radius: this.radius,\r\n border: this.border,\r\n borderColor: this.borderColor,\r\n });\r\n });\r\n }\r\n }\r\n success(this.template);\r\n });\r\n }\r\n\r\n /**\r\n * Activate Select/Input\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n activate() {\r\n if (this.layerSelected === null) this.layerSelected = this.layers[0];\r\n let names = this.layers.map(function(layer) {\r\n return layer instanceof Object ? { name: layer.name } : { name: layer };\r\n });\r\n this.template.querySelector('#m-transparency-transparent').classList.add('buttom-pressed');\r\n this.getImpl().effectSelected({\r\n layers: this.layerSelected,\r\n radius: this.radius,\r\n border: this.border,\r\n borderColor: this.borderColor,\r\n });\r\n if (names.length >= 1) {\r\n this.template.querySelector('select').disabled = false;\r\n this.template.querySelector('input').disabled = false;\r\n }\r\n }\r\n\r\n /**\r\n * Deactivate Select/Input\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n deactivate() {\r\n if (this.layerSelected === null) this.layerSelected = this.layers[0];\r\n let names = this.layers.map(function(layer) {\r\n return layer instanceof Object ? { name: layer.name } : { name: layer };\r\n });\r\n this.template.querySelector('#m-transparency-transparent').classList.remove('buttom-pressed');\r\n this.removeEffects();\r\n this.layerSelected.setVisible(false);\r\n if (names.length >= 1) {\r\n this.template.querySelector('select').disabled = true;\r\n this.template.querySelector('input').disabled = true;\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 removeEffects() {\r\n this.getImpl().removeEffects();\r\n }\r\n\r\n /**\r\n * This function remove the transparency layers\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n */\r\n removeTransparencyLayers(layers) {\r\n layers.forEach(layer => {\r\n if (!(layer instanceof Object)) {\r\n if (layer.indexOf('*') >= 0) {\r\n const urlLayer = layer.split('*');\r\n let name = urlLayer[3]\r\n const layerByUrl = this.map.getLayers().filter(l => name.includes(l.name))[0];\r\n this.map.removeLayers(layerByUrl);\r\n } else {\r\n const layerByName = this.map.getLayers().filter(l => layer.includes(l.name))[0];\r\n this.map.removeLayers(layerByName);\r\n }\r\n } else if (layer instanceof Object) {\r\n const layerByObject = this.map.getLayers().filter(l => layer.name.includes(l.name))[0];\r\n this.map.removeLayers(layerByObject);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * This function transform string to M.Layer\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n * @param {string}\r\n * @return\r\n */\r\n transformToLayers(layers) {\r\n const transform = layers.map(function(layer) {\r\n let newLayer = null;\r\n if (!(layer instanceof Object)) {\r\n if (layer.indexOf('*') >= 0) {\r\n const urlLayer = layer.split('*');\r\n if (urlLayer[0].toUpperCase() == 'WMS') {\r\n newLayer = new M.layer.WMS({\r\n url: urlLayer[2],\r\n name: urlLayer[3]\r\n });\r\n this.map.addLayers(newLayer);\r\n } else if (urlLayer[0].toUpperCase() == 'WMTS') {\r\n newLayer = new M.layer.WMTS({\r\n url: urlLayer[1],\r\n name: urlLayer[2],\r\n matrixSet: urlLayer[3],\r\n });\r\n this.map.addLayers(newLayer);\r\n }\r\n } else {\r\n const layerByName = this.map.getLayers().filter(l => layer.includes(l.name))[0];\r\n newLayer = this.isValidLayer(layerByName) ? layerByName : null;\r\n }\r\n } else if (layer instanceof Object) {\r\n const layerByObject = this.map.getLayers().filter(l => layer.name.includes(l.name))[0];\r\n newLayer = this.isValidLayer(layerByObject) ? layerByObject : null;\r\n }\r\n if (newLayer !== null) {\r\n newLayer.displayInLayerSwitcher = false;\r\n newLayer.setVisible(false);\r\n return newLayer\r\n\r\n } else {\r\n this.layers.remove(layer);\r\n }\r\n }, this);\r\n return (transform[0] === undefined) ? [] : transform;\r\n }\r\n\r\n /**\r\n * This function transform string to M.Layer\r\n *\r\n * @public\r\n * @function\r\n * @api stable\r\n * @param {string}\r\n * @return {Boolean}\r\n */\r\n isValidLayer(layer) {\r\n return layer.type === 'WMTS' || layer.type === 'WMS';\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 * @return {Boolean}\r\n */\r\n equals(control) {\r\n return control instanceof TransparencyControl;\r\n }\r\n\r\n getLayersNames() {\r\n return this.layers.map(l => l.name);\r\n }\r\n}\r\n","/**\r\n * @module M/plugin/Transparency\r\n */\r\nimport 'assets/css/transparency';\r\nimport TransparencyControl from './transparencycontrol';\r\nimport api from '../../api';\r\nimport { getValue } from './i18n/language';\r\n// import { isArray } from '../../../../../facade/js/util/Utils';\r\n\r\nexport default class Transparency 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_ = 'transparency';\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-transparency';\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 * 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 if (options.layers === undefined || options.layers === '') {\r\n M.dialog.error(getValue('errorLayer'));\r\n this.layers = [];\r\n } else {\r\n if (Array.isArray(options.layers)) {\r\n this.layers = options.layers;\r\n } else {\r\n this.layers = options.layers.split(\",\");\r\n }\r\n }\r\n\r\n /**\r\n * Transparent effect radius\r\n * Value: number in range 30 - 200\r\n * @type {number}\r\n * @public\r\n */\r\n\r\n if (!isNaN(parseInt(options.radius))) {\r\n\r\n if (options.radius >= 30 && options.radius <= 200) {\r\n this.radius = parseInt(options.radius);\r\n } else if (options.radius > 200) {\r\n this.radius = 200;\r\n } else if (options.radius < 30) {\r\n this.radius = 30;\r\n }\r\n\r\n } else {\r\n this.radius = 100; // Default value\r\n }\r\n\r\n /**\r\n * Enable/disable border\r\n * @type {boolean}\r\n * @public\r\n */\r\n this.border = options.border;\r\n if (this.border === undefined) {\r\n this.border = true;\r\n }\r\n \r\n /**\r\n * Radius border color\r\n * Value: color value\r\n * @type {string}\r\n * @public\r\n */\r\n this.borderColor = options.borderColor || 'white';\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 this.separatorApiJson = api.url.separator;\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 * 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 layers: this.layers,\r\n radius: this.radius,\r\n border: this.border,\r\n borderColor: this.borderColor,\r\n };\r\n this.control_ = new TransparencyControl(values);\r\n this.controls_.push(this.control_);\r\n this.map_ = map;\r\n this.panel_ = new M.ui.Panel('panelTransparency', {\r\n collapsible: true,\r\n position: M.ui.position[this.position],\r\n className: this.className,\r\n collapsedButtonClass: 'g-cartografia-gps4',\r\n tooltip: this.tooltip_,\r\n });\r\n this.panel_.addControls(this.controls_);\r\n map.addPanels(this.panel_);\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 this.control_.removeEffects();\r\n this.control_.removeTransparencyLayers(this.control_.getLayersNames());\r\n this.map_.removeControls([this.control_]);\r\n [this.control_, this.panel_, this.map_, this.layers, this.radius, this.border, this.borderColor] = [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 * @getter\r\n * @api stable\r\n * @return {Object}\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 let layersTransparency = this.control_.getLayersNames();\r\n\r\n return `${this.name}=${this.position}${this.separatorApiJson}${layersTransparency.join(',')}${this.separatorApiJson}${this.radius}${this.separatorApiJson}${this.border}${this.separatorApiJson}${this.borderColor}`;\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 * This\r\n function compare\r\n if pluging recieved by param is instance of M.plugin.Transparency\r\n *\r\n * @public\r\n * @function\r\n * @param {M.plugin} plugin to compare\r\n * @api stable\r\n */\r\n equals(plugin) {\r\n if (plugin instanceof Transparency) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n","import M$plugin$Transparency from '/home/fbmanas/Documentos/git-sigc/transparency/src/facade/js/transparency';\nimport M$control$TransparencyControl from '/home/fbmanas/Documentos/git-sigc/transparency/src/facade/js/transparencycontrol';\nimport M$impl$control$TransparentInteraction from '/home/fbmanas/Documentos/git-sigc/transparency/src/impl/ol/js/TransparentInteraction';\nimport M$impl$control$TransparencyControl from '/home/fbmanas/Documentos/git-sigc/transparency/src/impl/ol/js/transparencycontrol';\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.Transparency = M$plugin$Transparency;\nwindow.M.control.TransparencyControl = M$control$TransparencyControl;\nwindow.M.impl.control.TransparentInteraction = M$impl$control$TransparentInteraction;\nwindow.M.impl.control.TransparencyControl = M$impl$control$TransparencyControl;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 8b0fc5e..5e88270 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Transparency", - "version": "1.0.0", + "version": "1.0.1", "description": "", "keywords": [ "map", diff --git a/src/api.json b/src/api.json index 3a2f792..bb9d77a 100644 --- a/src/api.json +++ b/src/api.json @@ -44,12 +44,13 @@ "name": "Transparency", "description": "Efecto transparencia sobre capa", "text": "Plugin que permite realizar un efecto de transparencia sobre una capa. En caso de indicar varias capas, se realizará el efecto sobre la capa seleccionada en el selector. ", - "version": "1.0.0", - "date": "Junio, 2020", + "version": "1.0.1", + "date": "Mayo, 2021", "author": "", "org": "Consejería de Hacienda, Industria y Energía. Junta de Andalucía.", "tags": "mapea,plugin", "icon": "./facade/assets/icons/icons.svg", - "centralized": true + "centralized": true, + "compatibility": ["5","6"] } } diff --git a/test/dev.html b/test/dev.html index 4285d85..c38700c 100644 --- a/test/dev.html +++ b/test/dev.html @@ -7,7 +7,7 @@ Transparency TEST - +