mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Make the Mapbox Satellite layer visible by default.
This commit is contained in:
parent
19579e91df
commit
76bedcb779
|
@ -3,15 +3,15 @@
|
||||||
attach: function (instance) {
|
attach: function (instance) {
|
||||||
var key = Drupal.settings.farm_map.behaviors.mapbox.api_key;
|
var key = Drupal.settings.farm_map.behaviors.mapbox.api_key;
|
||||||
this.addMapboxLayer(instance, 'Mapbox Outdoors', 'mapbox.outdoors', key);
|
this.addMapboxLayer(instance, 'Mapbox Outdoors', 'mapbox.outdoors', key);
|
||||||
this.addMapboxLayer(instance, 'Mapbox Satellite', 'mapbox.satellite', key);
|
this.addMapboxLayer(instance, 'Mapbox Satellite', 'mapbox.satellite', key, true);
|
||||||
},
|
},
|
||||||
addMapboxLayer: function (instance, title, tileset, key) {
|
addMapboxLayer: function (instance, title, tileset, key, visible = false) {
|
||||||
var opts = {
|
var opts = {
|
||||||
title: title,
|
title: title,
|
||||||
url: 'https://api.mapbox.com/v4/' + tileset + '/{z}/{x}/{y}.png?access_token=' + key,
|
url: 'https://api.mapbox.com/v4/' + tileset + '/{z}/{x}/{y}.png?access_token=' + key,
|
||||||
group: 'Base layers',
|
group: 'Base layers',
|
||||||
base: true,
|
base: true,
|
||||||
visible: false,
|
visible: visible,
|
||||||
};
|
};
|
||||||
instance.addLayer('xyz', opts);
|
instance.addLayer('xyz', opts);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue