forked from MapComplete/MapComplete
Add metadata in changeset with (binned) distance to changed feature
This commit is contained in:
parent
e8ce53d5eb
commit
8e66313ef1
21 changed files with 178 additions and 41 deletions
|
@ -11,6 +11,7 @@ import {Utils} from "../../Utils";
|
|||
import ChangeToElementsActor from "../Actors/ChangeToElementsActor";
|
||||
import PendingChangesUploader from "../Actors/PendingChangesUploader";
|
||||
import TitleHandler from "../Actors/TitleHandler";
|
||||
import FeatureSource from "../FeatureSource/FeatureSource";
|
||||
|
||||
/**
|
||||
* The part of the state keeping track of where the elements, loading them, configuring the feature pipeline etc
|
||||
|
@ -50,7 +51,6 @@ export default class ElementsState extends FeatureSwitchState {
|
|||
super(layoutToUse);
|
||||
|
||||
this.changes = new Changes(layoutToUse?.isLeftRightSensitive() ?? false)
|
||||
|
||||
{
|
||||
// -- Location control initialization
|
||||
const zoom = UIEventSource.asFloat(
|
||||
|
|
|
@ -14,7 +14,7 @@ import {QueryParameters} from "../Web/QueryParameters";
|
|||
import * as personal from "../../assets/themes/personal/personal.json";
|
||||
import FilterConfig from "../../Models/ThemeConfig/FilterConfig";
|
||||
import ShowOverlayLayer from "../../UI/ShowDataLayer/ShowOverlayLayer";
|
||||
import FeatureSource, {FeatureSourceForLayer, Tiled} from "../FeatureSource/FeatureSource";
|
||||
import {FeatureSourceForLayer, Tiled} from "../FeatureSource/FeatureSource";
|
||||
import SimpleFeatureSource from "../FeatureSource/Sources/SimpleFeatureSource";
|
||||
|
||||
/**
|
||||
|
@ -209,7 +209,6 @@ export default class MapState extends UserRelatedState {
|
|||
const feature = JSON.parse(JSON.stringify(location.feature))
|
||||
feature.properties.id = "gps/"+i
|
||||
i++
|
||||
console.log("New location: ", feature)
|
||||
features.data.push({feature, freshness: new Date()})
|
||||
histCoordinates.push(feature.geometry.coordinates)
|
||||
|
||||
|
@ -224,7 +223,7 @@ export default class MapState extends UserRelatedState {
|
|||
|
||||
let gpsLayerDef: FilteredLayer = this.filteredLayers.data.filter(l => l.layerDef.id === "gps_track")[0]
|
||||
this.historicalUserLocations = new SimpleFeatureSource(gpsLayerDef, Tiles.tile_index(0, 0, 0), features);
|
||||
|
||||
this.changes.useLocationHistory(this)
|
||||
}
|
||||
|
||||
private initHomeLocation() {
|
||||
|
|
|
@ -11,6 +11,7 @@ import ElementsState from "./ElementsState";
|
|||
import SelectedElementTagsUpdater from "../Actors/SelectedElementTagsUpdater";
|
||||
import StaticFeatureSource from "../FeatureSource/Sources/StaticFeatureSource";
|
||||
import FeatureSource from "../FeatureSource/FeatureSource";
|
||||
import {Feature} from "@turf/turf";
|
||||
|
||||
/**
|
||||
* The part of the state which keeps track of user-related stuff, e.g. the OSM-connection,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue