PageSourceSearch

https://www.pirineo-frances.es/app/dist/pyreneesbearnaises/addons/…on-touristicmaps-map-manager.8a65559605.mjs

js pirineo-frances.es collected 2026-09-26 12:47:14 UTC 3,428 bytes, 3 lines download raw bytes

1class l{#i;#t={};#e=null;setMapComponent(i){this.#i=i}getDetachedPopup(){return this.#e}parseMarkerModelConfig(i){let t={};const e=i?.popup_mode==="detached";e&&this.#o(),i?.clickable==!0&&(t.onclick=o=>{e&&this.#e&&this.#e.open(o.popup_html||null),this.#i.dispatchEvent(new CustomEvent("pinclick",{detail:o}))}),t.name=o=>o.name,t.popup=(o,p,n)=>{if(e||!o.popup_html||o.popup_html==null||o.popup_html=="")return null;const r=document.createElement("div");r.classList.add("popup"),r.classList.add("woody-pin-popup"),r.innerHTML=`${o.popup_html}`;const a=document.createElement("button");return a.addEventListener("click",n),a.classList.add("popup-close"),a.classList.add("woody-pin-popup-close"),a.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewbox="0 0 40 40">
2                <path d="M10,10L30,30M30,10L10,30" stroke-width="4"/>
3            </svg>`,r.appendChild(a),r},t.tooltip=o=>{if(!o.tooltip_html||o.tooltip_html==null||o.tooltip_html=="")return null;const p=document.createElement("div");return p.classList.add("tooltip"),p.classList.add("woody-pin-tooltip"),p.innerHTML=`${o.tooltip_html}`,p};const s=Object.assign(i,{default:Object.assign(i.default,t)});return this.#t={},s.pins.forEach((o,p)=>{if(o.lat===null||o.lon===void 0){console.error("MapManager - parseMarkerModelConfig - pin.lat|lon missed");return}const n=this.getLocationMappingKey(o.lat,o.lon);this.#t[n]!=null?console.warn("MapManager - parseMarkerModelConfig - duplicate pin index in pinsLocationMapping (multiple pin have same location)"):this.#t[n]=p}),s}parseGeojson(i){typeof i=="string"&&(i=JSON.parse(i));const t=window.getComputedStyle(document.body);return i.features=i.features.map(e=>{if(e.properties.fill){const s=this.getCssVariableValue(t,e.properties.fill);e.properties.fill=s}return e.properties["fill-opacity"]&&(e.properties["fill-opacity"]=this.getCssVariableValue(t,e.properties["fill-opacity"])),e.properties.stroke&&(e.properties.stroke=this.getCssVariableValue(t,e.properties.stroke)),e.properties["stroke-width"]&&(e.properties["stroke-width"]=parseFloat(this.getCssVariableValue(t,e.properties["stroke-width"]))),e.properties["stroke-opacity"]&&(e.properties["stroke-opacity"]=parseFloat(this.getCssVariableValue(t,e.properties["stroke-opacity"]))),e}),i}getCssVariableValue(i,t){if(!t||typeof t!="string")return t;if(t=t.trim(),t.startsWith("--"))return i.getPropertyValue(t).trim()||t;const e=/^var\(\s*(--[a-zA-Z0-9-_]+)\s*(?:,\s*(.+))?\)$/;let s=0;for(;s<10;){const o=t.match(e);if(!o)break;const p=o[1],n=o[2];let r=i.getPropertyValue(p).trim();if(r)t=r.trim();else if(n)t=n.trim();else break;s++}return t}__getCssVariableValue(i,t){if(t&&typeof t=="string"){t.startsWith("--")&&(t=i.getPropertyValue(t).trim()||t);const e=t.trim().match(/^var\((--[^)]+)\)$/);if(e){const s=i.getPropertyValue(e[1]);if(s&&s!=="")return s}}return t}getMappedPinIndexForLocation(i,t){const e=this.getLocationMappingKey(i,t),s=this.#t[e];return s==null&&console.warn("MapManager - getPinIndexForLocation - pinIndex not found for key : ",e," - in mapping : ",this.#t),s}getLocationMappingKey(i,t){return JSON.stringify({lat:parseFloat(i),lng:parseFloat(t)})}#o(){if(this.#e)return;const i=this.#i?.parentElement;if(!i){console.warn("MapManager - ensureDetachedPopup - no parent element to host the popup");return}
3const t=document.createElement("woody-map-popup");i.appendChild(t),this.#e=t}}export{l as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.