(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pvm_MglButtonControl"],{"6e51":function(t,n,e){},"81e1":function(t,n,e){"use strict";n["a"]={methods:{$_emitSelfEvent(t,n={}){this.$_emitMapEvent(t,{control:this.control,...n})},$_bindSelfEvents(t,n){Object.keys(this.$listeners).forEach(e=>{t.includes(e)&&n.on(e,this.$_emitSelfEvent)})},$_unbindSelfEvents(t,n){0!==t.length&&n&&t.forEach(t=>{n.off(t,this.$_emitSelfEvent)})}}}},"9f0b":function(t,n,e){"use strict";n["a"]={methods:{$_emitEvent(t,n={}){this.$emit(t,{map:this.map,component:this,...n})},$_emitMapEvent(t,n={}){this.$_emitEvent(t.type,{mapboxEvent:t,...n})}}}},aa65:function(t,n,e){"use strict";var i=e("9f0b"),o=e("81e1");n["a"]={mixins:[i["a"],o["a"]],inject:["mapbox","map","actions"],props:{position:{type:String,default:"top-right"}},beforeDestroy(){this.map&&this.control&&this.map.removeControl(this.control)},methods:{$_addControl(){try{this.map.addControl(this.control,this.position)}catch(t){return void this.$_emitEvent("error",{error:t})}this.$_emitEvent("added",{control:this.control})}},render(){}}},df5b:function(t,n,e){"use strict";e.r(n);var i,o,s=e("d4ec"),a=e("bee2"),c=e("aa65"),r={name:"ButtonControl",mixins:[c["a"]],props:{buttonText:{type:String,default:""},buttonId:{type:String,default:"button-id"},buttonClass:{type:String,default:""},imageLink:{type:String,default:""},imageAlign:{type:String,default:"middle"}},computed:{classTest:function(){return"button-control active"}},watch:{buttonClass:function(t){var n=document.getElementById(this.$props.buttonId);n.className="button-control "+t},imageLink:function(t){var n=document.getElementById(this.$props.buttonId+"-img");console.log("watch imageLink, imageItem:",n,"nextImageLink:",t),n.src=t}},mounted:function(){var t=function(){function t(){Object(s["a"])(this,t)}return Object(a["a"])(t,[{key:"onAdd",value:function(t){if(this.container=document.createElement("div"),this.container.className="button-control "+n.buttonClass,this.container.id=n.buttonId,n.buttonText&&(this.container.textContent=n.buttonText),n.imageLink){var e=document.createElement("img");e.id=n.buttonId+"-img","top"===n.imageAlign?e.className="button-image-top":e.className="button-image-middle",e.src=n.imageLink,this.container.appendChild(e)}return this.container}},{key:"onRemove",value:function(t){this.container.parentNode.removeChild(this.container)}}]),t}(),n=Object.assign({},this.$props);this.control=new t(n),this.$_addControl();var e=document.getElementById(n.buttonId);e.onclick=function(t){this.buttonClicked()}.bind(this)},methods:{buttonClicked:function(){this.$emit("click")}}},u=r,l=(e("f336"),e("2877")),m=Object(l["a"])(u,i,o,!1,null,null,null);n["default"]=m.exports},f336:function(t,n,e){"use strict";var i=e("6e51"),o=e.n(i);o.a}}]);
//# sourceMappingURL=pvm_MglButtonControl.b6f9cbbb.js.map