Your IP : 3.133.124.52


Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/node/map/dist/
Upload File :
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/node/map/dist/map.bundle.js.map

{"version":3,"file":"map.bundle.js","sources":["../src/map.js"],"sourcesContent":["import { Base } from 'landing.node.base';\n\nconst debounce = BX.Landing.Utils.debounce;\nconst data = BX.Landing.Utils.data;\nconst proxy = BX.Landing.Utils.proxy;\nconst onCustomEvent = BX.Landing.Utils.onCustomEvent;\nconst encodeDataValue = BX.Landing.Utils.encodeDataValue;\n\nexport class Map extends Base\n{\n\tconstructor(options)\n\t{\n\t\tsuper(options);\n\n\t\tthis.type = 'map';\n\t\tthis.attribute = 'data-map';\n\t\tthis.hidden = true;\n\t\tthis.createMap();\n\t\tthis.lastValue = this.getValue();\n\t\tthis.onBlockUpdateAttrs = this.onBlockUpdateAttrs.bind(this);\n\t\tonCustomEvent('BX.Landing.Block:Node:updateAttr', this.onBlockUpdateAttrs);\n\t}\n\n\tcreateMap()\n\t{\n\t\tthis.mapOptions = {\n\t\t\tmapContainer: this.node,\n\t\t\tmapOptions: data(this.node, 'data-map'),\n\t\t\ttheme: data(this.node, 'data-map-theme'),\n\t\t\troads: data(this.node, 'data-map-roads') || [],\n\t\t\tlandmarks: data(this.node, 'data-map-landmarks') || [],\n\t\t\tlabels: data(this.node, 'data-map-labels') || [],\n\t\t\tonMapClick: proxy(this.onMapClick, this),\n\t\t\tonChange: debounce(this.onChange, 500, this),\n\t\t\tfullscreenControl: false,\n\t\t\tmapTypeControl: false,\n\t\t\tzoomControl: false,\n\t\t};\n\t\tthis.map = BX.Landing.Provider.Map.create(this.node, this.mapOptions);\n\t}\n\n\treInitMap()\n\t{\n\t\tconst prevOptions = BX.Runtime.clone(this.mapOptions);\n\n\t\tthis.mapOptions.mapOptions = data(this.node, 'data-map');\n\t\tthis.mapOptions.theme = data(this.node, 'data-map-theme');\n\t\tthis.mapOptions.roads = data(this.node, 'data-map-roads') || [];\n\t\tthis.mapOptions.landmarks = data(this.node, 'data-map-landmarks') || [];\n\t\tthis.mapOptions.labels = data(this.node, 'data-map-labels') || [];\n\n\t\tif (prevOptions !== this.mapOptions)\n\t\t{\n\t\t\tthis.map.reinit(this.mapOptions);\n\t\t}\n\t}\n\n\tonBlockUpdateAttrs(event)\n\t{\n\t\tif (event.node === this.node)\n\t\t{\n\t\t\tthis.reInitMap();\n\t\t\tthis.lastValue = this.getValue();\n\t\t}\n\t}\n\n\tonMapClick(event)\n\t{\n\t\tif (BX.Landing.UI.Panel.StylePanel.getInstance().isShown())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.map.addMarker({\n\t\t\tlatLng: this.map.getPointByEvent(event),\n\t\t\ttitle: '',\n\t\t\tdescription: '',\n\t\t\tshowByDefault: false,\n\t\t\tdraggable: true,\n\t\t\teditable: true,\n\t\t});\n\n\t\tthis.map.onMarkerClick(this.map.markers[this.map.markers.length - 1]);\n\t}\n\n\tonChange(preventHistory)\n\t{\n\t\tif (this.isChanged())\n\t\t{\n\t\t\tif (!preventHistory)\n\t\t\t{\n\t\t\t\tBX.Landing.History.getInstance().push();\n\t\t\t}\n\n\t\t\tthis.lastValue = this.getValue();\n\t\t\tthis.onChangeHandler(this, preventHistory);\n\t\t}\n\t}\n\n\tisChanged(): boolean\n\t{\n\t\treturn JSON.stringify(this.getValue()) !== JSON.stringify(this.lastValue);\n\t}\n\n\tgetValue(): string | null\n\t{\n\t\treturn this.map && this.map.isApiLoaded()\n\t\t\t? this.map.getValue()\n\t\t\t: null;\n\t}\n\n\tgetAttrValue(): string\n\t{\n\t\treturn encodeDataValue(this.getValue());\n\t}\n\n\tsetValue(value, preventSave, preventHistory)\n\t{\n\t\tthis.map.setValue(value, preventHistory);\n\t}\n\n\tgetField(): BX.Landing.UI.Field.BaseField\n\t{\n\t\treturn new BX.Landing.UI.Field.BaseField({\n\t\t\tselector: this.selector,\n\t\t\thidden: true,\n\t\t});\n\t}\n}\n\nBX.Landing.Node.Map = Map;\n"],"names":["debounce","BX","Landing","Utils","data","proxy","onCustomEvent","encodeDataValue","Map","Base","constructor","options","type","attribute","hidden","createMap","lastValue","getValue","onBlockUpdateAttrs","bind","mapOptions","mapContainer","node","theme","roads","landmarks","labels","onMapClick","onChange","fullscreenControl","mapTypeControl","zoomControl","map","Provider","create","reInitMap","prevOptions","Runtime","clone","reinit","event","UI","Panel","StylePanel","getInstance","isShown","addMarker","latLng","getPointByEvent","title","description","showByDefault","draggable","editable","onMarkerClick","markers","length","preventHistory","isChanged","History","push","onChangeHandler","JSON","stringify","isApiLoaded","getAttrValue","setValue","value","preventSave","getField","Field","BaseField","selector","Node"],"mappings":";;;;;CAEA,MAAMA,QAAQ,GAAGC,EAAE,CAACC,OAAO,CAACC,KAAK,CAACH,QAAQ;CAC1C,MAAMI,IAAI,GAAGH,EAAE,CAACC,OAAO,CAACC,KAAK,CAACC,IAAI;CAClC,MAAMC,KAAK,GAAGJ,EAAE,CAACC,OAAO,CAACC,KAAK,CAACE,KAAK;CACpC,MAAMC,aAAa,GAAGL,EAAE,CAACC,OAAO,CAACC,KAAK,CAACG,aAAa;CACpD,MAAMC,eAAe,GAAGN,EAAE,CAACC,OAAO,CAACC,KAAK,CAACI,eAAe;AAExD,CAAO,MAAMC,GAAG,SAASC,sBAAI,CAC7B;GACCC,WAAW,CAACC,OAAO,EACnB;KACC,KAAK,CAACA,OAAO,CAAC;KAEd,IAAI,CAACC,IAAI,GAAG,KAAK;KACjB,IAAI,CAACC,SAAS,GAAG,UAAU;KAC3B,IAAI,CAACC,MAAM,GAAG,IAAI;KAClB,IAAI,CAACC,SAAS,EAAE;KAChB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACC,QAAQ,EAAE;KAChC,IAAI,CAACC,kBAAkB,GAAG,IAAI,CAACA,kBAAkB,CAACC,IAAI,CAAC,IAAI,CAAC;KAC5Db,aAAa,CAAC,kCAAkC,EAAE,IAAI,CAACY,kBAAkB,C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