Browse Source

version 4.32.1 : maj de la lib leaflet-providers pour ajout de deux nouvelles couches

Pioneer et SpinalMap pour faire des cartes métaaaaaaal :p
svn/root/tags/v4.47.18
brunobergot@gmail.com 7 years ago
parent
commit
9fdbc9243b
  1. 8
      gis_options.php
  2. 93
      lib/leaflet/plugins/leaflet-providers.js
  3. 2
      paquet.xml

8
gis_options.php

@ -62,6 +62,14 @@ $gis_layers = array (
'nom' => 'Thunderforest Outdoors',
'layer' => 'L.tileLayer.provider("Thunderforest.Outdoors")'
),
'thunderforest_spinalmap' => array(
'nom' => 'Thunderforest SpinalMap',
'layer' => 'L.tileLayer.provider("Thunderforest.SpinalMap")'
),
'thunderforest_pioneer' => array(
'nom' => 'Thunderforest Pioneer',
'layer' => 'L.tileLayer.provider("Thunderforest.Pioneer")'
),
'opentopomap' => array(
'nom' => 'OpenTopoMap',
'layer' => 'L.tileLayer.provider("OpenTopoMap")'

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

@ -1,11 +1,14 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['leaflet'], factory);
} else {
// Assume leaflet is loaded into global object L already
factory(L);
}
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['leaflet'], factory);
} else if (typeof modules === 'object' && module.exports) {
// define a Common JS module that relies on 'leaflet'
module.exports = factory(require('leaflet'));
} else {
// Assume Leaflet is loaded into global object L already
factory(L);
}
}(this, function (L) {
'use strict';
@ -54,6 +57,19 @@
provider.url = 'http:' + provider.url;
}
// If retina option is set
if (provider.options.retina) {
// Check retina screen
if (options.detectRetina && L.Browser.retina) {
// The retina option will be active now
// But we need to prevent Leaflet retina mode
options.detectRetina = false;
} else {
// No retina, remove option
provider.options.retina = '';
}
}
// replace attribution placeholders with their values from toplevel provider attribution,
// recursively
var attributionReplacer = function (attr) {
@ -132,7 +148,7 @@
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution:
'&copy; <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}',
'&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}',
variant: 'cycle'
},
variants: {
@ -149,8 +165,15 @@
maxZoom: 19
}
},
SpinalMap: {
options: {
variant: 'spinal-map',
maxZoom: 11
}
},
Landscape: 'landscape',
Outdoors: 'outdoors'
Outdoors: 'outdoors',
Pioneer: 'pioneer'
}
},
OpenMapSurfer: {
@ -231,7 +254,7 @@
}
},
Stamen: {
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.png',
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
options: {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
@ -406,8 +429,8 @@
*/
url:
'//{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
'maptile/{mapID}/{variant}/{z}/{x}/{y}/256/png8?' +
'app_id={app_id}&app_code={app_code}',
'{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?' +
'app_id={app_id}&app_code={app_code}&lg={language}',
options: {
attribution:
'Map &copy; 1987-2014 <a href="http://developer.here.com">HERE</a>',
@ -417,7 +440,11 @@
'app_code': '<insert your app_code here>',
base: 'base',
variant: 'normal.day',
maxZoom: 20
maxZoom: 20,
type: 'maptile',
language: 'eng',
format: 'png8',
size: '256'
},
variants: {
normalDay: 'normal.day',
@ -432,6 +459,23 @@
normalNightGrey: 'normal.night.grey',
normalNightGreyMobile: 'normal.night.grey.mobile',
basicMap: {
options: {
type: 'basetile'
}
},
mapLabels: {
options: {
type: 'labeltile',
format: 'png'
}
},
trafficFlow: {
options: {
base: 'traffic',
type: 'flowtile'
}
},
carnavDayGrey: 'carnav.day.grey',
hybridDay: {
options: {
@ -468,11 +512,12 @@
}
},
FreeMapSK: {
url: 'http://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
url: 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
options: {
minZoom: 8,
maxZoom: 16,
subdomains: ['t1', 't2', 't3', 't4'],
subdomains: '1234',
bounds: [[47.204642, 15.996093], [49.830896, 22.576904]],
attribution:
'{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'
}
@ -601,6 +646,24 @@
}
}
}
},
NLS: {
// NLS maps are copyright National library of Scotland.
// http://maps.nls.uk/projects/api/index.html
// Please contact NLS for anything other than non-commercial low volume usage
//
// Map sources: Ordnance Survey 1:1m to 1:63K, 1920s-1940s
// z0-9 - 1:1m
// z10-11 - quarter inch (1:253440)
// z12-18 - one inch (1:63360)
url: '//nls-{s}.tileserver.com/nls/{z}/{x}/{y}.jpg',
options: {
attribution: '<a href="http://geo.nls.uk/maps/">National Library of Scotland Historic Maps</a>',
bounds: [[49.6, -12], [61.7, 3]],
minZoom: 1,
maxZoom: 18,
subdomains: '0123',
}
}
};

2
paquet.xml

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

Loading…
Cancel
Save