forked from MapComplete/MapComplete
More refactoring
This commit is contained in:
parent
849c61c8a1
commit
e4a2fd1daf
15 changed files with 75 additions and 44 deletions
|
@ -33,7 +33,7 @@ export default class AvailableBaseLayers {
|
|||
public availableEditorLayers: UIEventSource<BaseLayer[]>;
|
||||
|
||||
constructor(location: UIEventSource<{ lat: number, lon: number, zoom: number }>,
|
||||
bm: Basemap) {
|
||||
currentBackgroundLayer: UIEventSource<BaseLayer>) {
|
||||
const self = this;
|
||||
this.availableEditorLayers =
|
||||
location.map(
|
||||
|
@ -59,8 +59,7 @@ export default class AvailableBaseLayers {
|
|||
|
||||
// Change the baselayer back to OSM if we go out of the current range of the layer
|
||||
this.availableEditorLayers.addCallbackAndRun(availableLayers => {
|
||||
const layerControl = bm.CurrentLayer;
|
||||
const currentLayer = layerControl.data.id;
|
||||
const currentLayer = currentBackgroundLayer.data.id;
|
||||
for (const availableLayer of availableLayers) {
|
||||
if (availableLayer.id === currentLayer) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue