Browse Source

Version 4.9.8 : maj des libs + ajout d'une nouvelle couche (OSM H.O.T.) + le fullscreen fonctionne aussi sous ie maintenant (pseudo fullscreen)

svn/root/tags/v4.47.18
brunobergot@gmail.com 9 years ago
parent
commit
0d1ce61813
  1. 4
      gis_options.php
  2. 26
      lib/leaflet/plugins/Bing.js
  3. 36
      lib/leaflet/plugins/Control.FullScreen.js
  4. 29
      lib/leaflet/plugins/Control.MiniMap.js
  5. 16
      lib/leaflet/plugins/leaflet-plugins.css
  6. 213
      lib/leaflet/plugins/leaflet-providers.js
  7. 65
      lib/leaflet/plugins/leaflet.markercluster-src.js
  8. 14
      lib/leaflet/plugins/leaflet.markercluster.css
  9. 1
      lib/leaflet/plugins/leaflet.markercluster.ie.css
  10. 2
      paquet.xml

4
gis_options.php

@ -19,6 +19,10 @@ $GLOBALS['gis_layers'] = array (
'nom' => 'OpenStreetMap DE',
'layer' => 'L.tileLayer.provider("OpenStreetMap.DE")'
),
'openstreetmap_hot' => array(
'nom' => 'OpenStreetMap H.O.T.',
'layer' => 'L.tileLayer.provider("OpenStreetMap.HOT")'
),
'google_roadmap' => array(
'nom' => 'Google Roadmap',
'layer' => 'L.Google("ROADMAP")'

26
lib/leaflet/plugins/Bing.js

@ -64,18 +64,20 @@ L.BingLayer = L.TileLayer.extend({
this.options.subdomains = r.imageUrlSubdomains;
this._url = r.imageUrl;
this._providers = [];
for (var i = 0; i < r.imageryProviders.length; i++) {
var p = r.imageryProviders[i];
for (var j = 0; j < p.coverageAreas.length; j++) {
var c = p.coverageAreas[j];
var coverage = {zoomMin: c.zoomMin, zoomMax: c.zoomMax, active: false};
var bounds = new L.LatLngBounds(
new L.LatLng(c.bbox[0]+0.01, c.bbox[1]+0.01),
new L.LatLng(c.bbox[2]-0.01, c.bbox[3]-0.01)
);
coverage.bounds = bounds;
coverage.attrib = p.attribution;
this._providers.push(coverage);
if (r.imageryProviders) {
for (var i = 0; i < r.imageryProviders.length; i++) {
var p = r.imageryProviders[i];
for (var j = 0; j < p.coverageAreas.length; j++) {
var c = p.coverageAreas[j];
var coverage = {zoomMin: c.zoomMin, zoomMax: c.zoomMax, active: false};
var bounds = new L.LatLngBounds(
new L.LatLng(c.bbox[0]+0.01, c.bbox[1]+0.01),
new L.LatLng(c.bbox[2]-0.01, c.bbox[3]-0.01)
);
coverage.bounds = bounds;
coverage.attrib = p.attribution;
this._providers.push(coverage);
}
}
}
this._update();

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

@ -6,13 +6,9 @@ L.Control.FullScreen = L.Control.extend({
},
onAdd: function (map) {
// Do nothing if we can't
if (!fullScreenApi.supportsFullScreen)
return map.zoomControl ? map.zoomControl._container : L.DomUtil.create('div', '');
var className = 'leaflet-control-zoom-fullscreen', container;
if(map.zoomControl && !this.options.forceSeparateButton) {
if (map.zoomControl && !this.options.forceSeparateButton) {
container = map.zoomControl._container;
} else {
container = L.DomUtil.create('div', 'leaflet-bar');
@ -48,24 +44,32 @@ L.Control.FullScreen = L.Control.extend({
toogleFullScreen: function () {
this._exitFired = false;
if (fullScreenApi.supportsFullScreen){
var container = this._container;
if(fullScreenApi.isFullScreen(container)){
var container = this._container;
if (this._isFullscreen) {
if (fullScreenApi.supportsFullScreen) {
fullScreenApi.cancelFullScreen(container);
this.invalidateSize();
this.fire('exitFullscreen');
this._exitFired = true;
} else {
L.DomUtil.removeClass(container, 'leaflet-pseudo-fullscreen');
}
else {
this.invalidateSize();
this.fire('exitFullscreen');
this._exitFired = true;
this._isFullscreen = false;
}
else {
if (fullScreenApi.supportsFullScreen) {
fullScreenApi.requestFullScreen(container);
this.invalidateSize();
this.fire('enterFullscreen');
} else {
L.DomUtil.addClass(container, 'leaflet-pseudo-fullscreen');
}
this.invalidateSize();
this.fire('enterFullscreen');
this._isFullscreen = true;
}
},
_handleEscKey: function () {
if(!fullScreenApi.isFullScreen(this) && !this._exitFired){
if (!fullScreenApi.isFullScreen(this) && !this._exitFired) {
this.fire('exitFullscreen');
this._exitFired = true;
}
@ -135,7 +139,7 @@ source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugi
}
}
fullScreenApi.requestFullScreen = function(el) {
return (this.prefix === '') ? el.requestFullscreen() : el[this.prefix + 'RequestFullScreen']();
return (this.prefix === '') ? el.requestFullscreen() : el[this.prefix + 'RequestFullScreen'](Element.ALLOW_KEYBOARD_INPUT);
}
fullScreenApi.cancelFullScreen = function(el) {
return (this.prefix === '') ? document.exitFullscreen() : document[this.prefix + 'CancelFullScreen']();

29
lib/leaflet/plugins/Control.MiniMap.js

@ -41,7 +41,8 @@ L.Control.MiniMap = L.Control.extend({
touchZoom: !this.options.zoomLevelFixed,
scrollWheelZoom: !this.options.zoomLevelFixed,
doubleClickZoom: !this.options.zoomLevelFixed,
boxZoom: !this.options.zoomLevelFixed
boxZoom: !this.options.zoomLevelFixed,
crs: map.options.crs
});
this._miniMap.addLayer(this._layer);
@ -201,8 +202,30 @@ L.Control.MiniMap = L.Control.extend({
if (!this.options.zoomLevelFixed) {
if (fromMaintoMini)
return this._mainMap.getZoom() + this.options.zoomLevelOffset;
else
return this._miniMap.getZoom() - this.options.zoomLevelOffset;
else {
var currentDiff = this._miniMap.getZoom() - this._mainMap.getZoom();
var proposedZoom = this._miniMap.getZoom() - this.options.zoomLevelOffset;
var toRet;
if (currentDiff > this.options.zoomLevelOffset && this._mainMap.getZoom() < this._miniMap.getMinZoom() - this.options.zoomLevelOffset) {
//This means the miniMap is zoomed out to the minimum zoom level and can't zoom any more.
if (this._miniMap.getZoom() > this._lastMiniMapZoom) {
//This means the user is trying to zoom in by using the minimap, zoom the main map.
toRet = this._mainMap.getZoom() + 1;
//Also we cheat and zoom the minimap out again to keep it visually consistent.
this._miniMap.setZoom(this._miniMap.getZoom() -1);
} else {
//Either the user is trying to zoom out past the mini map's min zoom or has just panned using it, we can't tell the difference.
//Therefore, we ignore it!
toRet = this._mainMap.getZoom();
}
} else {
//This is what happens in the majority of cases, and always if you configure the min levels + offset in a sane fashion.
toRet = proposedZoom;
}
this._lastMiniMapZoom = this._miniMap.getZoom();
return toRet;
}
} else {
if (fromMaintoMini)
return this.options.zoomLevelFixed;

16
lib/leaflet/plugins/leaflet-plugins.css

@ -1,11 +1,13 @@
/* L.Control.FullScreen */
.leaflet-control-zoom-fullscreen { background-image: url(images/icon-fullscreen.png); }
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; }
.leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen.png); }
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
/* MiniMap Plugin */
.leaflet-control-minimap { border: solid rgba(255, 255, 255, 0.7) 3px; box-shadow: 0 1px 7px #999; background: #f8f8f9; -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
.leaflet-control-minimap a { background-color: rgba(255, 255, 255, 0.75); background-position: 1px 2px; background-repeat: no-repeat; display: block; outline: none; z-index: 99999; }
.leaflet-control-minimap { border: solid rgba(255, 255, 255, 1.0) 3px; box-shadow: 0 1px 7px #999; background: #f8f8f9; -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; transition: all .2s; }
.leaflet-control-minimap a { background-color: rgba(255, 255, 255, 1.0); background-position: 1px 2px; background-repeat: no-repeat; display: block; outline: none; z-index: 99999; transition: all .2s; }
.leaflet-control-minimap a:hover,
.leaflet-control-minimap a:focus { background-color: rgba(255, 255, 255, 0.75); }
.leaflet-control-minimap a.minimized { background-position: 1px -18px }
.leaflet-control-minimap-toggle-display { background-image: url("images/toggle.png"); border-radius: 4px 4px 4px 4px; height: 19px; width: 19px; position: absolute; bottom: 0; right: 0; }
.leaflet-control-minimap a:focus { background-color: rgba(255, 255, 255, 1.0); }
.leaflet-control-minimap a.minimized { -webkit-transform: rotate(180deg); transform: rotate(180deg); }
.leaflet-control-minimap-toggle-display { background-image: url("images/toggle.png"); border-radius: 2px 0px 2px 0px; height: 19px; width: 19px; position: absolute; bottom: 0; right: 0; }

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

@ -1,4 +1,6 @@
(function () {
'use strict';
L.TileLayer.Provider = L.TileLayer.extend({
initialize: function (arg, options) {
var providers = L.TileLayer.Provider.providers;
@ -9,7 +11,7 @@
var variantName = parts[1];
if (!providers[providerName]) {
throw "No such provider (" + providerName + ")";
throw 'No such provider (' + providerName + ')';
}
var provider = {
@ -20,7 +22,7 @@
// overwrite values in provider from variant.
if (variantName && 'variants' in providers[providerName]) {
if (!(variantName in providers[providerName].variants)) {
throw "No such name in provider (" + variantName + ")";
throw 'No such name in provider (' + variantName + ')';
}
var variant = providers[providerName].variants[variantName];
provider = {
@ -31,17 +33,23 @@
provider.url = provider.url(parts.splice(1).join('.'));
}
// replace attribution placeholders with their values from toplevel provider attribution.
var attribution = provider.options.attribution;
if (attribution.indexOf('{attribution.') != -1) {
provider.options.attribution = attribution.replace(/\{attribution.(\w*)\}/,
function(match, attributionName){
return providers[attributionName].options.attribution;
});
}
// replace attribution placeholders with their values from toplevel provider attribution,
// recursively
var attributionReplacer = function (attr) {
if (attr.indexOf('{attribution.') === -1) {
return attr;
}
return attr.replace(/\{attribution.(\w*)\}/,
function (match, attributionName) {
return attributionReplacer(providers[attributionName].options.attribution);
}
);
};
provider.options.attribution = attributionReplacer(provider.options.attribution);
// Compute final options combining provider options with any user overrides
var layer_opts = L.Util.extend({}, provider.options, options);
L.TileLayer.prototype.initialize.call(this, provider.url, layer_opts);
var layerOpts = L.Util.extend({}, provider.options, options);
L.TileLayer.prototype.initialize.call(this, provider.url, layerOpts);
}
});
@ -49,11 +57,15 @@
* Definition of providers.
* see http://leafletjs.com/reference.html#tilelayer for options in the options map.
*/
//jshint maxlen:220
L.TileLayer.Provider.providers = {
OpenStreetMap: {
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
options: {
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
attribution:
'&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
},
variants: {
Mapnik: {},
@ -62,13 +74,26 @@
},
DE: {
url: 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png'
},
HOT: {
url: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
options: {
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
}
}
}
},
OpenCycleMap: {
url: 'http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png',
options: {
attribution: '&copy; <a href="http://www.opencyclemap.org">OpenCycleMap</a>, <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
attribution:
'&copy; <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}'
}
},
OpenSeaMap: {
url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
options: {
attribution: 'Map data: &copy; <a href="http://www.openseamap.org">OpenSeaMap</a> contributors'
}
},
Thunderforest: {
@ -103,12 +128,14 @@
MapQuestOpen: {
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg',
options: {
attribution: 'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; Map data {attribution.OpenStreetMap}',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: '1234'
},
variants: {
OSM: {},
Aerial:{
Aerial: {
url: 'http://oatile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',
options: {
attribution:
@ -119,11 +146,13 @@
}
},
MapBox: {
url: function(id) {
url: function (id) {
return 'http://{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
},
options: {
attribution: 'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; Map data {attribution.OpenStreetMap}',
attribution:
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: 'abcd'
}
},
@ -131,7 +160,8 @@
url: 'http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png',
options: {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; ' +
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
'<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: 'abcd',
minZoom: 0,
@ -161,6 +191,13 @@
maxZoom: 18
}
},
TerrainBackground: {
url: 'http://{s}.tile.stamen.com/terrain-background/{z}/{x}/{y}.jpg',
options: {
minZoom: 4,
maxZoom: 18
}
},
Watercolor: {
url: 'http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg',
options: {
@ -178,7 +215,9 @@
variants: {
WorldStreetMap: {
options: {
attribution: '{attribution.Esri} &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012'
attribution:
'{attribution.Esri} &mdash; ' +
'Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012'
}
},
DeLorme: {
@ -192,20 +231,26 @@
WorldTopoMap: {
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',
options: {
attribution: '{attribution.Esri} &mdash; Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community'
attribution:
'{attribution.Esri} &mdash; ' +
'Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community'
}
},
WorldImagery: {
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
options: {
attribution: '{attribution.Esri} &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
attribution:
'{attribution.Esri} &mdash; ' +
'Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
}
},
WorldTerrain: {
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}',
options: {
maxZoom: 13,
attribution: '{attribution.Esri} &mdash; Source: USGS, Esri, TANA, DeLorme, and NPS'
attribution:
'{attribution.Esri} &mdash; ' +
'Source: USGS, Esri, TANA, DeLorme, and NPS'
}
},
WorldShadedRelief: {
@ -324,7 +369,7 @@
variants: {
all: {},
basemap: {
url: 'http://a{s}.acetate.geoiq.com/tiles/acetate-simple/{z}/{x}/{y}.png'
url: 'http://a{s}.acetate.geoiq.com/tiles/acetate-base/{z}/{x}/{y}.png'
},
terrain: {
url: 'http://a{s}.acetate.geoiq.com/tiles/terrain/{z}/{x}/{y}.png'
@ -342,54 +387,88 @@
url: 'http://a{s}.acetate.geoiq.com/tiles/hillshading/{z}/{x}/{y}.png'
}
}
},
CloudMade: {
url: 'http://{s}.tile.cloudmade.com/{apiKey}/{styleID}/256/{z}/{x}/{y}.png',
options: {
attribution:
'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Map tile imagery © <a href="http://cloudmade.com">CloudMade</a>',
minZoom: 0,
apiKey: 'abc', // Sign up for an API key at http://cloudmade.com/ - first 500,000 tile requests are free
styleID: '1'
},
variants: {
standardResolution: {
maxZoom: 18
},
highResolution: {
url: 'http://{s}.tile.cloudmade.com/{apiKey}/{styleID}@2x/256/{z}/{x}/{y}.png',
maxZoom: 19
}
}
}
};
}());
L.tileLayer.provider = function(provider, options){
return new L.TileLayer.Provider(provider, options);
};
L.tileLayer.provider = function (provider, options) {
return new L.TileLayer.Provider(provider, options);
};
L.Control.Layers.Provided = L.Control.Layers.extend({
initialize: function (base, overlay, options) {
var first;
var labelFormatter = function (label) {
return label.replace(/\./g, ': ').replace(/([a-z])([A-Z])/g, '$1 $2');
};
L.Control.Layers.Provided = L.Control.Layers.extend({
initialize: function(base, overlay, options){
var first;
if(base.length){
(function(){
var out = {},
len = base.length,
i=0;
while(i<len){
if (i === 0) {
first = L.tileLayer.provider(base[0]);
out[base[i].replace(/\./g,": ").replace(/([a-z])([A-Z])/g,"$1 $2")] = first;
} else {
out[base[i].replace(/\./g,": ").replace(/([a-z])([A-Z])/g,"$1 $2")] = L.tileLayer.provider(base[i]);
}
i++;
}
base = out;
}());
if (base.length) {
(function () {
var out = {},
len = base.length,
i = 0;
while (i < len) {
if (typeof base[i] === 'string') {
if (i === 0) {
first = L.tileLayer.provider(base[0]);
out[labelFormatter(base[i])] = first;
} else {
out[labelFormatter(base[i])] = L.tileLayer.provider(base[i]);
}
}
i++;
}
base = out;
}());
this._first = first;
}
if(overlay && overlay.length){
(function(){
var out = {},
len = overlay.length,
i=0;
while(i<len){
out[overlay[i].replace(/\./g,": ").replace(/([a-z])([A-Z])/g,"$1 $2")] = L.tileLayer.provider(overlay[i]);
i++;
}
overlay = out;
}());
}
L.Control.Layers.prototype.initialize.call(this, base, overlay, options);
}
if (overlay && overlay.length) {
(function () {
var out = {},
len = overlay.length,
i = 0;
while (i < len) {
if (typeof base[i] === 'string') {
out[labelFormatter(overlay[i])] = L.tileLayer.provider(overlay[i]);
}
i++;
}
overlay = out;
}());
}
L.Control.Layers.prototype.initialize.call(this, base, overlay, options);
},
onAdd: function(map){
this._first.addTo(map);
return L.Control.Layers.prototype.onAdd.call(this, map);
onAdd: function (map) {
this._first.addTo(map);
return L.Control.Layers.prototype.onAdd.call(this, map);
}
});
L.control.layers.provided = function (baseLayers, overlays, options) {
});
L.control.layers.provided = function (baseLayers, overlays, options) {
return new L.Control.Layers.Provided(baseLayers, overlays, options);
};
};
}());

65
lib/leaflet/plugins/leaflet.markercluster-src.js

@ -110,6 +110,15 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
removeLayer: function (layer) {
if (layer instanceof L.LayerGroup)
{
var array = [];
for (var i in layer._layers) {
array.push(layer._layers[i]);
}
return this.removeLayers(array);
}
//Non point layers
if (!layer.getLatLng) {
this._nonPointGroup.removeLayer(layer);
@ -375,6 +384,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._map = map;
var i, l, layer;
if (!isFinite(this._map.getMaxZoom())) {
throw "Map has no maxZoom specified";
}
this._featureGroup.onAdd(map);
this._nonPointGroup.onAdd(map);
@ -384,7 +397,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
for (i = 0, l = this._needsRemoving.length; i < l; i++) {
layer = this._needsRemoving[i];
this._removeLayer(layer);
this._removeLayer(layer, true);
}
this._needsRemoving = [];
@ -444,6 +457,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._featureGroup.onRemove(map);
this._nonPointGroup.onRemove(map);
this._featureGroup.clearLayers();
this._map = null;
},
@ -839,6 +854,10 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
markers = c._markers,
m;
if (!bounds.contains(startPos)) {
startPos = null;
}
if (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us
fg.removeLayer(c);
c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);
@ -1667,7 +1686,9 @@ L.MarkerCluster.include({
m.setLatLng(m._preSpiderfyLatlng);
delete m._preSpiderfyLatlng;
}
m.setZIndexOffset(0);
if (m.setZIndexOffset) {
m.setZIndexOffset(0);
}
if (m._spiderLeg) {
map.removeLayer(m._spiderLeg);
@ -1691,7 +1712,9 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
m._preSpiderfyLatlng = m._latlng;
m.setLatLng(newPos);
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
if (m.setZIndexOffset) {
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
}
fg.addLayer(m);
@ -1725,12 +1748,18 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
m.setOpacity(0);
//If it is a marker, add it now and we'll animate it out
if (m.setOpacity) {
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
m.setOpacity(0);
fg.addLayer(m);
fg.addLayer(m);
m._setPos(thisLayerPos);
m._setPos(thisLayerPos);
} else {
//Vectors just get immediately added
fg.addLayer(m);
}
}
group._forceLayout();
@ -1747,7 +1776,10 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
//Move marker to new position
m._preSpiderfyLatlng = m._latlng;
m.setLatLng(newPos);
m.setOpacity(1);
if (m.setOpacity) {
m.setOpacity(1);
}
//Add Legs.
@ -1835,9 +1867,12 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
m.setLatLng(m._preSpiderfyLatlng);
delete m._preSpiderfyLatlng;
//Hack override the location to be our center
m._setPos(thisLayerPos);
m.setOpacity(0);
if (m.setOpacity) {
m._setPos(thisLayerPos);
m.setOpacity(0);
} else {
fg.removeLayer(m);
}
//Animate the spider legs back in
if (svg) {
@ -1875,8 +1910,10 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
}
m.setOpacity(1);
m.setZIndexOffset(0);
if (m.setOpacity) {
m.setOpacity(1);
m.setZIndexOffset(0);
}
if (stillThereChildCount > 1) {
fg.removeLayer(m);

14
lib/leaflet/plugins/leaflet.markercluster.css

@ -1,3 +1,10 @@
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.2s ease-out, opacity 0.2s ease-in;
-moz-transition: -moz-transform 0.2s ease-out, opacity 0.2s ease-in;
-o-transition: -o-transform 0.2s ease-out, opacity 0.2s ease-in;
transition: transform 0.2s ease-out, opacity 0.2s ease-in;
}
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
@ -35,11 +42,4 @@
}
.marker-cluster span {
line-height: 30px;
}
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.2s ease-out, opacity 0.2s ease-in;
-moz-transition: -moz-transform 0.2s ease-out, opacity 0.2s ease-in;
-o-transition: -o-transform 0.2s ease-out, opacity 0.2s ease-in;
transition: transform 0.2s ease-out, opacity 0.2s ease-in;
}

1
lib/leaflet/plugins/leaflet.markercluster.ie.css

@ -19,4 +19,3 @@
.marker-cluster-large div {
background-color: rgb(241, 128, 23);
}

2
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="gis"
categorie="divers"
version="4.9.7"
version="4.9.8"
schema="2.0.3"
etat="stable"
compatibilite="[3.0.0;3.0.*]"

Loading…
Cancel
Save