Browse Source

mise à jour des libs

pull/41/head
b_b 5 months ago
parent
commit
b09a6e15b5
  1. 31
      lib/leaflet/plugins/Control.FullScreen.js
  2. 110
      lib/leaflet/plugins/Leaflet.GoogleMutant.js
  3. BIN
      lib/leaflet/plugins/images/icon-fullscreen-2x.png
  4. BIN
      lib/leaflet/plugins/images/icon-fullscreen.png
  5. 1
      lib/leaflet/plugins/images/icon-fullscreen.svg
  6. 6
      lib/leaflet/plugins/leaflet-plugins.css
  7. 49
      lib/leaflet/plugins/leaflet-providers.js

31
lib/leaflet/plugins/Control.FullScreen.js vendored

@ -1,6 +1,6 @@
/*!
* Based on package 'screenfull'
* v5.1.0 - 2020-12-24
* v5.2.0 - 2021-11-03
* (c) Sindre Sorhus; MIT License
* Added definition for using screenfull as an amd module
* Must be placed before the definition of leaflet.fullscreen
@ -15,7 +15,7 @@
// Save 'screenfull' into global window variable
root.screenfull = factory();
}
}(this, function () {
}(typeof self !== 'undefined' ? self : this, function () {
'use strict';
var document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};
@ -198,7 +198,7 @@
// Assume 'leaflet' and 'screenfull' are loaded into global variable already
factory(root.L, root.screenfull);
}
}(this, function (leaflet, screenfull) {
}(typeof self !== 'undefined' ? self : this, function (leaflet, screenfull) {
'use strict';
leaflet.Control.FullScreen = leaflet.Control.extend({
@ -231,25 +231,22 @@
this._createButton(this.options.title, className, content, container, this.toggleFullScreen, this);
this._map.fullscreenControl = this;
this._map.on('enterFullscreen exitFullscreen', this._toggleTitle, this);
this._map.on('enterFullscreen exitFullscreen', this._toggleState, this);
return container;
},
onRemove: function () {
leaflet.DomEvent
.off(this.link, 'click', leaflet.DomEvent.stopPropagation)
.off(this.link, 'click', leaflet.DomEvent.preventDefault)
.off(this.link, 'click', leaflet.DomEvent.stop)
.off(this.link, 'click', this.toggleFullScreen, this);
leaflet.DomEvent
.off(this._container, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.stopPropagation)
.off(this._container, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.preventDefault)
.off(this._container, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.stop)
.off(this._container, this._screenfull.raw.fullscreenchange, this._handleFullscreenChange, this);
leaflet.DomEvent
.off(document, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.stopPropagation)
.off(document, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.preventDefault)
.off(document, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.stop)
.off(document, this._screenfull.raw.fullscreenchange, this._handleFullscreenChange, this);
},
@ -262,19 +259,18 @@
this.link.setAttribute('role', 'button');
this.link.setAttribute('aria-label', title);
L.DomEvent.disableClickPropagation(container);
leaflet.DomEvent
.on(this.link, 'click', leaflet.DomEvent.stopPropagation)
.on(this.link, 'click', leaflet.DomEvent.preventDefault)
.on(this.link, 'click', leaflet.DomEvent.stop)
.on(this.link, 'click', fn, context);
leaflet.DomEvent
.on(container, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.stopPropagation)
.on(container, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.preventDefault)
.on(container, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.stop)
.on(container, this._screenfull.raw.fullscreenchange, this._handleFullscreenChange, context);
leaflet.DomEvent
.on(document, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.stopPropagation)
.on(document, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.preventDefault)
.on(document, this._screenfull.raw.fullscreenchange, leaflet.DomEvent.stop)
.on(document, this._screenfull.raw.fullscreenchange, this._handleFullscreenChange, context);
return this.link;
@ -306,8 +302,9 @@
}
},
_toggleTitle: function () {
_toggleState: function () {
this.link.title = this._map._isFullscreen ? this.options.title : this.options.titleCancel;
this._map._isFullscreen ? L.DomUtil.removeClass(this.link, 'leaflet-fullscreen-on') : L.DomUtil.addClass(this.link, 'leaflet-fullscreen-on');
},
_handleFullscreenChange: function () {

110
lib/leaflet/plugins/Leaflet.GoogleMutant.js

@ -376,15 +376,7 @@
// 🍂extends GridLayer
L.GridLayer.GoogleMutant = L.GridLayer.extend({
options: {
minZoom: 0,
maxZoom: 21, // can be 23, but ugly if more than maxNativeZoom
tileSize: 256,
subdomains: "abc",
errorTileUrl: "",
attribution: "", // The mutant container will add its own attribution anyways.
opacity: 1,
continuousWorld: false,
noWrap: false,
// 🍂option type: String = 'roadmap'
// Google's map type. Valid values are 'roadmap', 'satellite' or 'terrain'. 'hybrid' is not really supported.
type: "roadmap",
@ -491,8 +483,8 @@
"leaflet-google-mutant leaflet-top leaflet-left"
);
this._mutantContainer.id = "_MutantContainer_" + L.Util.stamp(this._mutantContainer);
this._mutantContainer.style.zIndex = 800; //leaflet map pane at 400, controls at 1000
this._mutantContainer.style.pointerEvents = "none";
this._mutantContainer.style.visibility = "hidden";
L.DomEvent.off(this._mutantContainer);
}
@ -514,8 +506,6 @@
},
_initMutant: function () {
var this$1 = this;
if (this._mutant) {
return;
}
@ -530,25 +520,20 @@
draggable: false,
disableDoubleClickZoom: true,
scrollwheel: false,
streetViewControl: false,
styles: this.options.styles || {},
styles: this.options.styles || [],
backgroundColor: "transparent",
});
this._mutant = map;
google.maps.event.addListenerOnce(map, "idle", function () {
var nodes = this$1._mutantContainer.querySelectorAll("a");
for (var i = 0; i < nodes.length; ++i) {
nodes[i].style.pointerEvents = "auto";
}
});
this._update();
// 🍂event spawned
// Fired when the mutant has been created.
this.fire("spawned", { mapObject: map });
this._waitControls();
this.once('controls_ready', this._setupAttribution);
},
_attachObserver: function _attachObserver(node) {
@ -562,6 +547,43 @@
Array.prototype.forEach.call(node.querySelectorAll("img"), this._boundOnMutatedImage);
},
_waitControls: function () {
var this$1 = this;
var id = setInterval(function () {
var layoutManager = this$1._mutant.__gm.layoutManager;
if (!layoutManager) { return; }
clearInterval(id);
var positions;
// iterate through obfuscated key names to find positions set (atm: layoutManager.o)
Object.keys(layoutManager).forEach(function(key) {
var el = layoutManager[key];
if (el.get) {
if (el.get(1) instanceof Node) {
positions = el;
}
}
});
// 🍂event controls_ready
// Fired when controls positions get available (passed in `positions` property).
this$1.fire("controls_ready", { positions: positions });
}, 50);
},
_setupAttribution: function (ev) {
// https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition
var pos = google.maps.ControlPosition;
var ctr = this._attributionContainer = ev.positions.get(pos.BOTTOM_RIGHT);
L.DomUtil.addClass(ctr, "leaflet-control leaflet-control-attribution");
L.DomEvent.disableClickPropagation(ctr);
ctr.style.height = "14px";
this._map._controlCorners.bottomright.appendChild(ctr);
this._logoContainer = ev.positions.get(pos.BOTTOM_LEFT);
this._logoContainer.style.pointerEvents = "auto";
this._map._controlCorners.bottomleft.appendChild(this._logoContainer);
},
_onMutations: function _onMutations(mutations) {
for (var i = 0; i < mutations.length; ++i) {
var mutation = mutations[i];
@ -575,51 +597,6 @@
node.querySelectorAll("img"),
this._boundOnMutatedImage
);
// Check for, and remove, the "Google Maps can't load correctly" div.
// You *are* loading correctly, you dumbwit.
if (node.style.backgroundColor === "white") {
L.DomUtil.remove(node);
}
// Check for, and remove, the "For development purposes only" divs on the aerial/hybrid tiles.
if (node.textContent.indexOf("For development purposes only") === 0) {
L.DomUtil.remove(node);
}
// Check for, and remove, the "Sorry, we have no imagery here"
// empty <div>s. The [style*="text-align: center"] selector
// avoids matching the attribution notice.
// This empty div doesn't have a reference to the tile
// coordinates, so it's not possible to mark the tile as
// failed.
Array.prototype.forEach.call(
node.querySelectorAll('div[draggable=false][style*="text-align: center"]'),
L.DomUtil.remove
);
// Move Google attributions to leaflet's bottom-right control container
if (
node.querySelectorAll(".gmnoprint").length > 0 ||
node.querySelectorAll('a[title="Click to see this area on Google Maps"]')
.length > 0
) {
var ctr = (this._attributionContainer = L.DomUtil.create(
"div",
"leaflet-control leaflet-control-attribution"
));
L.DomEvent.disableClickPropagation(ctr);
ctr.style.height = "14px";
ctr.style.background = "none";
this._map._controlCorners.bottomright.appendChild(ctr);
ctr.appendChild(node);
}
// Move Google logo to leaflet's bottom-left control container
if (node.style.zIndex == 1000000) {
this._map._controlCorners.bottomleft.appendChild(node);
this._logoContainer = node;
}
}
}
}
@ -668,7 +645,6 @@
if (coords) {
var tileKey = this._tileCoordsToKey(coords);
imgNode.style.position = "absolute";
imgNode.style.visibility = "hidden";
var key = tileKey + "/" + sublayer;
// Cache img so it can also be used in subsequent tile requests
@ -679,8 +655,6 @@
this._tileCallbacks[key].forEach(function (callback) { return callback(imgNode); });
delete this._tileCallbacks[key];
}
} else if (imgNode.src.match(this._staticRegExp)) {
imgNode.style.visibility = "hidden";
}
},

BIN
lib/leaflet/plugins/images/icon-fullscreen-2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

BIN
lib/leaflet/plugins/images/icon-fullscreen.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

1
lib/leaflet/plugins/images/icon-fullscreen.svg

@ -0,0 +1 @@
<svg viewBox="0 0 26 52" xmlns="http://www.w3.org/2000/svg"><path d="M20.6 36.7H16a.9.9 0 0 1-.8-.8v-4.5c0-.2.2-.4.4-.4h1.4c.3 0 .5.2.5.4v3h3c.2 0 .4.2.4.5v1.4c0 .2-.2.4-.4.4zm-9.9-.8v-4.5c0-.2-.2-.4-.4-.4H8.9c-.3 0-.5.2-.5.4v3h-3c-.2 0-.4.2-.4.5v1.4c0 .2.2.4.4.4H10c.4 0 .8-.4.8-.8zm0 10.7V42c0-.4-.4-.8-.8-.8H5.4c-.2 0-.4.2-.4.4v1.4c0 .3.2.5.4.5h3v3c0 .2.2.4.5.4h1.4c.2 0 .4-.2.4-.4zm6.9 0v-3h3c.2 0 .4-.2.4-.5v-1.4c0-.2-.2-.4-.4-.4H16c-.4 0-.8.4-.8.8v4.5c0 .2.2.4.4.4h1.4c.3 0 .5-.2.5-.4zM5 10.3V5.9c0-.5.4-.9.9-.9h4.4c.2 0 .4.2.4.4V7c0 .2-.2.4-.4.4h-3v3c0 .2-.2.4-.4.4H5.4a.4.4 0 0 1-.4-.4zm10.3-4.9V7c0 .2.2.4.4.4h3v3c0 .2.2.4.4.4h1.5c.2 0 .4-.2.4-.4V5.9c0-.5-.4-.9-.9-.9h-4.4c-.2 0-.4.2-.4.4zm5.3 9.9H19c-.2 0-.4.2-.4.4v3h-3c-.2 0-.4.2-.4.4v1.5c0 .2.2.4.4.4h4.4c.5 0 .9-.4.9-.9v-4.4c0-.2-.2-.4-.4-.4zm-9.9 5.3V19c0-.2-.2-.4-.4-.4h-3v-3c0-.2-.2-.4-.4-.4H5.4c-.2 0-.4.2-.4.4v4.4c0 .5.4.9.9.9h4.4c.2 0 .4-.2.4-.4z" fill="currentColor"/></svg>

After

Width:  |  Height:  |  Size: 945 B

6
lib/leaflet/plugins/leaflet-plugins.css

@ -1,6 +1,8 @@
/* L.Control.FullScreen */
.fullscreen-icon { background-image: url(images/icon-fullscreen.png); }
.leaflet-retina .fullscreen-icon { background-image: url(images/icon-fullscreen-2x.png); background-size: 26px 26px; }
.fullscreen-icon { background-image: url(images/icon-fullscreen.svg); background-size:26px 52px; }
.fullscreen-icon.leaflet-fullscreen-on { background-position:0 -26px; }
.leaflet-touch .fullscreen-icon { background-position: 2px 2px; }
.leaflet-touch .fullscreen-icon.leaflet-fullscreen-on { background-position: 2px -24px; }
/* one selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-container:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }

49
lib/leaflet/plugins/leaflet-providers.js

@ -86,7 +86,7 @@
variants: {
Mapnik: {},
DE: {
url: 'https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
url: 'https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png',
options: {
maxZoom: 18
}
@ -225,19 +225,6 @@
attribution: '<a href="https://github.com/cyclosm/cyclosm-cartocss-style/releases" title="CyclOSM - Open Bicycle render">CyclOSM</a> | Map data: {attribution.OpenStreetMap}'
}
},
Hydda: {
url: 'https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
options: {
maxZoom: 20,
variant: 'full',
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
},
variants: {
Full: 'full',
Base: 'base',
RoadsAndLabels: 'roads_and_labels'
}
},
Jawg: {
url: 'https://{s}.tile.jawg.io/{variant}/{z}/{x}/{y}{r}.png?access-token={accessToken}',
options: {
@ -829,7 +816,7 @@
}
},
nlmaps: {
url: 'https://geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png',
url: 'https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/{variant}/EPSG:3857/{z}/{x}/{y}.png',
options: {
minZoom: 6,
maxZoom: 19,
@ -837,9 +824,10 @@
attribution: 'Kaartgegevens &copy; <a href="https://www.kadaster.nl">Kadaster</a>'
},
variants: {
'standaard': 'brtachtergrondkaart',
'pastel': 'brtachtergrondkaartpastel',
'grijs': 'brtachtergrondkaartgrijs',
'standaard': 'standaard',
'pastel': 'pastel',
'grijs': 'grijs',
'water': 'water',
'luchtfoto': {
'url': 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_ortho25/EPSG:3857/{z}/{x}/{y}.jpeg',
}
@ -1052,7 +1040,7 @@
'&tilesetId={variant}&x={x}&y={y}&zoom={z}&language={language}'+
'&subscription-key={subscriptionKey}',
options: {
attribution: 'See https://docs.microsoft.com/en-US/rest/api/maps/renderv2/getmaptilepreview for details.',
attribution: 'See https://docs.microsoft.com/en-us/rest/api/maps/render-v2/get-map-tile for details.',
apiVersion: '2.0',
variant: 'microsoft.imagery',
subscriptionKey: '<insert your subscription key here>',
@ -1072,7 +1060,7 @@
'&subscription-key={subscriptionKey}',
options: {
timeStamp: '2021-05-08T09:03:00Z',
attribution: 'See https://docs.microsoft.com/en-US/rest/api/maps/renderv2/getmaptilepreview#uri-parameters for details.',
attribution: 'See https://docs.microsoft.com/en-us/rest/api/maps/render-v2/get-map-tile#uri-parameters for details.',
variant: 'microsoft.weather.infrared.main',
},
},
@ -1084,11 +1072,30 @@
'&subscription-key={subscriptionKey}',
options: {
timeStamp: '2021-05-08T09:03:00Z',
attribution: 'See https://docs.microsoft.com/en-US/rest/api/maps/renderv2/getmaptilepreview#uri-parameters for details.',
attribution: 'See https://docs.microsoft.com/en-us/rest/api/maps/render-v2/get-map-tile#uri-parameters for details.',
variant: 'microsoft.weather.radar.main',
},
}
},
},
SwissFederalGeoportal: {
url: 'https://wmts.geo.admin.ch/1.0.0/{variant}/default/current/3857/{z}/{x}/{y}.jpeg',
options: {
attribution: '&copy; <a href="https://www.swisstopo.admin.ch/">swisstopo</a>',
minZoom: 2,
maxZoom: 18,
bounds: [[45.398181, 5.140242], [48.230651, 11.47757]]
},
variants: {
NationalMapColor: 'ch.swisstopo.pixelkarte-farbe',
NationalMapGrey: 'ch.swisstopo.pixelkarte-grau',
SWISSIMAGE: {
options: {
variant: 'ch.swisstopo.swissimage',
maxZoom: 19
}
}
}
}
};

Loading…
Cancel
Save