1import{j as t}from"./editor-BhGk7_S1.js";import{b as c}from"./leaflet-DcfcX7a_.js";import{m}from"./mapbox-gl-DEKaLS0d.js";import"./mapbox-BPFQ-Sfv.js";m.accessToken="pk.eyJ1IjoianBnb3V4IiwiYSI6ImNtaXFsZXoydTAwNDQzZnF0aGk1eWV3YXcifQ.MH45ZTKcC_vcmr_0rK2DKg";function h(){const l=c.useRef(null),e=c.useRef(null),[r,p]=c.useState([]);c.useEffect(()=>{if(!(!l.current||e.current))return e.current=new m.Map({container:l.current,style:"mapbox://styles/mapbox/dark-v11",projection:{name:"globe"},center:[0,20],zoom:1.5}),e.current.on("load",()=>{e.current&&(e.current.addLayer({id:"country-fills-test",type:"fill",source:{type:"vector",url:"mapbox://mapbox.country-boundaries-v1"},"source-layer":"country_boundaries",paint:{"fill-color":"#888888","fill-opacity":.5}}),setTimeout(()=>{if(!e.current)return;const s=e.current.querySourceFeatures("composite",{sourceLayer:"country_boundaries"}),o=s.length>0?s:e.current.queryRenderedFeatures(),a=new Set;o.forEach(x=>{const i=x.properties;if(i){const n=i.name_en||i.name;n&&typeof n=="string"&&n.length>1&&a.add(n)}});const u=Array.from(a).sort();p(u),console.log("ð Found",u.length,"countries from Mapbox"),console.log("Country names:",u)},2e3))}),()=>{e.current&&(e.current.remove(),e.current=null)}},[]);const d=()=>{const s=new Blob([JSON.stringify(r,null,2)],{type:"application/json"}),o=URL.createObjectURL(s),a=document.createElement("a");a.href=o,a.download="mapbox-country-names.json",a.click()};return t.jsx("div",{"data-loc":"client/src/pages/MapboxTest.tsx:91",className:"min-h-screen bg-background text-foreground p-8",children:t.jsxs("div",{"data-loc":"client/src/pages/MapboxTest.tsx:92",className:"max-w-7xl mx-auto",children:[t.jsx("h1",{"data-loc":"client/src/pages/MapboxTest.tsx:93",className:"text-3xl font-bold mb-4",children:"Mapbox Country Names Test"}),t.jsxs("p",{"data-loc":"client/src/pages/MapboxTest.tsx:94",className:"mb-4",children:["Found ",r.length," countries"]}),t.jsx("button",{"data-loc":"client/src/pages/MapboxTest.tsx:96",onClick:d,className:"mb-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",disabled:r.length===0,children:"Download Country Names JSON"}),t.jsx("div",{"data-loc":"client/src/pages/MapboxTest.tsx:104",ref:l,className:"w-full h-96 mb-8 rounded-lg"}),t.jsxs("div",{"data-loc":"client/src/pages/MapboxTest.tsx:106",className:"bg-card p-4 rounded-lg max-h-96 overflow-y-auto",children:[t.jsxs("h2",{"data-loc":"client/src/pages/MapboxTest.tsx:107",className:"text-xl font-semibold mb-2",children:["Country Names (",r.length,")"]}),t.jsx("ul",{"data-loc":"client/src/pages/MapboxTest.tsx:108",className:"space-y-1 text-sm font-mono",children:r.map((s,o)=>t.jsxs("li",{"data-loc":"client/src/pages/MapboxTest.tsx:110",children:[o+1,". ",s]},o))})]})]})})}export{h 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.