forked from MapComplete/MapComplete
Pass dependencies explicitly, decrease dependency on legacy State.state
This commit is contained in:
parent
76c84b3972
commit
4f403c4bfc
4 changed files with 20 additions and 17 deletions
|
@ -3,7 +3,6 @@ import {OsmNode, OsmRelation, OsmWay} from "../../Osm/OsmObject";
|
|||
import FeatureSource from "../FeatureSource";
|
||||
import {UIEventSource} from "../../UIEventSource";
|
||||
import {ChangeDescription} from "../../Osm/Actions/ChangeDescription";
|
||||
import State from "../../../State";
|
||||
|
||||
export class NewGeometryFromChangesFeatureSource implements FeatureSource {
|
||||
// This class name truly puts the 'Java' into 'Javascript'
|
||||
|
@ -14,7 +13,7 @@ export class NewGeometryFromChangesFeatureSource implements FeatureSource {
|
|||
public readonly features: UIEventSource<{ feature: any; freshness: Date }[]> = new UIEventSource<{ feature: any; freshness: Date }[]>([]);
|
||||
public readonly name: string = "newFeatures";
|
||||
|
||||
constructor(changes: Changes) {
|
||||
constructor(changes: Changes, backendUrl: string) {
|
||||
|
||||
const seenChanges = new Set<ChangeDescription>();
|
||||
const features = this.features.data;
|
||||
|
@ -55,7 +54,7 @@ export class NewGeometryFromChangesFeatureSource implements FeatureSource {
|
|||
}
|
||||
tags["id"] = change.type + "/" + change.id
|
||||
|
||||
tags["_backend"] = State.state.osmConnection._oauth_config.url
|
||||
tags["_backend"] = backendUrl
|
||||
|
||||
switch (change.type) {
|
||||
case "node":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue