Merge branch 'master' into develop

This commit is contained in:
pietervdvn 2021-10-08 04:34:43 +02:00
commit 3d1dc2cb26
3 changed files with 19 additions and 2 deletions

View file

@ -8,6 +8,9 @@ import {FeatureSourceForLayer, Tiled} from "../FeatureSource";
import {Tiles} from "../../../Models/TileRange";
import {BBox} from "../../BBox";
import {OsmConnection} from "../../Osm/OsmConnection";
import LayoutConfig from "../../../Models/ThemeConfig/LayoutConfig";
import {Or} from "../../Tags/Or";
import {TagsFilter} from "../../Tags/TagsFilter";
export default class OsmFeatureSource {
private readonly _backend: string;
@ -26,6 +29,7 @@ export default class OsmFeatureSource {
markTileVisited?: (tileId: number) => void
};
private readonly downloadedTiles = new Set<number>()
private readonly allowedTags: TagsFilter;
constructor(options: {
handleTile: (tile: FeatureSourceForLayer & Tiled) => void;
@ -34,6 +38,7 @@ export default class OsmFeatureSource {
state: {
readonly filteredLayers: UIEventSource<FilteredLayer[]>;
readonly osmConnection: OsmConnection;
readonly layoutToUse: LayoutConfig
},
markTileVisited?: (tileId: number) => void
}) {
@ -64,6 +69,12 @@ export default class OsmFeatureSource {
}
self.isRunning.setData(false)
})
const neededLayers = options.state.layoutToUse.layers
.filter( layer => !layer.doNotDownload )
.filter(layer => layer.source.geojsonSource === undefined || layer.source.isOsmCacheLayer)
this.allowedTags = new Or(neededLayers.map(l => l.source.osmTags))
}
private async LoadTile(z, x, y): Promise<void> {
@ -85,6 +96,12 @@ export default class OsmFeatureSource {
{
flatProperties: true
});
// The geojson contains _all_ features at the given location
// We only keep what is needed
geojson.features = geojson.features.filter(feature => this.allowedTags.matchesProperties(feature.properties))
console.log("Tile geojson:", z, x, y, "is", geojson)
const index = Tiles.tile_index(z, x, y);
new PerLayerFeatureSourceSplitter(this.filteredLayers,

View file

@ -2,7 +2,7 @@ import {Utils} from "../Utils";
export default class Constants {
public static vNumber = "0.10.1";
public static vNumber = "0.10.2";
public static ImgurApiKey = '7070e7167f0a25a'
public static readonly mapillary_client_token_v3 = 'TXhLaWthQ1d4RUg0czVxaTVoRjFJZzowNDczNjUzNmIyNTQyYzI2'
public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85"

View file

@ -284,6 +284,6 @@
}
],
"overrideAll": {
"allowSplit": true
"allowSplit": false
}
}