PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 81 releases
ablocks / assets / build / ablocks-leaflet.js

ablocks-leaflet.js in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.14.0, at assets/build/ablocks-leaflet.js

3 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";(globalThis.webpackChunkacademy_blocks=globalThis.webpackChunkacademy_blocks||[]).push([[6758],{52577(e,n,o){o.r(n),o.d(n,{default:()=>I});var t=o(51609),c=o.n(t),r=o(63748),i=o(66162),s=o(36543),a=o(53481),l=o.n(a);const u=(0,s.T7)(function(e){return new a.Control.Zoom(e)});var p=o(81344),m=o(14489),d=o(56667);const f=(0,s.wk)(function(e,n){const o=new a.Popup(e,n.overlayContainer);return(0,d.Q)(o,n)},function(e,n,{position:o},c){(0,t.useEffect)(function(){const{instance:t}=e;function r(e){e.popup===t&&(t.update(),c(!0))}function i(e){e.popup===t&&c(!1)}return n.map.on({popupopen:r,popupclose:i}),null==n.overlayContainer?(null!=o&&t.setLatLng(o),t.openOn(n.map)):n.overlayContainer.bindPopup(t),function(){n.map.off({popupopen:r,popupclose:i}),n.overlayContainer?.unbindPopup(),n.map.removeLayer(t)}},[e,n,c,o])});o(72189);var h=o(46804),b=o(39387),g=o(36168),k=o(10790);function I(e){const{attributes:n}=e,{block_id:o}=n,s=(0,t.useRef)(null),a=(0,
2 t.useRef)(),{mapWidth:d,mapHeight:I,mapMarkerList:v,centerIndex:x,mapType:j,mapZoom:y,scrollWheelZoom:E,iconHeight:T,iconWidth:C}=n,L=n?.iconImageUrl,_="GM"===j?h.GM:h.AW;return(0,t.useEffect)(()=>{a.current&&a.current.invalidateSize()},[d?.value,I?.value]),(0,t.useEffect)(()=>{s.current&&s.current.setUrl("GM_SATELLITE"===j?h.Dc:_)},[j]),(0,t.useEffect)(()=>{a.current&&(a.current.setView((0,h.I3)(v,x)),a.current.setZoom(y))},[x,y,v]),(0,t.useEffect)(()=>{v.forEach(e=>{const n=v?.findIndex(n=>n.id===e.id);-1!==n&&(v[n].customIconHeight=T,v[n].customIconWidth=C)})},[T,C]),(0,k.jsx)(c().Fragment,{children:(0,k.jsx)(b.A,{blockId:o,name:r.UU,attributes:n,children:(0,k.jsx)("div",{className:"ablocks-block-map-base-editor",children:(0,k.jsxs)(i.W,{id:o,className:"ablocks-block-map-base-editor__map-container",center:(0,h.I3)(v,x),zoom:y,scrollWheelZoom:E,zoomControl:!1,dragging:!1,fullscreenControl:!1,ref:a,children:[(0,k.jsx)(u,{position:"topright"}),(0,k.jsx)(p.e,{ref:s,
3 url:"GM_SATELLITE"===j?h.Dc:_}),v.map((e,n)=>(0,k.jsx)(m.p,{position:{lat:e.lat,lng:e.lng,zoom:10},icon:new(l().Icon)({iconUrl:e.customIconUrl||L||g.hq+"assets/images/marker-icon.png",iconSize:[e.customIconWidth,e.customIconHeight],popupAnchor:[0,-15]}),children:""!==e.title||""!==e.content?(0,k.jsxs)(f,{children:[(0,k.jsx)("h6",{children:e.title}),(0,k.jsx)("p",{dangerouslySetInnerHTML:{__html:e.content}})]}):null},n))]})})})})}I.propTypes={}}}]);