Browse Source

Version 4.26.0 : maj de leaflet-providers, ajout de quatre nouveaux fonds de carte CartoDB

svn/root/tags/v4.47.18
brunobergot@gmail.com 8 years ago
parent
commit
11e7f8fd82
  1. 16
      gis_options.php
  2. 96
      lib/leaflet/plugins/leaflet-providers.js
  3. 2
      paquet.xml

16
gis_options.php

@ -141,6 +141,22 @@ $GLOBALS['gis_layers'] = array (
'acetate' => array(
'nom' => 'Acetate',
'layer' => 'L.tileLayer.provider("Acetate.all")'
),
'cartodb_positron' => array(
'nom' => 'CartoDB Positron',
'layer' => 'L.tileLayer.provider("CartoDB.Positron")'
),
'cartodb_positron_base' => array(
'nom' => 'CartoDB Positron Base',
'layer' => 'L.tileLayer.provider("CartoDB.PositronNoLabels")'
),
'cartodb_darkmatter' => array(
'nom' => 'CartoDB DarkMatter',
'layer' => 'L.tileLayer.provider("CartoDB.DarkMatter")'
),
'cartodb_darkmatter_base' => array(
'nom' => 'CartoDB DarkMatter Base',
'layer' => 'L.tileLayer.provider("CartoDB.DarkMatterNoLabels")'
)
);

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

@ -72,8 +72,7 @@
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>'
'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
},
variants: {
Mapnik: {},
@ -216,7 +215,7 @@
Watercolor: {
options: {
variant: 'watercolor',
minZoom: 3,
minZoom: 1,
maxZoom: 16
}
}
@ -419,68 +418,43 @@
labels: 'acetate-labels',
hillshading: 'hillshading'
}
}
};
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');
};
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;
},
FreeMapSK: {
url: 'http://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
options: {
minZoom: 8,
maxZoom: 16,
subdomains: ['t1', 't2', 't3', 't4'],
attribution:
'{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'
}
if (overlay && overlay.length) {
(function () {
var out = {},
len = overlay.length,
i = 0;
while (i < len) {
if (typeof overlay[i] === 'string') {
out[labelFormatter(overlay[i])] = L.tileLayer.provider(overlay[i]);
}
i++;
}
overlay = out;
}());
},
MtbMap: {
url: 'http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png',
options: {
attribution:
'{attribution.OpenStreetMap} &amp; USGS'
}
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);
CartoDB: {
url: 'http://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution: '{attribution.OpenStreetMap} &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
subdomains: 'abcd',
minZoom: 0,
maxZoom: 18,
variant: 'light_all'
},
variants: {
Positron: 'light_all',
PositronNoLabels: 'light_nolabels',
DarkMatter: 'dark_all',
DarkMatterNoLabels: 'dark_nolabels'
}
}
});
};
L.control.layers.provided = function (baseLayers, overlays, options) {
return new L.Control.Layers.Provided(baseLayers, overlays, options);
L.tileLayer.provider = function (provider, options) {
return new L.TileLayer.Provider(provider, options);
};
}());

2
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="gis"
categorie="divers"
version="4.25.2"
version="4.26.0"
schema="2.0.7"
etat="stable"
compatibilite="[3.0.0;3.1.*]"

Loading…
Cancel
Save