refactoring: Remove more obsoleted code, add copyright tab

This commit is contained in:
Pieter Vander Vennet 2023-04-07 04:23:45 +02:00
parent f8d34648a0
commit 042d400dc4
20 changed files with 44 additions and 342 deletions

View file

@ -1,25 +0,0 @@
import { UIEventSource } from "../UIEventSource"
import FilteredLayer from "../../Models/FilteredLayer"
import ScrollableFullScreen from "../../UI/Base/ScrollableFullScreen"
import BaseUIElement from "../../UI/BaseUIElement"
/**
* The stray-click-handler adds a marker to the map if no feature was clicked.
* Shows the given uiToShow-element in the messagebox
*
* Note: the actual implementation is in StrayClickHandlerImplementation
*/
export default class StrayClickHandler {
public static construct = (
state: {
LastClickLocation: UIEventSource<{ lat: number; lon: number }>
selectedElement: UIEventSource<string>
filteredLayers: UIEventSource<FilteredLayer[]>
leafletMap: UIEventSource<any>
},
uiToShow: ScrollableFullScreen,
iconToShow: BaseUIElement
) => {
return undefined
}
}

View file

@ -11,13 +11,13 @@ export default class ContributorCount {
private lastUpdate: Date = undefined
constructor(state: {
bounds: Store<BBox>
mapProperties: { bounds: Store<BBox> }
dataIsLoading: Store<boolean>
perLayer: ReadonlyMap<string, GeoIndexedStore>
}) {
this.perLayer = state.perLayer
const self = this
state.bounds.mapD(
state.mapProperties.bounds.mapD(
(bbox) => {
self.update(bbox)
},

View file

@ -1,4 +1,4 @@
import { FeatureSource , FeatureSourceForLayer } from "../FeatureSource"
import { FeatureSource, FeatureSourceForLayer } from "../FeatureSource"
import { Feature } from "geojson"
import { BBox } from "../../BBox"
import { GeoOperations } from "../../GeoOperations"
@ -26,9 +26,12 @@ export default class GeoIndexedStore implements FeatureSource {
public GetFeaturesWithin(bbox: BBox): Feature[] {
// TODO optimize
const bboxFeature = bbox.asGeoJson({})
return this.features.data.filter(
(f) => GeoOperations.intersect(f, bboxFeature) !== undefined
)
return this.features.data.filter((f) => {
if (f.geometry.type === "Point") {
return bbox.contains(<[number, number]>f.geometry.coordinates)
}
return GeoOperations.intersect(f, bboxFeature) !== undefined
})
}
}

View file

@ -1,17 +0,0 @@
import SelectedFeatureHandler from "../Actors/SelectedFeatureHandler"
import Hash from "../Web/Hash"
import MetaTagRecalculator from "../FeatureSource/Actors/MetaTagRecalculator"
export default class FeaturePipelineState {
/**
* The piece of code which fetches data from various sources and shows it on the background map
*/
public readonly featurePipeline: FeaturePipeline
private readonly metatagRecalculator: MetaTagRecalculator
constructor() {
this.metatagRecalculator = new MetaTagRecalculator(this, this.featurePipeline)
this.metatagRecalculator.registerSource(this.currentView)
new SelectedFeatureHandler(Hash.hash, this)
}
}

View file

@ -244,7 +244,7 @@ export class RegexTag extends TagsFilter {
return []
}
asChange(properties: Record<string, string>): { k: string; v: string }[] {
asChange(): { k: string; v: string }[] {
if (this.invert) {
return []
}