PageSourceSearch

https://www.guide-des-landes.com/scripts/v-map/v-lmap.min.js?v=1788247607

js guide-des-landes.com collected 2026-09-24 10:15:39 UTC 11,288 bytes, 1 lines download raw bytes

1var vLMap=function(){var c,e,s,i,r,o,n,l,p,m;return{template:'<div class="v-map" :class="{ \'loading\': loading, \'showInfo\' : showInfo }"><div class="v-map-container"><slot v-if="!inited"></slot><div ref="map" class="v-map-map leaflet"></div></div><div class="v-map-info" ref="info"><a class="v-map-info-close ico-cross" v-if="showInfo" @click="closeDetails"><span class="lib">{{ labels.close }}</span></a><div class="v-map-info-content" v-if="showInfo" v-html="mapInfoHtml"></div></div></div>',props:{enabled:[Boolean],superMarker:[Boolean],markers:[Array],circles:[Array],mapKey:[String],mapCenter:[Object,Array],mapStyle:[Array],mapZoom:{type:Number,default:function(){return 9}},streetViewControl:[Boolean],fullcreenControl:[Boolean],formatInfo:{type:Function,default:function(e){return JSON.stringify(e)}},attribution:{type:String,default:function(){return'&copy; <a href="https://www.negocom-atlantique.com" target="_blank">Negocom Atlantique<a>'}},tilesProvider:{type:String,default:function(){return"osm"}},markersCustoms:[Object],mapBoxApiKey:[String],maxClusterRadius:{type:Number,default:function(){return 40}}},data:function(){return{inited:!1,mapBoxGlInserted:!1,lMapBoxInserted:!1,firstLoadOk:!1,loading:!1,mapMarkers:[],showInfo:null,mapInfo:null,labels:{close:"Fermer"},pixelRatio:1}},computed:{lmapCenter:function(){if(this.mapCenter)return this.latLng(this.mapCenter)},mapAttribution:function(){var e;switch(this.tilesProvider){case"mapboxStatic":case"mapbox":e='&copy; <a target="_blank" rel="nofollow noopener" href="https://www.mapbox.com/about/maps/">Mapbox</a>';break;case"geoportail":e='&copy; <a target="_blank" rel="nofollow noopener" href="https://www.geoportail.gouv.fr/">Geoportail France</a>';break;case"carto":e='&copy; <a target="_blank" rel="nofollow noopener" href="https://carto.com/attributions">CARTO</a>';break;default:e='&copy; <a target="_blank" rel="nofollow noopener" href="http://openstreetmap.org/copyright">OpenStreetMap</a>'}return e=this.attribution?this.attribution+" | "+e:e},allMarkers:function(){return(this.markers||[]).map(function(e){var t=e.data||{};e.tag&&(t["@id"]=e.tag);var a=null;e.latLng&&((a=[])[0]=e.latLng.lng?parseFloat(e.latLng.lng):parseFloat(e.latLng[1]),a[1]=e.latLng.lat?parseFloat(e.latLng.lat):parseFloat(e.latLng[0]));var r=null;return t.free?r=i:t.image&&(r=this.createImgIcon(t.image)),{geometry:{coordinates:a,type:"Point"},latLng:e.latLng||null,properties:t,type:"Feature",icon:r}}.bind(this))},mapInfoHtml:function(){return this.formatInfo(this.mapInfo)},markersSizes:function(){return Object.assign({standard:{className:"marker-standard",size:[32,40],anchor:[16,40],html:'<span class="pin"></span>'},free:{className:"marker-free",size:[18,18],anchor:[9,9],html:null},select:{className:"marker-select",size:[48,60],anchor:[24,60],html:'<span class="pin"></span>'},first:{className:"marker-first",size:[32,40],anchor:[16,40],html:'<span class="pin"></span><span class="pulse"></span>'}},this.markersCustoms)}},methods:{latLng:function(e){if("object"==typeof e)for(var t in e)e[t]=parseFloat(e[t]);if("array"==typeof e)for(t=0;t<e.length;t++)e[t]=parseFloat(e[t]);return new L.latLng(e)},initMap:function(){if(this.lmapCenter){var e;this.loading=!0;var t,a=18;switch(this.tilesProvider){case"geoportail":e=L.tileLayer("https://wxs.ign.fr/{apikey}
1/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}",{attribution:this.mapAttribution,minZoom:1,maxZoom:a,apikey:"essentiels",format:"image/png",style:"normal"});break;case"carto":e=L.tileLayer("https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",{attribution:this.mapAttribution,minZoom:1,maxZoom:a,subdomains:"abcd"});break;case"mapbox":if(this.mapBoxApiKey){if(this.mapBoxGlInserted||("undefined"==typeof mapboxgl&&((t=document.createElement("link")).setAttribute("href","https://cdn.jsdelivr.net/npm/[email protected]/dist/mapbox-gl.min.css"),t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),document.head.appendChild(t),(t=document.createElement("script")).setAttribute("src","https://cdn.jsdelivr.net/npm/[email protected]/dist/mapbox-gl.min.js"),document.head.appendChild(t)),this.mapBoxGlInserted=!0),"undefined"==typeof mapboxgl)return void setTimeout(function(){this.initMap()}.bind(this),500);if(this.lMapBoxInserted||(void 0===L.mapboxGL&&((t=document.createElement("script")).setAttribute("src",racine+"/scripts/leaflet/leaflet.mapbox-gl.js"),document.head.appendChild(t)),this.lMapBoxInserted=!0),void 0===L.mapboxGL)return void setTimeout(function(){this.initMap()}.bind(this),500);a=20,e=L.mapboxGL({attribution:this.mapAttribution,minZoom:1,maxZoom:a,projection:"mercator",accessToken:this.mapBoxApiKey,style:"mapbox://styles/negocom/cmdomnyb4000v01sh9a2hed5p"});break}console.warn("Mapbox need access token");case"mapboxStatic":if(this.mapBoxApiKey){a=19,e=L.tileLayer("https://api.mapbox.com/styles/v1/{username}/{style_id}/tiles/{tilesize}/{z}/{x}/{y}?access_token={access_token}",{attribution:this.mapAttribution,minZoom:1,maxZoom:a,username:"mapbox",style_id:"outdoors-v12",access_token:this.mapBoxApiKey,tilesize:256});break}console.warn("Mapbox need access token");default:e=L.tileLayer("https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png",{attribution:this.mapAttribution,minZoom:1,maxZoom:a})}e.on("tileload",function(e){this.firstLoadOk||(this.firstLoadOk=!0,this.loading=!1,this.$emit("loaded"))}.bind(this)),i=this.createIcon(this.markersSizes.free.className,this.markersSizes.free.size,this.markersSizes.free.anchor,this.markersSizes.free.html),r=this.createIcon(this.markersSizes.standard.className,this.markersSizes.standard.size,this.markersSizes.standard.anchor,this.markersSizes.standard.html),o=this.createIcon(this.markersSizes.select.className,this.markersSizes.select.size,this.markersSizes.select.anchor,this.markersSizes.select.html),this.superMar
1ker&&(n=this.createIcon(this.markersSizes.first.className,this.markersSizes.first.size,this.markersSizes.first.anchor,this.markersSizes.first.html)),(c=L.map(this.$refs.map,{layers:[e],zoom:this.mapZoom,center:this.lmapCenter,minZoom:3,maxZoom:a})).on("click",function(e){this.onMapClick()}.bind(this)),this.allMarkers.length&&(m=L.geoJson({features:this.allMarkers},{pointToLayer:function(e,t){return marker=L.marker(t,{icon:e.icon||r}),marker}})).addTo(c),this.superMarker&&(l=this.getSuperMarkersLayer()).addTo(c),this.circles&&(p=this.getCirclesLayer()).addTo(c),this.autofit(),this.inited=!0}},setLoading:function(e){this.loading=e},clearMarkers:function(){this.closeDetails(),this.firstLoadOk&&(m&&m.clearLayers(),l&&l.clearLayers(),p&&p.clearLayers())},pointToLayer(e,t){var a=this;return marker=L.marker(t,{icon:e.icon||r}),e.properties&&(marker.properties=e.properties),marker.on("click",function(e){var t=e.target;t.properties&&!e.target.selected?a.selectMarker(t,t.properties):a.closeDetails()}),marker},getCirclesLayer:function(){var e,t=[];for(e in this.circles){var a=this.circles[e];t.push(L.circle(L.latLng([a.center.lat,a.center.lng]),{radius:a.rad,opacity:.5,weight:2,color:"#FFFFFF",fillColor:"#3388ff"}))}return(p=L.layerGroup(t)).addTo(c),p},getSuperMarkersLayer:function(){var e=[];
1return this.superMarker&&this.lmapCenter&&e.push({geometry:{coordinates:[this.lmapCenter.lng,this.lmapCenter.lat],type:"Point"},latLng:L.latLng([this.lmapCenter.lat,this.lmapCenter.lng]),icon:n,type:"Feature"}),L.geoJson({features:e},{pointToLayer:this.pointToLayer})},getMarkersLayer:function(){var s=this,e=L.markerClusterGroup({showCoverageOnHover:!1,maxClusterRadius:s.maxClusterRadius,iconCreateFunction:function(e){e.getChildCount();var t,a="v-map-cluster",r=30<e.getChildCount()?(a+=" cluster-3",t=[38,38],[19,19]):10<e.getChildCount()?(a+=" cluster-2",t=[32,32],[16,16]):(a+=" cluster-1",t=[28,28],[14,14]);return s.createIcon(a,t,r,e.getChildCount())}});e.on("clusterclick",function(e){s.closeDetails()});for(var t=0;t<this.allMarkers.length;t++){var a,r=this.allMarkers[t];r.latLng?(a=this.pointToLayer(r,r.latLng),e.addLayer(a)):console.warn("latLng error",r)}return e},loadMarkers:debounce(function(){this.loading=!1,null!=e&&clearTimeout(e),this.firstLoadOk?(this.clearMarkers(),(m=this.getMarkersLayer()).addTo(c),this.superMar
1ker&&(l=this.getSuperMarkersLayer()).addTo(c),this.circles&&(p=this.getCirclesLayer()).addTo(c),this.autofit()):e=setTimeout(function(){this.loadMarkers()}.bind(this),1e3)},500),openDetails:function(e){this.$emit("opendetail",e),this.mapInfo=e,this.showInfo=!0},closeDetails:function(){this.unselectMarkers(),this.showInfo=!1},unselectMarkers:function(){if(m){var e,t=m.getLayers();for(e in t)t[e].selected&&this.unselectMarker(t[e])}},selectMarkerByTag:function(t,a){var e,r;s&&clearTimeout(s),this.firstLoadOk&&!this.loading?(e=m.getLayers().find(function(e){e=(e.feature&&e.feature.properties?e.feature:e).properties;return e&&e[a]==t}))&&(r=c.getZoom(),this.selectMarker(e,e.properties,r=r<15?15:r)):s=setTimeout(function(){this.selectMarkerByTag(t,a)}.bind(this),1e3)},unselectMarker:function(e){var t=r;e.properties&&(e.properties.free?t=i:e.properties.image&&(t=this.createImgIcon(e.properties.image))),e.setIcon(t),e.selected=!1},selectMarker:function(t,e,a){void 0===a&&(a=null),t.selected||(this.unselectMarkers(),t.setIcon(o),t.selected=!0,setTimeout(function(){var e;
1this.superMarker&&!this.markers?a?this.panToPosition(t._latlng,a):this.panToPosition(t._latlng):(e=function(){var e=m.getVisibleParent(t);e&&e._group&&m.zoomToShowLayer(t)},a?this.panToPosition(t._latlng,a,e):this.panToPosition(t._latlng,null,e))}.bind(this),250)),e?this.openDetails(e):this.closeDetails()},autofit:function(){var e,t=this.allMarkers.length;this.superMarker&&0<t?(e=[m],this.superMarker&&0<t&&e.push(l),e=new L.featureGroup(e),c.fitBounds(e.getBounds())):1<t?c.fitBounds(m.getBounds()):this.panToPosition(this.lmapCenter,this.mapZoom)},panToPosition:function(e,t,a){void 0===t&&(t=null);var r,s=c.getCenter(),i=Math.round(1e3*s.lat)/1e3,o=Math.round(1e3*s.lng)/1e3,n=c.getZoom(),l=Math.round(1e3*e.lat)/1e3,s=Math.round(1e3*e.lng)/1e3,t=t||n;i!=l||o!=s||n!=t?(void 0!==a&&(r=function(){a(),c.off("zoomend",r)},c.on("zoomend",r)),s=[0,0],this.$refs.info&&(n=this.$refs.map.offsetWidth,s=this.$refs.info.offsetWidth+2*this.$refs.info.offsetLeft==n?[0,this.$refs.map.offsetHeight-this.$refs.info.offsetTop]:[n-this.$refs.info.offsetLeft,0]),c.flyToBounds(L.latLng(e).toBounds(.1),{maxZoom:t,paddingTopLeft:[0,0],paddingBottomRight:s})):void 0!==a&&a()},onMapClick:function(){this.closeDetails()},createImgIcon:function(e){var t=1.5<=this.pixelRatio?64:32;return this.createIcon("marker-image",[32,39],[16,39],'<span class="pin"><img src="'+e+"?v=mapIcon&width="+t+'" alt=""/></span>')},createIcon:function(e,t,a,r){return r=r||'<span class="icon"></span>',icon=L.divIcon({className:e,html:r,iconSize:t,iconAnchor:a,popupAnchor:[0,0]}),icon}},watch:{enabled:function(e){e&&!this.inited&&this.initMap()},markers:function(e,t){this.loadMarkers()},superMarker:function(e,t){this.loadMarkers()},circles:function(e,t){this.loadMarkers()}},mounted:function(){this.pixelRatio=window.getDevicePixelRatio?window.getDevicePixelRatio():1}}};Vue.component("v-lmap",vLMap());

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.