Make the Mapbox Satellite layer visible by default.

This commit is contained in:
Michael Stenta 2020-02-17 13:40:50 -05:00
parent 19579e91df
commit 76bedcb779
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}