PageSourceSearch

https://app.meschasses.com/assets/useMapInstance-V8CSc1MC.js

js meschasses.com collected 2026-09-24 14:16:21 UTC 6,418 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`1.0.0`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`36da0d7a-54cf-4d35-bcad-31dce4923f84`,e._sentryDebugIdIdentifier=`sentry-dbid-36da0d7a-54cf-4d35-bcad-31dce4923f84`)}catch{}})();import{r as e}from"./rolldown-runtime-CjDDarHI.js";import{c as t}from"./analytics-vendor-DcOTTi-G.js";import"./src-Bs9ft6hE.js";import{t as n}from"./map-vendor-BM7dRHsj.js";var r=(e,t,n)=>Math.min(n,Math.max(t,e));function i(e,t){return(e+180)/360*2**t}function a(e,t){let n=e*Math.PI/180;return(1-Math.log(Math.tan(n)+1/Math.cos(n))/Math.PI)/2*2**t}function o(e){if(![e.west,e.south,e.east,e.north].every(Number.isFinite))throw Error(`Emprise invalide : coordonnées non finies.`);if(e.west>=e.east)throw Error(`Emprise invalide : ouest >= est.`);if(e.south>=e.north)throw Error(`Emprise invalide : sud >= nord.`);if(e.west<-180||e.east>180)throw Error(`Emprise invalide : longitude hors [-180, 180].`);if(e.south<-85.05112878||e.north>85.05112878)throw Error(`Emprise invalide : latitude hors des bornes Web Mercator.`)}function s(e){o(e);let t=e.east-e.west,n=r(Math.floor(Math.log2(360/t))+0,0,18);for(;;){let t=Math.floor(i(e.west,n)),r=Math.max(t,Math.ceil(i(e.east,n))-1),o=Math.floor(a(e.north,n)),s=Math.max(o,Math.ceil(a(e.south,n))-1),c=r-t+1,l=s-o+1;if(c*l<=4||n<=0)return{z:n,x:t,y:o,nx:c,ny:l};--n}}var c=`https://geo.meschasses.com`,l={nature:[`pn`,`rnn`,`rnc`,`natura-habitat`,`natura-oiseaux`],enedis:[`reseau-hta`,`reseau-bt`],onf:[`parcelles`]};function u(e){return Object.prototype.hasOwnProperty.call(l,e)}function d(e,t){return u(e)?l[e].includes(t):!1}function f(e,t,n,r){if(!d(t,n))throw Error(`Calque inconnu : ${t}/${n}.`);let i=s(r);return`${e.replace(/\/+$/,``)}/layers/${t}/${n}?${`z=${i.z}&x=${i.x}&y=${i.y}&nx=${i.nx}&ny=${i.ny}`}`}var p=`https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}`,m=[{key:`latest`,label:`Récent`,layerId:`ORTHOIMAGERY.ORTHOPHOTOS`,maxzoom:19},{key:`2021_2023`,label:`2021-2023`,layerId:`ORTHOIMAGERY.ORTHOPHOTOS2021-2023`,maxzoom:19},{key:`2016_2020`,label:`2016-2020`,layerId:`ORTHOIMAGERY.ORTHOPHOTOS2016-2020`,maxzoom:19},{key:`2011_2015`,label:`2011-2015`,layerId:`ORTHOIMAGERY.ORTHOPHOTOS2011-2015`,maxzoom:18},{key:`2006_2010`,label:`2006-2010`,layerId:`ORTHOIMAGERY.ORTHOPHOTOS2006-2010`,maxzoom:18},{key:`2000_2005`,label:`2000-2005`,layerId:`ORTHOIMAGERY.ORTHOPHOTOS2000-2005`,maxzoom:18}],h=`latest`;function g(e){return m.find(t=>t.key===e)??m.find(e=>e.key===`latest`)}function _(e,t){return`${e}/sat/{z}/{x}/{y}?v=${t}`}var v=e(t(),1),y=e(n(),1);function b(e){if(!(e instanceof Error))return!1;let t=e.message;return t.includes(`Failed to initialize WebGL`)||t.includes(`webglcontextcreationerror`)}var x=19,S=`https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2&STYLE=normal&TILEMATRIXSET=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=image/png`,C=`https://data.geopf.fr/tms/1.0.0/PCI/{z}/{x}/{y}.pbf`,w=(e,t)=>{let n=g(t),r=e===`SATELLITE`?[{id:`base-satellite`,type:`raster`,source:`satellite`}]:[{id:`base-plan`,type:`raster`,source:`plan`}];return{version:8,sources:{satellite:{type:`raster`,tiles:[_(c,n.layerId)],tileSize:256,maxzoom:x,attribution:`IGN-F/Géoportail · Esri`},plan:{type:`raster`,tiles:[S],tileSize:256,maxzoom:19,attribution:`IGN-F/Géoportail`},cadastre:{type:`vector`,tiles:[C],minzoom:5,maxzoom:19,attribution:`IGN-F/Géoportail`}},layers:r,glyphs:`https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf`}},T=(e,t,n,r,i)=>{let[a,o]=(0,v.useState)(null),[s,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),f=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!e.current||f.current)return;let a;try{a=new y.default.Map({container:e.current,style:w(t,n),center:[2.5,47],zoom:5,attributionControl:!1,canvasContextAttributes:{preserveDrawingBuffer:!0},maxCanvasSize:[8192,8192]})}catch(e){if(b(e)){d(!0);return}throw e}return i||a.addControl(new y.default.NavigationControl({showCompass:!1}),`top-right`),a.on(`load`,()=>{let e=r?`visible`:`none`,t=e=>{try{a.addLayer(e)}catch(t){console.error(`[TraqueMap] addLayer`,e.id,t)}};t({id:`cadastre-departement`,type:`line`,source:`cadastre`,"source-layer":`departement`,layout:{visibility:e},paint:{"line-color":`#7C5FB5`,"line-width":2.2,"line-opacity":.7}}),t({id:`cadastre-commune`,type:`line`,source:`cadastre`,"source-layer":`commune`,layout:{visibility:e},paint:{"line-color":`#8B6FC0`,"line-width":1.6,"line-opacity":.75}}),t({id:`cadastre-feuille`,type:`line`,source:`cadastre`,"source-layer":`feuille`,layout:{visibility:e},paint:{"line-color":`#B8A5D6`,"line-width":.9,"line-opacity":.6}}),t({id:`cadastre-layer`,type:`line`,source:`cadastre`,"source-layer":`parcelle`,layout:{visibility:e},paint:{"line-color":`#FF7A00`,"line-width":1.2,"line-opacity":.85}}),t({id:`cadastre-label`,type:`symbol`,source:`cadastre`,"source-layer":`localisant`,minzoom:17,layout:{visibility:e,"text-field":[`to-string`,[`coalesce`,[`get`,`numero`],[`get`,`section`],``]],"text-size":13,"text-allow-overlap":!1,"text-padding":4},paint:{"text-color":`#1A1A1A`,"text-halo-color":`#FFFFFF`,"text-halo-width":2.2,"text-halo-blur":.4}}),o(a),l(!0),requestAnimationFrame(()=>a.resize())}),f.current=a,()=>{a.remove(),f.current=null,o(null),l(!1)}},[]),(0,v.useEffect)(()=>{let e=f.current;if(!e||!e.isStyleLoaded())return;let n=[`cadastre-departement`,`cadastre-commune`,`cadastre-feuille`,`cadastre-layer`].find(t=>e.getLayer(t));for(let t of[`base-satellite`,`base-plan`])e.getLayer(t)&&e.removeLayer(t);t===`SATELLITE`?e.addLayer({id:`base-satellite`,type:`raster`,source:`satellite`},n):e.addLayer({id:`base-plan`,type:`raster`,source:`plan`},n)},[t]),(0,v.useEffect)(()=>{let e=f.current;if(!e||!e.isStyleLoaded())return;let t=e.getSource(`satellite`);t&&typeof t.setTiles==`function`&&t.setTiles([_(c,g(n).layerId)])},[n]),(0,v.useEffect)(()=>{let e=f.current;if(!e||!e.isStyleLoaded())return;let t=r?`visible`:`none`;[`cadastre-departement`,`cadastre-commune`,`cadastre-feuille`,`cadastre-layer`,`cadastre-label`].forEach(n=>{e.getLayer(n)&&e.setLayoutProperty(n,`visibility`,t)})},[r]),{mapInstance:a,isMapLibraryLoaded:s,webglUnavailable:u}};export{m as a,p as i,T as n,c as o,h as r,f as s,S as t};

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.