|
1
|
|
-!function(){var t=window.WPLeafletMapPlugin;if(window.WPLeafletMapPlugin=new function(){var t=!1,n=[];this.push=function(e){t?e():n.push(e)},this.unshift=function(e){t?e():n.unshift(e)},this.init=function(){t=!0;for(var e=0,i=n.length;e<i;e++)n[e]()},this.getCurrentMap=function(){return this.maps[this.maps.length-1]},this.getCurrentGroup=function(){var t=this.maps.length;return this.markergroups[t]||(this.markergroups[t]=this.newMarkerGroup(this.maps[t-1])),this.markergroups[t]},this.getCurrentMarkerGroup=this.getCurrentGroup,this.getGroup=function(t){return(new L.FeatureGroup).addTo(t)},this.newMarkerGroup=function(t){var n=this.getGroup(t);return n.timeout=null,t._shouldFitBounds&&n.on("layeradd",(function(e){e.layer instanceof L.FeatureGroup&&e.layer.on("ready",(function(){t.fitBounds(n.getBounds())})),window.clearTimeout(this.timeout),this.timeout=window.setTimeout((function(){try{t.fitBounds(n.getBounds())}catch(t){}}),100)}),n),n};var e=this.unescape=function(t){var n=document.createElement("div");return n.innerHTML=t,n.innerText},i=/\{ *(.*?) *\}/g;this.template=function(t,n){return t.replace(i,(function(t,i){var o=function(t,n){for(var i=function(t){for(var n=t.split(r),e=[],i=0,o=n.length;i<o;i++)""!==n[i]&&e.push(n[i]);return e}(e(n)),o=t,u=0,s=i.length;u<s;u++)if(!(o=o[i[u]]))return;return o}(n,i);return void 0===o?t:o}))};var r=/[.‘’'“”"\[\]]+/g;this.maps=[],this.images=[],this.markergroups={},this.markers=[],this.lines=[],this.polygons=[],this.circles=[],this.geojsons=[]},t){for(var n=0,e=t.length;n<e;n++)window.WPLeafletMapPlugin.push(t[n]);for(var i in t.splice(0),t)t.hasOwnProperty(i)&&(window.WPLeafletMapPlugin[i]=t[i])}window.addEventListener?window.addEventListener("load",window.WPLeafletMapPlugin.init,!1):window.attachEvent&&window.attachEvent("onload",window.WPLeafletMapPlugin.init)}(); |
|
1
|
+(function(){function y(){var m="v3.4.5";this.VERSION=m;function v(t){try{t()}catch(n){console.log("-- version --",m),console.error(n)}}var g=!1,f=[];this.push=function(t){g?v(t):f.push(t)},this.unshift=function(t){g?v(t):f.unshift(t)},this.init=function(){g=!0;for(var t=0,n=f.length;t<n;t++)v(f[t])},this.createMap=function(t){var n=document.getElementsByClassName("WPLeafletMap"),e=this.maps.length,i=n[e],r=L.map(i,t);return t.fitBounds&&(r._shouldFitBounds=!0),t.attribution&&T(t.attribution,r),this.maps.push(r),r},this.createImageMap=function(t){var n=this.createMap(t);return n.is_image_map=!0,this.images.push(n),n},this.getCurrentMap=function(){return this.maps[this.maps.length-1]},this.getCurrentGroup=function(){var t=this.maps.length;return this.markergroups[t]||(this.markergroups[t]=this.newMarkerGroup(this.maps[t-1])),this.markergroups[t]},this.getCurrentMarkerGroup=this.getCurrentGroup,this.getGroup=function(t){return new L.FeatureGroup().addTo(t)},this.newMarkerGroup=function(t){var n=this.getGroup(t);return n.timeout=null,t._shouldFitBounds&&n.on("layeradd",function(e){e.layer instanceof L.FeatureGroup&&e.layer.on("ready",function(){t.fitBounds(n.getBounds())}),window.clearTimeout(this.timeout),this.timeout=window.setTimeout(function(){try{t.fitBounds(n.getBounds())}catch{}},100)},n),n},this.propsToTable=function(t){var n,e=[];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);e=e.sort();for(var i="<table>",r=0,a=e.length;r<a;r++){var o=e[r];i+="<tr><td>"+o+"</td>",i+="<td>"+t[o]+"</td></tr>"}return i+="</table>",i};function P(t){return t.trim()}function T(t,n){if(t)for(var e=t.split(";"),i=L.control.attribution({prefix:!1}).addTo(n),r=0,a=e.length;r<a;r++){var o=P(e[r]);i.addAttribution(o)}}var b=this.unescape=function(t){var n=document.createElement("div");return n.innerHTML=t,n.innerText||t},G=/\{ *(.*?) *\}/g;this.template=function(t,n){return n==null?t:t.replace(G,function(e,i){var r=E(i),a=k(n,r.key);return a??(r.default||e)})};var A=/[.‘’'“”"\[\]]+/g;function S(t){if(t==null)return[];for(var n=t.split(A),e=[],i=0,r=n.length;i<r;i++)n[i]!==""&&e.push(n[i]);return e}function k(t,n){for(var e=S(b(n)),i=t,r=0,a=e.length;r<a;r++)if(i=i[e[r]],!i)return;return i}function E(t){for(var n=t.split(" | "),e={},i=n.shift(),r=0,a=n.length;r<a;r++){var o=n[r].split(": "),h=o.shift(),s=o.join(": ")||!0;e[h]=s}return e.key=i,e}function w(t,n){typeof L<"u"&&typeof L[t]<"u"?n():setTimeout(function(){w(t,n)},100)}this.waitForSVG=function(t){w("SVGIcon",t)},this.waitForAjax=function(t){w("AjaxGeoJSON",t)},this.createScale=function(t){L.control.scale(t).addTo(this.getCurrentMap())},this.getIconOptions=function(t){for(var n=t||{},e=["iconSize","iconAnchor","shadowSize","shadowAnchor","popupAnchor","tooltipAnchor"],i=L.Icon.Default.prototype.options,r=0,a=e.length;r<a;r++){var o=e[r],h=n[o];if(h){for(var s=h.split(","),c=0,B=s.length;c<B;c++)s[c]=Number(s[c]);n[o]=s}}return n.popupAnchor||(n.popupAnchor=function(l){return l=l.slice(),l[0]=0,l[1]*=-1,l[1]-=3,l}(n.iconSize||i.iconSize)),n.iconUrl&&(n.icon=new L.Icon(n)),n},this.maps=[],this.images=[],this.markergroups={},this.markers=[],this.lines=[],this.polygons=[],this.circles=[],this.geojsons=[],this.overlays=[]}var u=window.WPLeafletMapPlugin;if(window.WPLeafletMapPlugin=new y,u){for(var p=0,M=u.length;p<M;p++)window.WPLeafletMapPlugin.push(u[p]);u.splice(0);for(var d in u)u.hasOwnProperty(d)&&(window.WPLeafletMapPlugin[d]=u[d])}window.addEventListener?window.addEventListener("load",window.WPLeafletMapPlugin.init,!1):window.attachEvent&&window.attachEvent("onload",window.WPLeafletMapPlugin.init)})(); |