Skip to content

Commit

Permalink
Upgrade leaflet to 0.7.7
Browse files Browse the repository at this point in the history
In preparation of the upgrade to leaflet 1.0 (not yet available)
we upgrade to the latest stable release 0.7.7.
We also upgrade the leaflet-provider plugin and remove obsolete
base layers from the layer selection.

fixes #111
  • Loading branch information
xrotwang committed Sep 9, 2016
1 parent 51a155e commit 34830bc
Show file tree
Hide file tree
Showing 4 changed files with 521 additions and 263 deletions.
1 change: 1 addition & 0 deletions clld/web/static/css/leaflet.css
Expand Up @@ -21,6 +21,7 @@
.leaflet-container {
overflow: hidden;
-ms-touch-action: none;
touch-action: none;
}
.leaflet-tile,
.leaflet-marker-icon,
Expand Down
40 changes: 25 additions & 15 deletions clld/web/static/js/clld.js
Expand Up @@ -394,21 +394,25 @@ CLLD.Map = function(eid, layers, options) {

var i, hash, opts, name,
local_data = false,
baseLayersMap = {},
baseLayers = [
"Thunderforest.Landscape",
"Thunderforest.Transport",
"OpenStreetMap.Mapnik",
"OpenStreetMap.BlackAndWhite",
"MapQuestOpen.OSM",
"MapQuestOpen.Aerial",
"Stamen.Watercolor",
"Esri.WorldStreetMap",
"Esri.DeLorme",
"Esri.WorldTopoMap",
"Esri.WorldImagery",
"Esri.WorldTerrain",
"Esri.WorldShadedRelief",
"Esri.WorldPhysical"];
"Thunderforest.Landscape",
"Thunderforest.Transport",
"OpenStreetMap.Mapnik",
"OpenStreetMap.BlackAndWhite",
"OpenTopoMap",
"OpenMapSurfer.Roads",
"Stamen.Watercolor",
"Stamen.Terrain",
"Stamen.TerrainBackground",
"Esri.WorldStreetMap",
"Esri.DeLorme",
"Esri.WorldTopoMap",
"Esri.WorldImagery",
"Esri.WorldTerrain",
"Esri.WorldShadedRelief",
"Esri.WorldPhysical"
];

if (this.options.base_layer) {
baseLayers = [this.options.base_layer].concat(baseLayers);
Expand Down Expand Up @@ -539,7 +543,13 @@ CLLD.Map = function(eid, layers, options) {
if (this.options.tile_layer != undefined) {
L.tileLayer(this.options.tile_layer.url_pattern, this.options.tile_layer.options).addTo(this.map);
} else {
L.control.layers.provided(baseLayers, []).addTo(this.map);
for (i = 0; i < baseLayers.length; ++i) {
baseLayersMap[baseLayers[i]] = L.tileLayer.provider(baseLayers[i]);
if (i == 0) {
baseLayersMap[baseLayers[i]].addTo(this.map)
}
}
L.control.layers(baseLayersMap).addTo(this.map);
}

this.marker_map = {};
Expand Down

0 comments on commit 34830bc

Please sign in to comment.