Set Leaflet into Theme

This commit is contained in:
2022-10-07 18:31:23 +02:00
parent ce65d2c289
commit 6862d0c1ac
20 changed files with 26 additions and 1949 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,108 +0,0 @@
let leafletMapsObj = {};
let leafletMarkersObj = {};
function drawTrack(trackOpts, elevationOpts, markerOpts) {
var opts = {
elevationControl: {
options: {
position: elevationOpts.graphPosition,
theme: elevationOpts.graphTheme,
width: elevationOpts.graphWidth,
height: elevationOpts.graphHeight,
margins: {
top: 20,
right: 20,
bottom: 35,
left: 50
},
followMarker: elevationOpts.graphFollowMarker,
collapsed: elevationOpts.graphCollapsed,
detached: elevationOpts.graphDetached,
legend: false,
summary: false,
downloadLink: '',
gpxOptions: {
polyline_options: {
className: 'track-' + trackOpts.trackId + '-',
color: trackOpts.lineColor,
opacity: trackOpts.lineOpacity,
weight: trackOpts.lineWeight,
},
marker_options: {
startIcon: new L.ExtraMarkers.icon({
icon: markerOpts.iconStart,
markerColor: markerOpts.iconStartColor,
shape: markerOpts.iconStartShape,
prefix: 'fa',
extraClasses: markerOpts.iconStartClasses
}),
endIcon: new L.ExtraMarkers.icon({
icon: markerOpts.iconEnd,
markerColor: markerOpts.iconEndColor,
shape: markerOpts.iconEndShape,
prefix: 'fa',
extraClasses: markerOpts.iconEndClasses
}),
wptIcons: {
'': new L.ExtraMarkers.icon({
icon: markerOpts.icon,
markerColor: markerOpts.iconColor,
shape: markerOpts.iconShape,
prefix: 'fa',
extraClasses: markerOpts.iconClasses,
})
}
}
},
},
},
};
L.control.elevation(opts.elevationControl.options).addTo(leafletMapsObj[trackOpts.mapId]).load(trackOpts.trackPath);
/*map.on('eledata_loaded', function(e) {
track = e.track_info;
});*/
}
window.downloadFile = function (sUrl) {
//iOS devices do not support downloading. We have to inform user about this.
if (/(iP)/g.test(navigator.userAgent)) {
alert('Your device does not support files downloading. Please try again in desktop browser.');
return false;
}
//If in Chrome or Safari - download via virtual link click
if (window.downloadFile.isChrome || window.downloadFile.isSafari) {
//Creating new link node.
var link = document.createElement('a');
link.href = sUrl;
if (link.download !== undefined) {
//Set HTML5 download attribute. This will prevent file from opening if supported.
var fileName = sUrl.substring(sUrl.lastIndexOf('/') + 1, sUrl.length);
link.download = fileName;
}
//Dispatching click event.
if (document.createEvent) {
var e = document.createEvent('MouseEvents');
e.initEvent('click', true, true);
link.dispatchEvent(e);
return true;
}
}
// Force file download (whether supported by server).
if (sUrl.indexOf('?') === -1) {
sUrl += '?download';
}
window.open(sUrl, '_self');
return true;
};
window.downloadFile.isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
window.downloadFile.isSafari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;

View File

@@ -2,10 +2,7 @@
type: "post"
title: "Feri'Ain des Fanfarons 2021 - Thoissey"
date: 2021-08-06T00:00:00+01:00
latitude: "46.165350"
longitude: "4.791313"
---
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="46.165350" mapLon="4.791313">}}
{{<leaflet-marker markerLat="46.165350" markerLon="4.791313">}}
{{</leaflet-map>}}

View File

@@ -2,9 +2,6 @@
type: "post"
title: "Passerelle du Palais de Justice - Lyon"
date: 2021-12-12T00:00:00+01:00
latitude: "45.761727"
longitude: "4.829074"
---
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="45.761727" mapLon="4.829074">}}
{{<leaflet-marker markerLat="45.761727" markerLon="4.829074">}}
{{</leaflet-map>}}

View File

@@ -2,6 +2,8 @@
type: "post"
title: "Pont de l'Université - Lyon"
date: 2022-04-15T00:00:00+01:00
latitude: "45.752182"
longitude: "4.836530"
---
Balances Publiques en vue de l'Apéro Fanfare du 22 Avril 2022
@@ -12,9 +14,4 @@ Balances Publiques en vue de l'Apéro Fanfare du 22 Avril 2022
{{<figure src="/images/2022-04-15/Ds11mXklAMXQbNWnSH6V.jpg">}}
### Vidéo
{{<video src="/video/2022-04-15/NUiJ05BRBWAZcmQDq8js.mp4">}}
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="45.752182" mapLon="4.836530">}}
{{<leaflet-marker markerLat="45.752182" markerLon="4.836530">}}
{{</leaflet-map>}}
{{<video src="/video/2022-04-15/NUiJ05BRBWAZcmQDq8js.mp4">}}

View File

@@ -2,11 +2,8 @@
type: "post"
title: "Apéro Fanfare - Pont de l'Université - Lyon"
date: 2022-04-22T00:00:00+01:00
latitude: "45.752182"
longitude: "4.836530"
---
Apéro Fanfare sur les quais feat Super Smash Brass et les Fat Ducks.
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="45.752182" mapLon="4.836530">}}
{{<leaflet-marker markerLat="45.752182" markerLon="4.836530">}}
{{</leaflet-map>}}
Apéro Fanfare sur les quais feat Super Smash Brass et les Fat Ducks.

View File

@@ -2,6 +2,8 @@
type: "post"
title: "Over zeu Peepshow - Lyon"
date: 2022-05-13T00:00:00+01:00
latitude: "45.737637"
longitude: "4.853652"
---
Peepshow Musical sauce OzK au 18 rue Pierre Delore pour l'anniversaire de PVR
@@ -20,9 +22,4 @@ Over zeu **PEEP** Knup **SHOW**, Mode d'emploi :
[^2]: Le rythme et l'unisson appréciés dans le décompte pourra éventuellement modifier le-dit décompte.
### Affiche
{{<figure src="/images/2022-05-13/AffichePeepshow.png">}}
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="45.737637" mapLon="4.853652">}}
{{<leaflet-marker markerLat="45.737637" markerLon="4.853652">}}
{{</leaflet-map>}}
{{<figure src="/images/2022-05-13/AffichePeepshow.png">}}

View File

@@ -2,6 +2,8 @@
type: "post"
title: "Rock à Fond - Manziat"
date: 2022-07-30T00:00:00+01:00
latitude: "46.358619"
longitude: "4.903935"
---
Festival Rock à Fond organisé par les Gazafond à Manziat (01570)
@@ -11,9 +13,4 @@ Festival Rock à Fond organisé par les Gazafond à Manziat (01570)
### Photos
{{<figure src="/images/2022-07-30/IMG_20220730_200333.jpg">}}
{{<figure src="/images/2022-07-30/IMG_20220730_202412.jpg">}}
{{<figure src="/images/2022-07-30/IMG_20220730_202417.jpg">}}
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="46.358619" mapLon="4.903935">}}
{{<leaflet-marker markerLat="46.358619" markerLon="4.903935">}}
{{</leaflet-map>}}
{{<figure src="/images/2022-07-30/IMG_20220730_202417.jpg">}}

View File

@@ -2,9 +2,6 @@
type: "post"
title: "Decente de la Saône - Replonges"
date: 2022-07-31T00:00:00+01:00
---
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="46.3044427" mapLon="4.8398536">}}
{{<leaflet-marker markerLat="46.3044427" markerLon="4.8398536">}}
{{</leaflet-map>}}
latitude: "46.3044427"
longitude: "4.8398536"
---

View File

@@ -2,9 +2,6 @@
type: "post"
title: "Feri'Ain des Fanfarons 2022 - Thoissey"
date: 2022-08-08T00:00:00+01:00
---
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="46.165350" mapLon="4.791313">}}
{{<leaflet-marker markerLat="46.165350" markerLon="4.791313">}}
{{</leaflet-map>}}
latitude: "46.165350"
longitude: "4.791313"
---

View File

@@ -2,16 +2,13 @@
type: "post"
title: "Matinale OzK - Charpennes, Villeurbanne"
date: 2022-10-11T00:00:00+01:00
latitude: "45.770751"
longitude: "4.863223"
---
Matinale Musicale de 7:00 à 8:00 place Charles Hernu à Charpennes, sur une idée orginale de TFA.
### Concept
A
Égayer la journée des étudiants et des travailleurs passant par le Charpennes un matin en semaine.
> Mais quelle idée de merde...
### Map
{{<leaflet-map mapHeight="200px" mapWidth="100%" mapLat="45.770751" mapLon="4.863223">}}
{{<leaflet-marker markerLat="45.770751" markerLon="4.863223">}}
{{</leaflet-map>}}

View File

@@ -1,35 +0,0 @@
<!-- Leaflet (JS/CSS) -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""></script>
<!-- leaflet-elevation -->
<link rel="stylesheet" href="https://unpkg.com/@raruto/leaflet-elevation@1.1.1/dist/leaflet-elevation.css" />
{{ $leafletElevation := resources.Get "js/leaflet.elevation.js" | minify | fingerprint "md5" }}
<script src="{{ $leafletElevation.Permalink }}"></script>
<!-- leaflet-hugo -->
{{ $leafletHugo := resources.Get "js/leaflet.hugo.js" | minify | fingerprint "md5" }}
<script src="{{ $leafletHugo.Permalink }}"></script>
<!-- Icons -->
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/leaflet.extra-markers.min.css">
{{ $leafletExtra := resources.Get "js/leaflet.extra-markers.min.js" }}
<script src="{{ $leafletExtra.Permalink }}"></script>
<style>
.fa-icon-marker {
text-align: center;
width: 100%;
}
.download-track {
background-color: #e1e1e1;
text-align: center;
margin-bottom: 25px;
border-radius: 0 0 10px 10px;
cursor: pointer;
}
</style>

View File

@@ -1,82 +0,0 @@
{{ if .IsNamedParams }}
{{ $trackPath := default "" (.Get "trackPath") }}
{{ $lineColor := default "#006EFF" (.Get "lineColor") }}
{{ $lineWeight := default "3" (.Get "lineWeight") }}
{{ $lineOpacity := default "1" (.Get "lineOpacity") }}
{{ $graphPosition := default "topright" (.Get "graphPosition") }}
{{ $graphTheme := default "steelblue-theme" (.Get "graphTheme") }}
{{ $graphWidth := default "500" (.Get "graphWidth") }}
{{ $graphHeight := default "150" (.Get "graphHeight") }}
{{ $graphFollowMarker := default false (.Get "graphFollowMarker") }}
{{ $graphCollapsed := default false (.Get "graphCollapsed") }}
{{ $graphDetached := default true (.Get "graphDetached") }}
{{ $markerIcon := default "fa-thumb-tack" (.Get "markerIcon") }}
{{ $markerIconColor := default "cyan" (.Get "markerIconColor") }}
{{ $markerIconShape := default "penta" (.Get "markerIconShape") }}
{{ $markerIconClasses := default "fa-icon-marker" (.Get "markerIconClasses") }}
{{ $markerStartIcon := default "fa-play" (.Get "markerStartIcon") }}
{{ $markerStartIconColor := default "green-light" (.Get "markerStartIconColor") }}
{{ $markerStartIconShape := default "circle" (.Get "markerStartIconShape") }}
{{ $markerStartIconClasses := default "fa-icon-marker fa-icon-start-stop" (.Get "markerStartIconClasses") }}
{{ $markerEndIcon := default "fa-flag-checkered" (.Get "markerEndIcon") }}
{{ $markerEndIconColor := default "red" (.Get "markerEndIconColor") }}
{{ $markerEndIconShape := default "circle" (.Get "markerEndIconShape") }}
{{ $markerEndIconClasses := default "fa-icon-marker fa-icon-start-stop" (.Get "markerEndIconClasses") }}
{{ with .Parent }}
{{ $mapLat := default "" (.Get "mapLat") }}
{{ $mapLon := default "" (.Get "mapLon") }}
{{ $mapId := default (md5 (printf "%s%s" $mapLat $mapLon)) (.Get "mapId") }}
{{ $trackId := md5 (printf "%s%s" $mapId $trackPath)}}
<script>
trackOpts = {
mapId: "{{ $mapId }}",
trackId: "{{ $trackId }}",
trackPath: '{{ "gpx" | absURL }}/{{$trackPath}}',
lineColor: "{{ $lineColor }}",
lineWeight: "{{ $lineWeight }}",
lineOpacity: "{{ $lineOpacity }}"
};
elevationOpts = {
graphPosition: "{{ $graphPosition }}",
graphTheme: "{{ $graphTheme }}",
graphWidth: "{{ $graphWidth }}",
graphHeight: "{{ $graphHeight }}",
graphFollowMarker: {{ $graphFollowMarker }},
graphCollapsed: {{ $graphCollapsed }},
graphDetached: {{ $graphDetached }}
};
markerOpts = {
icon: "{{ $markerIcon }}",
iconColor: "{{ $markerIconColor }}",
iconShape: "{{ $markerIconShape }}",
iconClasses: "{{ $markerIconClasses }}",
iconStart: "{{ $markerStartIcon }}",
iconStartColor: "{{ $markerStartIconColor }}",
iconStartShape: "{{ $markerStartIconShape }}",
iconStartClasses: "{{ $markerStartIconClasses }}",
iconEnd: "{{ $markerEndIcon }}",
iconEndColor: "{{ $markerEndIconColor }}",
iconEndShape: "{{ $markerEndIconShape }}",
iconEndClasses: "{{ $markerEndIconClasses }}"
};
drawTrack(trackOpts, elevationOpts, markerOpts);
</script>
<div class="download-track" onclick="downloadFile('{{ "gpx" | absURL }}/{{ $trackPath }}');"><p class="download-track-link">Download</p></div>
{{ else }}
{{ errorf "Leaflet Hugo Shortcode: impossible using track outside leaflet-map" }}
{{ end }}
{{ else }}
{{ errorf "Leaflet Hugo Shortcode: please provide named Parameters for marker" }}
{{ end }}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB