forked from MapComplete/MapComplete
		
	refactoring: Remove more obsoleted code, add copyright tab
This commit is contained in:
		
							parent
							
								
									f8d34648a0
								
							
						
					
					
						commit
						042d400dc4
					
				
					 20 changed files with 44 additions and 342 deletions
				
			
		|  | @ -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 | ||||
|     } | ||||
| } | ||||
|  | @ -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) | ||||
|             }, | ||||
|  |  | |||
|  | @ -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 | ||||
|         }) | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -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) | ||||
|     } | ||||
| } | ||||
|  | @ -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 [] | ||||
|         } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue