PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.9.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.9.1
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 1.1.2 All 80 releases
ablocks / assets / build / blocks / map / view.js

view.js in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.9.1, at assets/build/blocks/map/view.js

1 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 document.addEventListener("DOMContentLoaded",(function(){if(window?.ABlocksGlobal&&window?.ABlocksGlobal?.is_gutenberg_editor)return;const o=document.querySelectorAll(".ablocks-map-block");o.length&&o.forEach((o=>{((o,t)=>{const e=t.iconHeight,n=t.iconWidth,r=L.layerGroup();t.mapMarkerList.forEach((function(o){let i="";if(""!==o.title&&(i+="<h6>"+o.title+"</h6>"),""!==o.content&&(i+="<p>"+(o=>{const t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#039;":"'"};return o.replace(/&amp;|&lt;|&gt;|&quot;|&#039;/g,(function(o){return t[o]}))})(o.content)+"</p>"),"custom"===o.iconType){const t=new(L.Icon.extend({options:{iconSize:[o.customIconWidth,o.customIconHeight],popupAnchor:[0,-15]}}))({iconUrl:o.customIconUrl});""!==o.title||""!==o.content?L.marker([o.lat,o.lng],{icon:t}).bindPopup(i).addTo(r):L.marker([o.lat,o.lng],{icon:t}).addTo(r)}else""!==o.title||""!==o.content?L.marker([o.lat,o.lng],{icon:new L.Icon({iconUrl:t?.defaultMarkerIcon,iconSize:[n,e],popupAnchor:[0,-15]})}).bindPopup(i).addTo(r):L.marker([o.lat,o.lng],{icon:new L.Icon({iconUrl:t?.defaultMarkerIcon,iconSize:[n,e],popupAnchor:[0,-15]})}).addTo(r)}));const i="OSM"===t.mapType?"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png":"https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i349018013!3m9!2sen-US!3sUS!5e18!12m1!1e47!12m3!1e37!2m1!1ssmartmaps!4e0",a="GM_SATELLITE"===t.mapType?"https://maps.googleapis.com/maps/vt?lyrs=s&x={x}&y={y}&z={z}&key=YOUR_API_KEY":i,c=L.tileLayer(a,{id:"mapbox/light-v9"}),l={zoom:t.mapZoom,zoomControl:!1,layers:[c,r],scrollWheelZoom:t.scrollWheelZoom,dragging:!L.Browser.mobile,tap:!L.Browser.mobile};t.mapMarkerList.length&&t.mapMarkerList[t.centerIndex]&&(l.center=[t.mapMarkerList[t.centerIndex].lat,t.mapMarkerList[t.centerIndex].lng]);const p=L.map(o,l);p.addControl(new L.Control.Fullscreen({position:"topleft"})),L.control.zoom({position:"topright"}).addTo(p)})(o,JSON.parse(o.getAttribute("data-settings")))}))}));