Add caching into local storage for a faster map experience

This commit is contained in:
Pieter Vander Vennet 2021-01-15 00:29:07 +01:00
parent 3a2d654ac3
commit f33fe081d0
12 changed files with 128 additions and 41 deletions

View file

@ -18,7 +18,7 @@ export default class ScrollableFullScreen extends UIElement {
State.state.selectedElement.setData(undefined);
}).SetClass("only-on-mobile")
.SetClass("featureinfobox-back-to-the-map")
title.SetClass("featureinfobox-title")
title.SetStyle("width: 100%; display: block;")
const ornament = new Combine([new Ornament().SetStyle("height:5em;")]).SetClass("only-on-mobile")
this._component = new Combine([

View file

@ -55,7 +55,6 @@ export default class EditableTagRendering extends UIElement {
}
if (this._configuration.multiAnswer) {
const atLeastOneMatch = this._configuration.mappings.some(mp =>TagUtils.MatchesMultiAnswer(mp.if, this._tags.data));
console.log("SOME MATCH?", atLeastOneMatch)
if (!atLeastOneMatch) {
return "";
}

View file

@ -41,6 +41,7 @@ export default class ShowDataLayer {
const mp = leafletMap.data;
const feats = features.data.map(ff => ff.feature);
let geoLayer = self.CreateGeojsonLayer(feats)
if (layoutToUse.clustering.minNeededElements <= features.data.length) {
const cl = window["L"]; // This is a dirty workaround, the clustering plugin binds to the L of the window, not of the namespace or something
@ -79,6 +80,7 @@ export default class ShowDataLayer {
}
})
update();
}
@ -94,7 +96,7 @@ export default class ShowDataLayer {
// We have to convert them to the appropriate icon
// Click handling is done in the next step
const tagSource = State.state.allElements.getEventSourceFor(feature);
const tagSource = State.state.allElements.addOrGetElement(feature)
const layer: LayerConfig = this._layerDict[feature._matching_layer_id];
const style = layer.GenerateLeafletStyle(tagSource, !(layer.title === undefined && (layer.tagRenderings ?? []).length === 0));