PageSourceSearch

https://www.voyages-auran.com/assets/js/mapmondo.js

js voyages-auran.com collected 2026-10-06 11:11:08 UTC 7,666 bytes, 133 lines download raw bytes

1// document.addEventListener('similar.height', function () {
2//   let mapBlock = document.querySelector('#map')
3//   let mapBlockParent = document.querySelector('#agency')
4//   if (mapBlockParent) {
5//     mapBlock.style.height = parseFloat(mapBlockParent.offsetHeight - 30) + 'px'
6//   }
7// }, false)
8//
9// document.dispatchEvent(new Event('similar.height'))
10//
11// window.onresize = function () {
12//   document.dispatchEvent(new Event('similar.height'))
13// }
14
15
16// let coords = document.querySelector('#mapMondo').dataset.coords
17// let lat = coords.split(',')[0]
18// let lng = coords.split(',')[1]
19let container = document.querySelector('#mapMondo')
20if (container.getAttribute('mondo-include') === null) {
21  document.querySelector('footer').remove()
22  document.querySelector('#rsi-slide-large').remove()
23}
24window.onresize = function (e) {
25  let height = window.innerHeight - document.querySelector('header').offsetHeight
26  container.style.height = height + 'px'
27}
28//       var height = $(window).height() - $('header').height()
29//       $(this.container).css('height', height + 'px')
30
31let map = L.map('mapMondo').setView([48.864716, 2.349014], 5)
32let markerClusters = L.markerClusterGroup()
33L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
34  attribution: '&copy; <a href="https://www.rsi-info.com">RSI</a>'
35}).addTo(map)
36
37fetch('/voyages/list')
38  .then(function (response) {
39    response.json()
40      .then(function (res) {
41        document.dispatchEvent(new Event('similar.height'))
42        let locations = []
43        for (let index in res) {
44          let row = res.hasOwnProperty(index) ? res[index] : {}
45          if (row.hasOwnProperty('GroupMarker') && row.GroupMarker !== null) {
46            let parseMarker = row.GroupMarker.split('!')
47            let parseName = row.hasOwnProperty('GroupLocation') ? row.GroupLocation.split('!') : []
48            for (let groupIndex in parseMarker) {
49              let _m = parseMarker[groupIndex].split(',')
50              let result = $.grep(locations, function (e) {
51                return e.lat === parseFloat(_m[0]) && e.lng === parseFloat(_m[1])
52              })
53
54              if (result.length > 0) {
55                for (let i3 in locations) {
56                  if (locations[i3].lat === parseFloat(_m[0]) && locations[i3].lng === parseFloat(_m[1])) {
57                    locations.splice(i3, 1)
58                  }
59                }
60                locations.push({
61                  lat: parseFloat(_m[0]),
62                  lng: parseFloat(_m[1]),
63                  _title: parseName[groupIndex],
64                  _voyage: row,
65                  _destroy: true,
66                  _group: result
67                })
68              } else {
69                locations.push({
70                  lat: parseFloat(_m[0]),
71                  lng: parseFloat(_m[1]),
72                  _title: parseName[groupIndex],
73                  _voyage: row
74                })
75              }
76            }
77          }
78        }
79
80        let markers = []
81        // let markerClusters = L.markerClusterGroup()
82        for (let location of locations) {
83          let __marker = L.marker([location.lng, location.lat])
84          __marker.bindTooltip(location._title + ' : ' + location._voyage.titre)
85          let hasImg = (!(location._voyage.image_couverture === null || location._voyage.image_couverture === ''))
86
87          if (location._voyage.date_depart !== null) {
88            let contentMarker = '<div class="clearfix ' + (!hasImg ? 'bg-base' : '') + '" style="min-width:450px;' + (!hasImg ? 'width: 100%; height: auto;' : 'background: url(/assets/images/voyages/' + location._voyage.image_couverture + ') center center / cover; width: 100%; height: 200px;') + ' opacity: 0.8;">\
89                    <div style="' + (!hasImg ? '' : 'background:rgba(255,255,255,0.8);box-shadow:rgba(255, 255, 255, 0.66) 15px -3px 20px 8px inset;')
90              + 'padding: 1px 10px;">\
91                    <h3 class="pull-right bm-title ' + (!hasImg ? 'color-white' : 'text-base') + '" style="text-align: center; line-height: 10px; margin-top: 26px !important; zoom: 1;">' + location._voyage.price + '€<br>\
92                    <small class="' + (!hasImg ? 'color-white' : 'text-base') + '" style="line-height:25px;font-size:9px;">par personne</small>\
93                    </h3><h3 class="bm-title mb10 htitle" style="margin-top: 6px !important; zoom: 1;">\
94                        <a class="' + (!hasImg ? 'color-white' : 'text-base-link') + '" href="/voyages/view/' + location._voyage.id + '">' + location._voyage.titre + '</a>\
95                    </h3> <h4 style="color:black;font-size:13px;" class="text-uppercase">Du ' + location._voyage.date_depart.split('-').reverse().join('/') + ' au ' + location._voyage.date_arrivee.split('-').reverse().join('/') + '</h4>\
96                    </div></div>'
97
98            if (typeof location._group !== 'undefined') {
99              for (let i in location._group) {
100                let hasImg = (!(location._voyage.image_couverture === null || location._voyage.image_couverture === ''))
101                contentMarker += '<div class="clearfix ' + (!hasImg ? 'bg-base' : '') + '" style="min-width:450px;margin-top: 15px;' + (!hasImg ? 'width: 100%; height: auto;' : 'background: url(/assets/images/voyages/' + location._group[i]._voyage.image_couverture + ') center center / cover; width: 100%; height: 200px;') + 'opacity: 0.8;">\
102                        <div style="' + (!hasImg ? '' : 'background:rgba(255,255,255,0.8);box-shadow:rgba(255, 255, 255, 0.66) 15px -3px 20px 8px inset;') + ' padding: 1px 10px;">\
103                        <h3 class="pull-right bm-title ' + (!hasImg ? 'color-white' : 'text-base') + '" style="text-align: center; line-height: 10px; margin-top: 26px !important; zoom: 1;">' + location._group[i]._voyage.price + '€<br>\
104                        <small class="' + (!hasImg ? 'color-white' : 'text-base') + '" style="line-height:25px;font-size:9px;">par personne</small>\
105                        </h3><h3 class="bm-title mb10 htitle" style="margin-top: 6px !important; zoom: 1;">\
106                            <a class="' + (!hasImg ? 'color-white' : 'text-base-link') + '" href="/voyages/view/' + location._group[i]._voyage.id + '">' + location._group[i]._voyage.titre + '</a>\
107                        </h3> <h4 style="font-size:13px;color:black;" class="text-uppercase text-base">Du ' + (location._group[i]._voyage.date_depart ? location._group[i]._voyage.date_depart.split('-').reverse().join('/') : 'no date depart') + ' au ' + (location._group[i]._voyage.date_arrivee ? location._group[i]._voyage.date_arrivee.split('-').reverse().join('/') : 'no date arrivee') + '</h4>\
108                        </div></div>'
109              }
110            }
111            let popup = L.popup({
112              maxWidth: 1000,
113              minWidth: 450
114            })
115              .setContent(contentMarker)
116              .setLatLng([location.lat, location.lng])
117            // .openOn(map)
118            __marker.bindPopup(popup)
119          } else {
120            __marker.bindPopup('<div style="min-width:450px;margin-top: 15px;"><h5>' + location._title + ' : ' + location._voyage.titre + '</h5></div>')
121          }
122          markerClusters.addLayer(__marker) // Nous ajoutons le marqueur aux groupes
123          markers.push(__marker)
124        }
125
126        // let group = new L.featureGroup(markers)
127        // map.fitBounds(group.getBounds().pad(0.5))
128        map.addLayer(markerClusters)
129      })
130  })
131
132window.dispatchEvent(new Event('resize'))
133

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.