forked from MapComplete/MapComplete
Finish refactoring
This commit is contained in:
parent
eff6b5bfad
commit
71285d34cd
3 changed files with 9 additions and 12 deletions
|
@ -68,13 +68,10 @@ export default class GeoJsonSource implements FeatureSourceForLayer, Tiled {
|
|||
const self = this;
|
||||
Utils.downloadJson(url)
|
||||
.then(json => {
|
||||
if(json.elements === undefined || json.elements === null){
|
||||
return;
|
||||
}
|
||||
if (json.elements === [] && json.remarks.indexOf("runtime error") > 0) {
|
||||
self.onFail("Runtime error (timeout)", url)
|
||||
if(json.features === undefined || json.features === null){
|
||||
return;
|
||||
}
|
||||
|
||||
const time = new Date();
|
||||
const newFeatures: { feature: any, freshness: Date } [] = []
|
||||
let i = 0;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import LayoutConfig from "../../Models/ThemeConfig/LayoutConfig";
|
||||
import FeaturePipeline from "../FeatureSource/FeaturePipeline";
|
||||
import State from "../../State";
|
||||
import {Tiles} from "../../Models/TileRange";
|
||||
import ShowDataLayer from "../../UI/ShowDataLayer/ShowDataLayer";
|
||||
import {TileHierarchyAggregator} from "../../UI/ShowDataLayer/TileHierarchyAggregator";
|
||||
|
@ -37,13 +36,13 @@ export default class FeaturePipelineState extends MapState {
|
|||
// Do show features indicates if the 'showDataLayer' should be shown
|
||||
const doShowFeatures = source.features.map(
|
||||
f => {
|
||||
const z = State.state.locationControl.data.zoom
|
||||
const z = self.locationControl.data.zoom
|
||||
|
||||
if (!source.layer.isDisplayed.data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const bounds = State.state.currentBounds.data
|
||||
const bounds = self.currentBounds.data
|
||||
if (bounds === undefined) {
|
||||
// Map is not yet displayed
|
||||
return false;
|
||||
|
@ -86,7 +85,7 @@ export default class FeaturePipelineState extends MapState {
|
|||
|
||||
|
||||
return true
|
||||
}, [State.state.currentBounds, source.layer.isDisplayed]
|
||||
}, [this.currentBounds, source.layer.isDisplayed]
|
||||
)
|
||||
|
||||
new ShowDataLayer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue