Browse Source

mapLayers: collect available mapLayers in object

master
parent
commit
1926ab109c
  1. 3
      conf.php-dist
  2. 3
      src/mapLayers.js

3
conf.php-dist

@ -23,18 +23,21 @@ $config['maxZoom'] = 19;
// Available base maps; first is default
$config['baseMaps'] = array(
array(
'id' => 'osm-mapnik',
'name' => 'OSM Default',
'attribution' => '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
'url' => '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
'maxZoom' => 19,
),
array(
'id' => 'osm-cyle',
'name' => 'OSM CycleMap',
'attribution' => '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors, Tiles: <a href="http://www.thunderforest.com/">Andy Allan</a>',
'url' => '//{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png',
'maxZoom' => 18,
),
array(
'id' => 'opentopomap',
'name' => 'OpenTopoMap',
'attribution' => '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors, Tiles: <a href="http://opentopomap.org/">OpenTopoMap</a>',
'url' => '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',

3
src/mapLayers.js

@ -1,3 +1,5 @@
var mapLayers = {}
register_hook('init', function () {
if (!config.baseMaps) {
var osm_mapnik = L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
@ -30,6 +32,7 @@ register_hook('init', function () {
}
layers[def.name] = layer
mapLayers[def.id] = layer
}
firstLayer.addTo(map)

Loading…
Cancel
Save