forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
c9ce29f206
commit
40e894df8b
294 changed files with 14209 additions and 4192 deletions
|
|
@ -9,7 +9,8 @@ import { OsmFeature } from "../../../Models/OsmFeature"
|
|||
* If multiple sources contain the same object (as determined by 'id'), only one copy of them is retained
|
||||
*/
|
||||
export default class FeatureSourceMerger<Src extends FeatureSource = FeatureSource>
|
||||
implements IndexedFeatureSource {
|
||||
implements IndexedFeatureSource
|
||||
{
|
||||
public features: UIEventSource<Feature[]> = new UIEventSource([])
|
||||
public readonly featuresById: Store<Map<string, Feature>>
|
||||
protected readonly _featuresById: UIEventSource<Map<string, Feature>>
|
||||
|
|
@ -118,10 +119,11 @@ export default class FeatureSourceMerger<Src extends FeatureSource = FeatureSour
|
|||
}
|
||||
|
||||
export class UpdatableFeatureSourceMerger<
|
||||
Src extends UpdatableFeatureSource = UpdatableFeatureSource
|
||||
>
|
||||
Src extends UpdatableFeatureSource = UpdatableFeatureSource
|
||||
>
|
||||
extends FeatureSourceMerger<Src>
|
||||
implements IndexedFeatureSource, UpdatableFeatureSource {
|
||||
implements IndexedFeatureSource, UpdatableFeatureSource
|
||||
{
|
||||
constructor(...sources: Src[]) {
|
||||
super(...sources)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import { Store, UIEventSource } from "../../UIEventSource"
|
|||
import { FeatureSourceForTile, UpdatableFeatureSource } from "../FeatureSource"
|
||||
import { MvtToGeojson } from "mvt-to-geojson"
|
||||
|
||||
|
||||
export default class MvtSource implements FeatureSourceForTile, UpdatableFeatureSource {
|
||||
public readonly features: Store<GeojsonFeature<Geometry, { [name: string]: any }>[]>
|
||||
public readonly x: number
|
||||
|
|
@ -28,7 +27,7 @@ export default class MvtSource implements FeatureSourceForTile, UpdatableFeature
|
|||
y: number,
|
||||
z: number,
|
||||
layerName?: string,
|
||||
isActive?: Store<boolean>,
|
||||
isActive?: Store<boolean>
|
||||
) {
|
||||
this._url = url
|
||||
this._layerName = layerName
|
||||
|
|
@ -43,7 +42,7 @@ export default class MvtSource implements FeatureSourceForTile, UpdatableFeature
|
|||
}
|
||||
return fs
|
||||
},
|
||||
[isActive],
|
||||
[isActive]
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +53,6 @@ export default class MvtSource implements FeatureSourceForTile, UpdatableFeature
|
|||
await this.currentlyRunning
|
||||
}
|
||||
|
||||
|
||||
private async download(): Promise<void> {
|
||||
try {
|
||||
const result = await fetch(this._url)
|
||||
|
|
@ -66,7 +64,7 @@ export default class MvtSource implements FeatureSourceForTile, UpdatableFeature
|
|||
const features = MvtToGeojson.fromBuffer(buffer, this.x, this.y, this.z)
|
||||
for (const feature of features) {
|
||||
const properties = feature.properties
|
||||
if(!properties["osm_type"]){
|
||||
if (!properties["osm_type"]) {
|
||||
continue
|
||||
}
|
||||
let type: string = "node"
|
||||
|
|
@ -90,6 +88,4 @@ export default class MvtSource implements FeatureSourceForTile, UpdatableFeature
|
|||
console.error("Could not download MVT " + this._url + " tile due to", e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ export class SummaryTileSourceRewriter implements FeatureSource {
|
|||
filteredLayers: ReadonlyMap<string, FilteredLayer>
|
||||
) {
|
||||
this.filteredLayers = Array.from(filteredLayers.values()).filter(
|
||||
(l) =>
|
||||
Constants.priviliged_layers.indexOf(<any>l.layerDef.id) < 0
|
||||
(l) => Constants.priviliged_layers.indexOf(<any>l.layerDef.id) < 0
|
||||
)
|
||||
this._summarySource = summarySource
|
||||
filteredLayers.forEach((v) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue