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) {
|
||||
var key = Drupal.settings.farm_map.behaviors.mapbox.api_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 = {
|
||||
title: title,
|
||||
url: 'https://api.mapbox.com/v4/' + tileset + '/{z}/{x}/{y}.png?access_token=' + key,
|
||||
group: 'Base layers',
|
||||
base: true,
|
||||
visible: false,
|
||||
visible: visible,
|
||||
};
|
||||
instance.addLayer('xyz', opts);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue