Socket
Socket
Sign inDemoInstall

@nextgis/control-container

Package Overview
Dependencies
Maintainers
3
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextgis/control-container - npm Package Compare versions

Comparing version 0.27.0 to 0.27.1

lib/controls/ZoomControl.d.ts

2

lib/control-container.js

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js")):"function"==typeof define&&define.amd?define(["!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"],n):"object"==typeof exports?exports.ControlContainer=n(require("!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js")):t.ControlContainer=n(t["!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"])}("undefined"!=typeof self?self:this,(function(t){return function(t){var n={};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=n,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},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,n){if(1&n&&(t=o(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)o.d(e,r,function(n){return t[n]}.bind(null,r));return e},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=4)}([function(t,n,o){var e=o(1),r=o(2);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.i,r,""]]);var i={insert:"head",singleton:!1},a=(e(r,i),r.locals?r.locals:{});t.exports=a},function(n,o){n.exports=t},function(t,n,o){(n=o(3)(!1)).push([t.i,".webmap-ctrl-top-left,\n.webmap-ctrl-top-right,\n.webmap-ctrl-bottom-left,\n.webmap-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n.webmap-ctrl-top-left { top: 0; left: 0; }\n.webmap-ctrl-top-right { top: 0; right: 0; }\n.webmap-ctrl-bottom-left { bottom: 0; left: 0; }\n.webmap-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.webmap-ctrl { clear: both; pointer-events: auto; }\n.webmap-ctrl-top-left .ol-control-margin { margin: 10px 0 0 10px; float: left; }\n.webmap-ctrl-top-right .ol-control-margin { margin: 10px 10px 0 0; float: right; }\n.webmap-ctrl-bottom-left .ol-control-margin { margin: 0 0 10px 10px; float: left; }\n.webmap-ctrl-bottom-right .ol-control-margin { margin: 0 10px 10px 0; float: right; }\n\n.webmap-ctrl-top-left .ol-control { margin: 10px 0 0 10px; float: left; }\n.webmap-ctrl-top-right .ol-control { margin: 10px 10px 0 0; float: right; }\n.webmap-ctrl-bottom-left .ol-control { margin: 0 0 10px 10px; float: left; }\n.webmap-ctrl-bottom-right .ol-control { margin: 0 10px 10px 0; float: right; }\n\n.webmap-ctrl-group {\n border-radius: 4px;\n overflow: hidden;\n background: #fff;\n}\n\n.webmap-ctrl-group:not(:empty) {\n -moz-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);\n -webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);\n box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);\n}\n\n.webmap-ctrl-group > button {\n width: 30px;\n height: 30px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.webmap-ctrl-group > button + button {\n border-top: 1px solid #ddd;\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.webmap-ctrl > button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.webmap-ctrl > button:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.webmap-ctrl-icon {\n padding: 5px;\n}\n\n\n",""]),t.exports=n},function(t,n,o){"use strict";t.exports=function(t){var n=[];return n.toString=function(){return this.map((function(n){var o=function(t,n){var o=t[1]||"",e=t[3];if(!e)return o;if(n&&"function"==typeof btoa){var r=(a=e,l=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(l),"/*# ".concat(c," */")),i=e.sources.map((function(t){return"/*# sourceURL=".concat(e.sourceRoot||"").concat(t," */")}));return[o].concat(i).concat([r]).join("\n")}var a,l,c;return[o].join("\n")}(n,t);return n[2]?"@media ".concat(n[2]," {").concat(o,"}"):o})).join("")},n.i=function(t,o,e){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(e)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(r[a]=!0)}for(var l=0;l<t.length;l++){var c=[].concat(t[l]);e&&r[c[0]]||(o&&(c[2]?c[2]="".concat(o," and ").concat(c[2]):c[2]=o),n.push(c))}},n}},function(t,n,o){"use strict";o.r(n);o(0);var e=function(){function t(t){void 0===t&&(t={}),this.classPrefix="webmap",this._positionsContainers={"bottom-left":null,"bottom-right":null,"top-left":null,"top-right":null},this.classPrefix=t.classPrefix||this.classPrefix,this.addClass=t.addClass,this.webMap=t.webMap,this._container=this.createContainerElement()}return t.prototype.attach=function(t){var n=null;if("string"==typeof t&&(n=document.getElementById(t),!t))try{n=document.querySelector(t)}catch(t){}return n&&n.appendChild(this._container),this},t.prototype.detach=function(){var t=this._container.parentElement;t&&t.removeChild(this._container)},t.prototype.getContainer=function(){return this._container},t.prototype.getPositionContainer=function(t){var n=this._positionsContainers[t];if(n)return n},t.prototype.newPositionContainer=function(t){var n=this.getPositionContainer(t);if(n){var o=document.createElement("div");return o.className="openlayers-ctrl",-1!==t.indexOf("bottom")&&n.childElementCount?n.insertBefore(o,n.firstChild):n.appendChild(o),o}},t.prototype.addControl=function(t,n){var o=n.onAdd(this.webMap);o instanceof HTMLElement&&this.append(t,o)},t.prototype.append=function(t,n){var o=this._positionsContainers[t];if(o){if("string"==typeof n){var e=document.createElement("div");e.outerHTML=n,n=e}o.appendChild(n)}},t.prototype.createContainerElement=function(){var t=this,n=document.createElement("div");n.className=this.classPrefix+"-control-container"+(this.addClass?" "+this.addClass:"");return["top-right","top-left","bottom-right","bottom-left"].forEach((function(o){var e=t._createPositionContainer(o);t._positionsContainers[o]=e,n.appendChild(e)})),n},t.prototype._createPositionContainer=function(t){var n=document.createElement("div");return n.className=this.classPrefix+"-ctrl-"+t,n},t}();o.d(n,"ControlContainer",(function(){return e}));n.default=e}]).default}));
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@nextgis/dom"),require("!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js")):"function"==typeof define&&define.amd?define(["@nextgis/dom","!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"],n):"object"==typeof exports?exports.ControlContainer=n(require("@nextgis/dom"),require("!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js")):t.ControlContainer=n(t["@nextgis/dom"],t["!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"])}("undefined"!=typeof self?self:this,(function(t,n){return function(t){var n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)e.d(o,r,function(n){return t[n]}.bind(null,r));return o},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=12)}([function(n,e){n.exports=t},function(t,n,e){var o=e(2),r=e(3);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.i,r,""]]);var a={insert:"head",singleton:!1},i=(o(r,a),r.locals?r.locals:{});t.exports=i},function(t,e){t.exports=n},function(t,n,e){var o=e(4),r=e(5),a=e(6),i=e(7),c=e(8),p=e(9),l=e(10),b=e(11);n=o(!1);var s=r(a),u=r(i),m=r(c),d=r(p),g=r(l),w=r(b);n.push([t.i,"/* https: //github.com/mapbox/mapbox-gl-js/blob/master/src/css/mapbox-gl.css */\n.webmap-ctrl-top-left, .webmap-ctrl-top-right, .webmap-ctrl-bottom-left, .webmap-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n}\n\n.webmap-ctrl-top-left {\n top: 0;\n left: 0;\n}\n\n.webmap-ctrl-top-right {\n top: 0;\n right: 0;\n}\n\n.webmap-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n}\n\n.webmap-ctrl-bottom-right {\n right: 0;\n bottom: 0;\n}\n\n.webmap-ctrl {\n clear: both;\n pointer-events: auto;\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.webmap-ctrl-top-left .webmap-ctrl {\n margin: 10px 0 0 10px;\n float: left;\n}\n\n.webmap-ctrl-top-right .webmap-ctrl {\n margin: 10px 10px 0 0;\n float: right;\n}\n\n.webmap-ctrl-bottom-left .webmap-ctrl {\n margin: 0 0 10px 10px;\n float: left;\n}\n\n.webmap-ctrl-bottom-right .webmap-ctrl {\n margin: 0 10px 10px 0;\n float: right;\n}\n\n.webmap-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.webmap-ctrl-group:not(:empty) {\n -moz-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);\n -webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);\n box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);\n}\n\n@media (-ms-high-contrast: active) {\n .webmap-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.webmap-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.webmap-ctrl-group button+button {\n border-top: 1px solid #ddd;\n}\n\n.webmap-ctrl button .webmap-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .webmap-ctrl-icon {\n background-color: transparent;\n }\n .webmap-ctrl-group button+button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n\n.webmap-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.webmap-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgba(0, 150, 255, 1);\n}\n\n.webmap-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.webmap-ctrl button:disabled .webmap-ctrl-icon {\n opacity: 0.25;\n}\n\n.webmap-ctrl button:not(:disabled):hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.webmap-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgba(0, 150, 255, 1);\n}\n\n.webmap-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.webmap-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.webmap-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.webmap-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon {\n background-image: url("+s+");\n}\n\n.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon {\n background-image: url("+u+");\n}\n\n@media (-ms-high-contrast: active) {\n .webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon {\n background-image: url("+s+");\n }\n .webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon {\n background-image: url("+u+");\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon {\n background-image: url("+s+");\n }\n .webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon {\n background-image: url("+u+");\n }\n}\n\n.webmap-ctrl button.webmap-ctrl-fullscreen .webmap-ctrl-icon {\n background-image: url("+m+");\n}\n\n.webmap-ctrl button.webmap-ctrl-shrink .webmap-ctrl-icon {\n background-image: url("+d+");\n}\n\n@media (-ms-high-contrast: active) {\n .webmap-ctrl button.webmap-ctrl-fullscreen .webmap-ctrl-icon {\n background-image: url("+m+");\n }\n .webmap-ctrl button.webmap-ctrl-shrink .webmap-ctrl-icon {\n background-image: url("+d+");\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .webmap-ctrl button.webmap-ctrl-fullscreen .webmap-ctrl-icon {\n background-image: url("+m+");\n }\n .webmap-ctrl button.webmap-ctrl-shrink .webmap-ctrl-icon {\n background-image: url("+d+");\n }\n}\n\n.webmap-ctrl button.webmap-ctrl-compass .webmap-ctrl-icon {\n background-image: url("+g+");\n}\n\n@media (-ms-high-contrast: active) {\n .webmap-ctrl button.webmap-ctrl-compass .webmap-ctrl-icon {\n @url ctrl-compass-white url(svg/mapboxgl-ctrl-compass.svg) {\n fill: #fff;\n #south {\n fill: #999;\n }\n }\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .webmap-ctrl button.webmap-ctrl-compass .webmap-ctrl-icon {\n background-image: url("+g+");\n }\n}\n\n\n.webmap-ctrl.webmap-ctrl-attrib {\n padding: 0 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n}\n\n@media screen {\n .webmap-ctrl-attrib.webmap-compact {\n min-height: 20px;\n padding: 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n border-radius: 3px 12px 12px 3px;\n }\n .webmap-ctrl-attrib.webmap-compact:hover {\n padding: 2px 24px 2px 4px;\n visibility: visible;\n margin-top: 6px;\n }\n .webmap-ctrl-top-left>.webmap-ctrl-attrib.webmap-compact:hover, .webmap-ctrl-bottom-left>.webmap-ctrl-attrib.webmap-compact:hover {\n padding: 2px 4px 2px 24px;\n border-radius: 12px 3px 3px 12px;\n }\n .webmap-ctrl-attrib.webmap-compact .webmap-ctrl-attrib-inner {\n display: none;\n }\n .webmap-ctrl-attrib.webmap-compact:hover .webmap-ctrl-attrib-inner {\n display: block;\n }\n .webmap-ctrl-attrib.webmap-compact::after {\n content: '';\n cursor: pointer;\n position: absolute;\n background-image: url("+w+");\n background-color: rgba(255, 255, 255, 0.5);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n }\n .webmap-ctrl-bottom-right>.webmap-ctrl-attrib.webmap-compact::after {\n bottom: 0;\n right: 0;\n }\n .webmap-ctrl-top-right>.webmap-ctrl-attrib.webmap-compact::after {\n top: 0;\n right: 0;\n }\n .webmap-ctrl-top-left>.webmap-ctrl-attrib.webmap-compact::after {\n top: 0;\n left: 0;\n }\n .webmap-ctrl-bottom-left>.webmap-ctrl-attrib.webmap-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .webmap-ctrl-attrib.webmap-compact::after {\n background-image: url("+w+");\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .webmap-ctrl-attrib.webmap-compact::after {\n background-image: url("+w+");\n }\n}\n\n.webmap-ctrl-attrib a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n}\n\n.webmap-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n/* stylelint-disable-next-line selector-class-pattern */\n\n.webmap-ctrl-attrib .mapbox-improve-map {\n font-weight: bold;\n margin-left: 2px;\n}\n\n.webmap-attrib-empty {\n display: none;\n}\n\n.webmap-ctrl-scale {\n background-color: rgba(255, 255, 255, 0.75);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n",""]),t.exports=n},function(t,n,e){"use strict";t.exports=function(t){var n=[];return n.toString=function(){return this.map((function(n){var e=function(t,n){var e=t[1]||"",o=t[3];if(!o)return e;if(n&&"function"==typeof btoa){var r=(i=o,c=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),p="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(p," */")),a=o.sources.map((function(t){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(t," */")}));return[e].concat(a).concat([r]).join("\n")}var i,c,p;return[e].join("\n")}(n,t);return n[2]?"@media ".concat(n[2]," {").concat(e,"}"):e})).join("")},n.i=function(t,e,o){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(o)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(r[i]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);o&&r[p[0]]||(e&&(p[2]?p[2]="".concat(e," and ").concat(p[2]):p[2]=e),n.push(p))}},n}},function(t,n,e){"use strict";t.exports=function(t,n){return n||(n={}),"string"!=typeof(t=t&&t.__esModule?t.default:t)?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),n.hash&&(t+=n.hash),/["'() \t\n]/.test(t)||n.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t)}},function(t,n){t.exports="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjkiIGhlaWdodD0iMjkiIHZpZXdCb3g9IjAgMCAyOSAyOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0xMCAxM2MtLjc1IDAtMS41Ljc1LTEuNSAxLjVTOS4yNSAxNiAxMCAxNmg5Yy43NSAwIDEuNS0uNzUgMS41LTEuNVMxOS43NSAxMyAxOSAxM2gtOXoiLz4KPC9zdmc+"},function(t,n){t.exports="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjkiIGhlaWdodD0iMjkiIHZpZXdCb3g9IjAgMCAyOSAyOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0xNC41IDguNWMtLjc1IDAtMS41Ljc1LTEuNSAxLjV2M2gtM2MtLjc1IDAtMS41Ljc1LTEuNSAxLjVTOS4yNSAxNiAxMCAxNmgzdjNjMCAuNzUuNzUgMS41IDEuNSAxLjVTMTYgMTkuNzUgMTYgMTl2LTNoM2MuNzUgMCAxLjUtLjc1IDEuNS0xLjVTMTkuNzUgMTMgMTkgMTNoLTN2LTNjMC0uNzUtLjc1LTEuNS0xLjUtMS41eiIvPgo8L3N2Zz4K"},function(t,n){t.exports="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjkiIGhlaWdodD0iMjkiIHZpZXdCb3g9IjAgMCAyOSAyOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0yNCAxNnY1LjVjMCAxLjc1LS43NSAyLjUtMi41IDIuNUgxNnYtMWwzLTEuNS00LTUuNSAxLTEgNS41IDQgMS41LTNoMXpNNiAxNmwxLjUgMyA1LjUtNCAxIDEtNCA1LjUgMyAxLjV2MUg3LjVDNS43NSAyNCA1IDIzLjI1IDUgMjEuNVYxNmgxem03LTExdjFsLTMgMS41IDQgNS41LTEgMS01LjUtNEw2IDEzSDVWNy41QzUgNS43NSA1Ljc1IDUgNy41IDVIMTN6bTExIDIuNWMwLTEuNzUtLjc1LTIuNS0yLjUtMi41SDE2djFsMyAxLjUtNCA1LjUgMSAxIDUuNS00IDEuNSAzaDFWNy41eiIvPgo8L3N2Zz4K"},function(t,n){t.exports="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjkiIGhlaWdodD0iMjkiIHZpZXdCb3g9IjAgMCAyOSAyOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0xOC41IDE2Yy0xLjc1IDAtMi41Ljc1LTIuNSAyLjVWMjRoMWwxLjUtMyA1LjUgNCAxLTEtNC01LjUgMy0xLjV2LTFoLTUuNXpNMTMgMTguNWMwLTEuNzUtLjc1LTIuNS0yLjUtMi41SDV2MWwzIDEuNUw0IDI0bDEgMSA1LjUtNCAxLjUgM2gxdi01LjV6bTMtOGMwIDEuNzUuNzUgMi41IDIuNSAyLjVIMjR2LTFsLTMtMS41TDI1IDVsLTEtMS01LjUgNEwxNyA1aC0xdjUuNXpNMTAuNSAxM2MxLjc1IDAgMi41LS43NSAyLjUtMi41VjVoLTFsLTEuNSAzTDUgNCA0IDVsNCA1LjVMNSAxMnYxaDUuNXoiLz4KPC9zdmc+"},function(t,n){t.exports="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjkiIGhlaWdodD0iMjkiIHZpZXdCb3g9IjAgMCAyOSAyOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0xMC41IDE0bDQtOCA0IDhoLTh6Ii8+CiAgICA8cGF0aCBpZD0ic291dGgiIGQ9Ik0xMC41IDE2bDQgOCA0LThoLTh6IiBmaWxsPSIjY2NjIi8+Cjwvc3ZnPg=="},function(t,n){t.exports="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyMCAyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBhdGggZD0iTTQgMTBhNiA2IDAgMSAwIDEyIDAgNiA2IDAgMSAwLTEyIDBtNS0zYTEgMSAwIDEgMCAyIDAgMSAxIDAgMSAwLTIgMG0wIDNhMSAxIDAgMSAxIDIgMHYzYTEgMSAwIDEgMS0yIDAiLz4KPC9zdmc+Cg=="},function(t,n,e){"use strict";e.r(n);e(1);var o=e(0),r=function(){function t(){}return t.prototype.onAdd=function(t){if(this.webMap||(this.webMap=t),!this._container){var n=o.create("div","webmap-ctrl webmap-ctrl-group");this._container=n,this._createContent()}return this._container},t.prototype.onRemove=function(){this.webMap=void 0,this._container&&o.remove(this._container)},t.prototype._createContent=function(){var t=this;if(this._container){var n=o.create("button","webmap-ctrl-zoom-in",this._container);n.innerHTML='<span class="webmap-ctrl-icon" aria-hidden="true"></span>';var e=o.create("button","webmap-ctrl-zoom-out",this._container);e.innerHTML='<span class="webmap-ctrl-icon" aria-hidden="true"></span>',this._zoomInBtn=n,this.__onZoomInBtnClick=function(){return t._onZoomInBtnClick()},n.addEventListener("click",this.__onZoomInBtnClick),this._zoomOutBtn=e,this.__onZoomOutBtnClick=function(){return t._onZoomOutBtnClick()},e.addEventListener("click",this.__onZoomOutBtnClick)}},t.prototype._onZoomInBtnClick=function(){this.changeZoom()},t.prototype._onZoomOutBtnClick=function(){this.changeZoom(!0)},t.prototype.changeZoom=function(t){var n=this.webMap;if(n){var e=n.getZoom();if(e){var o=e+(t?-1:1);n.setZoom(o)}}},t}(),a=function(){function t(t){void 0===t&&(t={}),this.classPrefix="webmap",this._positionsContainers={"bottom-left":null,"bottom-right":null,"top-left":null,"top-right":null},this.classPrefix=t.classPrefix||this.classPrefix,this.addClass=t.addClass,this.webMap=t.webMap,this._container=this.createContainerElement()}return t.prototype.addTo=function(t){var n=o.getElement(t);return n&&n.appendChild(this._container),this},t.prototype.detach=function(){var t=this._container.parentElement;t&&t.removeChild(this._container)},t.prototype.getContainer=function(){return this._container},t.prototype.getPositionContainer=function(t){var n=this._positionsContainers[t];if(n)return n},t.prototype.newPositionContainer=function(t){var n=this.getPositionContainer(t);if(n){var e=document.createElement("div");return e.className="openlayers-ctrl",-1!==t.indexOf("bottom")&&n.childElementCount?n.insertBefore(e,n.firstChild):n.appendChild(e),e}},t.prototype.addControl=function(t,n){var e=t.onAdd(this.webMap);e instanceof HTMLElement&&this.append(e,n)},t.prototype.append=function(t,n){var e=this._positionsContainers[n];if(e){if("string"==typeof t){var o=document.createElement("div");o.outerHTML=t,t=o}e.appendChild(t)}},t.prototype.createContainerElement=function(){var t=this,n=document.createElement("div");n.className=this.classPrefix+"-control-container"+(this.addClass?" "+this.addClass:"");return["top-right","top-left","bottom-right","bottom-left"].forEach((function(e){var o=t._createPositionContainer(e);t._positionsContainers[e]=o,n.appendChild(o)})),n},t.prototype._createPositionContainer=function(t){var n=document.createElement("div");return n.className=this.classPrefix+"-ctrl-"+t,n},t.controls={ZOOM:r},t}();e.d(n,"ControlContainer",(function(){return a}));n.default=a}]).default}));
//# sourceMappingURL=control-container.js.map

@@ -0,3 +1,4 @@

import './ControlContainer.css';
import WebMap, { ControlPositions, MapControl } from '@nextgis/webmap';
import './ControlContainer.css';
import { ZoomControl } from './controls/ZoomControl';
export interface ControlContainerOptions {

@@ -10,2 +11,5 @@ target?: string;

export declare class ControlContainer {
static controls: {
ZOOM: typeof ZoomControl;
};
private readonly classPrefix;

@@ -17,3 +21,3 @@ private readonly addClass?;

constructor(opt?: ControlContainerOptions);
attach(el: HTMLElement | string): this;
addTo(el: HTMLElement | string): this;
detach(): void;

@@ -23,6 +27,6 @@ getContainer(): HTMLElement;

newPositionContainer(position: ControlPositions): HTMLElement | undefined;
addControl(position: ControlPositions, control: MapControl): void;
append(position: ControlPositions, element: HTMLElement | string): void;
addControl(control: MapControl, position: ControlPositions): void;
append(element: HTMLElement | string, position: ControlPositions): void;
private createContainerElement;
private _createPositionContainer;
}
import { ControlContainer, ControlContainerOptions } from './ControlContainer';
export { ControlContainer, ControlContainerOptions };
export default ControlContainer;
{
"name": "@nextgis/control-container",
"version": "0.27.0",
"description": "Hierarchical layers control",
"version": "0.27.1",
"description": "Placing control elements in the corners of the map container",
"main": "lib/control-container.js",

@@ -9,2 +9,5 @@ "unpkg": "lib/control-container.js",

"dependencies": {
"@nextgis/dom": "^0.27.1",
"@nextgis/utils": "^0.27.1",
"@nextgis/webmap": "^0.27.1",
"events": "^3.1.0"

@@ -19,2 +22,3 @@ },

"style-loader": "^1.1.3",
"svg-inline-loader": "^0.8.2",
"ts-loader": "^6.2.1",

@@ -53,3 +57,4 @@ "typescript": "^3.8.3",

"url": "https://github.com/nextgis/nextgisweb_frontend/issues"
}
},
"gitHead": "4719c4dab8d37f108630fdd8dfa7194bcec4380a"
}

@@ -19,3 +19,3 @@ # Control Container

Use Item with NPM installation method for building large scale applications. It pairs nicely with module bundlers such as [Webpack](https://webpack.js.org/)
## Installation

@@ -29,2 +29,4 @@ ```bash

## Usage
```js

@@ -37,8 +39,8 @@ import ControlContainer from '@nextgis/control-container';

const controlContainer = new ControlContainer({ map: webMap });
controlContainer.attach('.map-control-class');
controlContainer.addTo('.map-control-class');
// add simple HTML string
controlContainer.append('top-right', '<div>HTML</div>');
controlContainer.append('<div>HTML</div>', 'top-right');
// or HTML element
controlContainer.append('top-right', HTMLElement);
controlContainer.append(HTMLElement, 'top-right');

@@ -55,3 +57,3 @@ // add control

}
controlContainer.addControl('bottom-right', control);
controlContainer.addControl(control, 'bottom-right');
```

@@ -58,0 +60,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc