Your IP : 3.145.105.116


Current Path : /var/www/u0635749/data/www/hobbyclick.ru/public/hobbyclick/bitrix/js/landing/node/
Upload File :
Current File : /var/www/u0635749/data/www/hobbyclick.ru/public/hobbyclick/bitrix/js/landing/node/map.min.js

(function(){"use strict";BX.namespace("BX.Landing");var a=BX.Landing.Utils.debounce;var t=BX.Landing.Utils.data;var e=BX.Landing.Utils.proxy;var n=BX.Landing.Utils.onCustomEvent;var i=BX.Landing.Utils.encodeDataValue;BX.Landing.Block.Node.Map=function(i){BX.Landing.Block.Node.apply(this,arguments);this.type="map";this.attribute="data-map";this.hidden=true;this.map=new BX.Landing.Provider.Map.GoogleMap({mapContainer:this.node,mapOptions:t(this.node,"data-map"),theme:t(this.node,"data-map-theme"),roads:t(this.node,"data-map-roads")||[],landmarks:t(this.node,"data-map-landmarks")||[],labels:t(this.node,"data-map-labels")||[],onMapClick:e(this.onMapClick,this),onChange:a(this.onChange,500,this),fullscreenControl:false,mapTypeControl:false});this.lastValue=this.getValue();n("BX.Landing.Block:updateStyleWithoutDebounce",this.onBlockUpdateStyles.bind(this));n("BX.Landing.Block:Node:updateAttr",this.onBlockUpdateAttrs.bind(this))};BX.Landing.Block.Node.Map.prototype={constructor:BX.Landing.Block.Node.Map,__proto__:BX.Landing.Block.Node.prototype,onBlockUpdateAttrs:function(n){if(n.node===this.node){this.map=new BX.Landing.Provider.Map.GoogleMap({mapContainer:this.node,mapOptions:t(this.node,"data-map"),theme:t(this.node,"data-map-theme"),roads:t(this.node,"data-map-roads")||[],landmarks:t(this.node,"data-map-landmarks")||[],labels:t(this.node,"data-map-labels")||[],onMapClick:e(this.onMapClick,this),onChange:a(this.onChange,500,this),fullscreenControl:false,mapTypeControl:false});this.lastValue=this.getValue()}},onBlockUpdateStyles:function(n){if(n.block.contains(this.node)){this.map=new BX.Landing.Provider.Map.GoogleMap({mapContainer:this.node,mapOptions:t(this.node,"data-map"),theme:t(this.node,"data-map-theme"),roads:t(this.node,"data-map-roads")||[],landmarks:t(this.node,"data-map-landmarks")||[],labels:t(this.node,"data-map-labels")||[],onMapClick:e(this.onMapClick,this),onChange:a(this.onChange,500,this),fullscreenControl:false,mapTypeControl:false});this.lastValue=this.getValue()}},onMapClick:function(a){if(BX.Landing.UI.Panel.StylePanel.getInstance().isShown()){return}this.map.addMarker({latLng:a.latLng,title:"",description:"",showByDefault:false,draggable:true,editable:true});this.map.onMarkerClick(this.map.markers[this.map.markers.length-1])},onChange:function(a){if(this.isChanged()){if(!a){BX.Landing.History.getInstance().push(new BX.Landing.History.Entry({block:this.getBlock().id,selector:this.selector,command:"editEmbed",undo:this.lastValue,redo:this.getValue()}))}this.lastValue=this.getValue();this.onChangeHandler(this)}},isChanged:function(){return JSON.stringify(this.getValue())!==JSON.stringify(this.lastValue)},getValue:function(){return this.map.getValue()},getAttrValue:function(){return i(this.getValue())},setValue:function(a,t,e){this.map.setValue(a,e)},getField:function(){return new BX.Landing.UI.Field.BaseField({selector:this.selector,hidden:true})}}})();
//# sourceMappingURL=map.map.js