Fixed basemap bug

pull/516/head
Piero Toffanin 2018-09-06 08:18:49 -04:00
rodzic 3a0d97d463
commit df1696f61e
1 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -195,7 +195,9 @@ class Map extends React.Component {
}).addTo(this.map);
if (showBackground) {
this.basemaps = Basemaps.map((src, idx) => {
this.basemaps = {};
Basemaps.forEach((src, idx) => {
const { url, ...props } = src;
const layer = L.tileLayer(url, props);
@ -203,11 +205,7 @@ class Map extends React.Component {
layer.addTo(this.map);
}
return [props.label, layer];
}).reduce((acc, [k, v]) => {
acc[k] = v;
return acc;
this.basemaps[props.label] = layer;
});
}