PageSourceSearch

https://diygod.cc/_astro/mapbox-globe.astro_astro_type_script_index_0_lang.BYFRjTjM.js

js diygod.cc collected 2026-09-24 20:51:50 UTC 2,281 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/mapbox-gl.B4ncXxJj.js","_astro/_commonjsHelpers.CqkleIqs.js","_astro/index.N6iTjqkh.js"])))=>i.map(i=>d[i]);
2import{_ as b}from"./preload-helper.BlTxHScW.js";(()=>{const n=Array.from(document.querySelectorAll(".mapbox-globe")).filter(e=>!e.dataset.mapboxBound);n.length&&Promise.all([b(()=>import("./mapbox-gl.B4ncXxJj.js").then(e=>e.m),__vite__mapDeps([0,1])),b(()=>import("./index.N6iTjqkh.js").then(e=>e.i),__vite__mapDeps([2,1]))]).then(([{default:e},{default:a}])=>{n.forEach(o=>{o.dataset.mapboxBound="true";const c=o.dataset.token,s=(()=>{try{return JSON.parse(o.dataset.pins||"[]")}catch{return[]}})(),v=Array.isArray(s.travel)?s.travel:[],f=Array.isArray(s.residence)?s.residence:[],h=[{pins:v,className:"mapbox-marker--travel"},{pins:f,className:"mapbox-marker--residence"}];if(!c){o.classList.add("mapbox-globe--error"),o.innerHTML='<div class="mapbox-placeholder">请在环境变量中设置 PUBLIC_MAPBOX_TOKEN 以加载地图。</div>';return}e.accessToken=c;const r=new e.Map({container:o,style:"mapbox://styles/mapbox/light-v10",center:[100,30],zoom:1.2,projection:"globe",dragRotate:!0,touchPitch:!0,attributionControl:!1});r.addControl(new a({defaultLanguage:"zh-Hans"})),r.on("style.load",()=>{r.setFog({color:"rgba(0,0,0,0)","high-color":"rgba(255,255,255,0.1)","space-color":"rgba(0,0,0,0)","horizon-blend":0})}),h.forEach(({pins:i,className:L})=>{i.forEach(({name:p,coords:m})=>{const t=document.createElement("div");t.className=`mapbox-marker ${L}`,t.setAttribute("aria-label",p),t.tabIndex=0;const u=new e.Popup({offset:8,closeButton:!1,closeOnMove:!1,focusAfterOpen:!1}).setText(p);new e.Marker({element:t,anchor:"center"}).setLngLat(m).addTo(r);const l=()=>u.setLngLat(m).addTo(r),d=()=>u.remove();t.addEventListener("mouseenter",l),t.addEventListener("mouseleave",d),t.addEventListener("focus",l),t.addEventListener("blur",d),t.addEventListener("click",E=>{E.stopPropagation(),l()}),r.on("click",d)})}),o.addEventListener("mapbox-globe:destroy",()=>{r.remove()},{once:!0})})}).catch(e=>{console.error("Mapbox globe failed to load:",e),n.forEach(a=>{a.classList.add("mapbox-globe--error"),a.innerHTML='<div class="mapbox-placeholder">地图加载失败,请稍后再试。</div>'})})})();

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.