PageSourceSearch

https://assets.hiiker.app/vite/assets/BaseMapDataPOIsModule-CO3_Ekrx.js

js hiiker.app collected 2026-10-02 05:33:59 UTC 8,881 bytes, 3 lines download raw bytes

1import{P as y}from"./POI-BnpnFnNO.js";import{e as f}from"./entrypoints/pdf.ts-DDuZt5yk.js";import{M as b}from"./layer-registry-Q9ygAVsT.js";import{i as A}from"./index-B13lFBcW.js";function I(e){return!!(e.length>0&&e[0].source.includes("waypoint"))}const T=15;function k(e){let o;try{o=new URL(e).searchParams}catch{return null}const t=o.get("poi_id"),i=o.get("poi_class");return!t||!i?null:{id:t,klass:i,type:o.get("poi")||null,lat:w(o.get("lat")),lng:w(o.get("lng"))}}function w(e){if(e===null||e.trim()==="")return null;const o=Number(e);return Number.isFinite(o)?o:null}function O(e){return!e||e.lat===null||e.lng===null?null:[e.lng,e.lat]}function L(e){const o=Number(e);return Number.isFinite(o)?Math.max(o,T):T}function D(e,o){if(!e||!e.type)return null;const t=Array.isArray(o)?o.filter(Boolean):[];return t.includes(e.type)?t:[...t,e.type]}function S(e,o){if(!e)return null;const t=e.shareUrl||e.share_url;if(typeof t=="string"&&t.length>0)return t;const i=C(e);return i?`${typeof window<"u"?window.location.origin:""}${i}`:null}function C(e){const o=e==null?void 0:e.id,t=e==null?void 0:e.type;return o==null||String(o).length===0?null:t==="peak"?`/peaks/${o}`:typeof t!="string"||t.length===0?null:`/poi/${t}/${o}`}function j(e){const o=S(e);if(!o)return null;const t=typeof(e==null?void 0:e.name)=="string"?e.name.trim():"";return t?`${t}
2${o}`:o}function z(e){const o=S(e);return o?{title:(typeof(e==null?void 0:e.name)=="string"?e.name.trim():"")||"HiiKER",url:o}:null}const h="poi-source",s="poi-layer",F=20,H=100,M={activatedPoiTypes:[],poiList:y.allPOIUtils().sort((e,o)=>e.prettyName().localeCompare(o.prettyName())),trailHighlightsAvailable:!1,sharedPoiHandled:!1},x={SET_ACTIVATED_POI_TYPES(e,o){e.activatedPoiTypes=o,localStorage.setItem("activatedPoiTypes",JSON.stringify(o))},ADD_ACTIVATED_POI_TYPE(e,o){e.activatedPoiTypes.includes(o)||(e.activatedPoiTypes.push(o),localStorage.setItem("activatedPoiTypes",JSON.stringify(e.activatedPoiTypes)))},REMOVE_ACTIVATED_POI_TYPE(e,o){e.activatedPoiTypes=e.activatedPoiTypes.filter(t=>t!==o),localStorage.setItem("activatedPoiTypes",JSON.stringify(e.activatedPoiTypes))},REMOTE_ALL_POI_TYPES(e){e.activatedPoiTypes=[],localStorage.removeItem("activatedPoiTypes")},SET_SHARED_POI_HANDLED(e,o){e.sharedPoiHandled=o}},R={addPoiSourceAndLayer({}){const e=window.mapboxPoiSource;window.layerRegistry.addSource(h,{type:"vector",url:e,promoteId:"id"});const o=["match",["get","type"],"campground","puck_icon_campground","hotel","puck_icon_hotel","hostel","puck_icon_hostel","bnb","puck_icon_bnb","motel","puck_icon_motel","osmCampsite","puck_icon_osmCampsite","osmcampsite","puck_icon_osmcampsite","osm_campsite","puck_icon_osmcampsite","osm-campsite","puck_icon_osmcampsite","osmCampsites","puck_icon_osmCampsite","shelter","puck_icon_shelter","pub","puck_icon_pub","fastfood","puck_icon_fastfood","fast_food","puck_icon_fastfood","fast-food","puck_icon_fastfood","viewpoint","puck_icon_viewpoint","transportStation","puck_icon_transportStation","transportStations","puck_icon_transportStation","transport_station","puck_icon_transport_station","transport-station","puck_icon_transport_station","shop","puck_icon_shop","town","puck_icon_town","history","puck_icon_history","busStop","puck_icon_busStop","busStops","puck_icon_busStop","bus_stop","puck_icon_bus_stop","bus-stop","puck_icon_bus_stop","bus-stops","puck_icon_bus_stop","postOffice","puck_icon_postOffice","post_office","puck_icon_post_office","post-office","puck_icon_post_office","peak","puck_icon_peak","peaks","puck_icon_peaks","pharmacy","puck_icon_pharmacy","water","puck_icon_water","healthcare","puck_icon_healthcare","restaurant","puck_icon_restaurant","other","puck_icon_other","cave","puck_icon_cave","coffee","puck_icon_coffee","evCharging","puck_icon_evCharging","ev_charging","puck_icon_ev_charging","ev-charging","puck_icon_ev_charging","gate","puck_icon_gate","information","puck_icon_information","junction","puck_icon_junction","parking","puck_icon_parking","picnic","puck_icon_picnic","playground","puck_icon_playground","restroom","puck_icon_restroom","storage","puck_icon_storage","swimming","puck_icon_swimming","wifi","puck_icon_wifi","wildlife","puck_icon_wildlife","waterfall","puck_icon_waterfall","warning","puck_icon_warning",["concat","puck_icon_",["get","type"]]];window.layerRegistry.addLayer({id:s,type:"symbol",source:h,"source-layer":"poi",minzoom:9,filter:["in",["get","type"],""],layout:{"icon-image":o,"icon-size":.25,"icon-anchor":"center","icon-allow-overlap":!0}},b.Top)},updatePoiFilter({state:e}){const o=window.map;if(!o||!o.getLayer(s)){console.warn("POI layer not available for filtering.");return}if(e.activatedPoiTypes.length===0){o.setFilter(s,["boolean",!1]);return}const t=[];for(const i of e.activatedPoiTypes){const n=e.poiList.find(a=>a.mapboxFilterType()===i);n?t.push(...n.mapboxFilterTypes()):t.push(i)}o.setFilter(s,["in",["get","type"],["literal",t]])},initActivePois({state:e,commit:o,dispatch:t}){t("addPoiSourceAndLayer");const i=JSON.parse(localStorage.getItem("activatedPoiTypes")||"[]"),n=p=>e.poiList.some(r=>r.mapboxFilterType()===p),a=i.filter(n);if(k(window.location.href)){o("SET_ACTIVATED_POI_TYPES",a),t("openSharedPoiFromUrl");return}const l=y.checkForPassedPOIs();if(l.length>0){const p=l.map(r=>r.mapboxFilterType()).filter(n);o("SET_ACTIVATED_POI_TYPES",p)}else o("SET_ACTIVATED_POI_TYPES",a);t("updatePoiFilter")},openSharedPoiFromUrl({state:e,commit:o,dispatch:t}){if(e.sharedPoiHandled)return;const i=k(window.location.href);if(!i)return;o("SET_SHARED_POI_HANDLED",!0);const n=D(i,e.activatedPoiTypes);if(n){const c=n.filter(_=>e.poiList.some(d=>d.mapboxFilterType()===_));o("SET_ACTIVATED_POI_TYPES",c),t("updatePoiFilter")}const a=window.map,l=O(i);l&&a&&a.flyTo({center:l,zoom:L(a.getZoom())});let p=F;const r=()=>{const c=window.showPoi;if(c){c(i.klass,i.id);return}--p>0&&setTimeout(r,H)};r()},addAllPois({state:e,commit:o,dispatch:t}){const i=e.poiList.map(n=>n.mapboxFilterType());o("SET_ACTIVATED_POI_TYPES",i),t("updatePoiFilter")},addParkPois({state:e,commit:o,dispatch:t}){const i=y.allParkUtils().map(a=>a.mapboxFilterType()),n=new Set(e.activatedPoiTypes);
2i.forEach(a=>n.add(a)),o("SET_ACTIVATED_POI_TYPES",Array.from(n)),t("updatePoiFilter")},refreshActivePois({dispatch:e}){console.log("Refreshing POI filter explicitly."),e("addPoiSourceAndLayer"),e("updatePoiFilter")},activateClickHandler({state:e,rootState:o}){const t=window.map,i=window.showPoi,n=window.mapboxgl;if(!t)return;const a=r=>{if(!r.features||r.features.length===0||o.planTrail&&o.planTrail.planMode)return;if(I(t.queryRenderedFeatures(r.point))){console.log("Clicked on a non-POI waypoint, ignoring POI popup.");return}const c=r.features[0],_=c.properties,d=_.type,m=_.id,g=e.poiList.find(u=>u.mapboxFilterTypes().includes(d));if(g&&i){const u=c.geometry&&c.geometry.type==="Point"?c.geometry.coordinates:[r.lngLat.lng,r.lngLat.lat],P={id:m,type:d||null,name:_.name||null,lonlat:u};i(g.databaseClassName(),m,P)}else if(console.warn(`POIUtility or window.showPoi not found for type: ${d}, id: ${m}`),c.geometry&&c.geometry.type==="Point"&&n){const u=c.geometry.coordinates.slice(),P=Object.entries(_).map(([v,E])=>`<strong>${v}</strong>: ${E}`).join("<br>");for(;Math.abs(r.lngLat.lng-u[0])>180;)u[0]+=r.lngLat.lng>u[0]?360:-360;new n.Popup().setLngLat(u).setHTML(P||A.global.t("base_map_dialog.base_map_data_pois_module.no_details_available")).addTo(t)}};t.off("click",s,a),t.on("click",s,a);const l=()=>{t.getCanvas().style.cursor="pointer"},p=()=>{t.getCanvas().style.cursor=""};t.off("mouseenter",s,l),t.on("mouseenter",s,l),t.off("mouseleave",s,p),t.on("mouseleave",s,p)},viewCreated({dispatch:e}){const o=()=>{e("initActivePois"),e("activateClickHandler")},t=()=>{e("addPoiSourceAndLayer"),e("updatePoiFilter"),e("activateClickHandler"),e("openSharedPoiFromUrl")};window._mapDataPoiMapLoadedHandler=o,window._mapDataPoiMapStyleLoadedHandler=t,f.on("map-loaded",o),f.on("map-style-loaded",t)},beforeViewDestroyed(){const e=window.map;window._mapDataPoiMapLoadedHandler&&f.off("map-loaded",window._mapDataPoiMapLoadedHandler),window._mapDataPoiMapStyleLoadedHandler&&f.off("map-style-loaded",window._mapDataPoiMapStyleLoadedHandler),e&&(e.off("click",s),e.off("mouseenter",s),e.off("mouseleave",s))},clearAllPoi({commit:e,dispatch:o}){e("REMOTE_ALL_POI_TYPES"),o("updatePoiFilter")},togglePoi({state:e,commit:o,dispatch:t},i){const n=i.mapboxFilterType();e.activatedPoiTypes.includes(n)?o("REMOVE_ACTIVATED_POI_TYPE",n):o("ADD_ACTIVATED_POI_TYPE",n),t("updatePoiFilter")}},N={isPoiActive:e=>o=>{const t=o.mapboxFilterType();return e.activatedPoiTypes.includes(t)},getAvailablePois:e=>e.poiList,getActivePoiTypes:e=>e.activatedPoiTypes},J={namespaced:!0,state:M,mutations:x,actions:R,getters:N};export{z as a,J as b,j as c,I as i,S as p};
3//# sourceMappingURL=BaseMapDataPOIsModule-CO3_Ekrx.js.map

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.