forked from MapComplete/MapComplete
Add mapillary and other nearby images preview
This commit is contained in:
parent
fc0afbcc18
commit
44223d0f1c
12 changed files with 418 additions and 130 deletions
|
@ -122,8 +122,8 @@ export class OsmConnection {
|
|||
return new ChangesetHandler(this._dryRun, this, allElements, changes, this.auth);
|
||||
}
|
||||
|
||||
public GetPreference(key: string, prefix: string = "mapcomplete-"): UIEventSource<string> {
|
||||
return this.preferencesHandler.GetPreference(key, prefix);
|
||||
public GetPreference(key: string, defaultValue: string = undefined, prefix: string = "mapcomplete-"): UIEventSource<string> {
|
||||
return this.preferencesHandler.GetPreference(key, defaultValue, prefix);
|
||||
}
|
||||
|
||||
public GetLongPreference(key: string, prefix: string = "mapcomplete-"): UIEventSource<string> {
|
||||
|
|
|
@ -106,7 +106,7 @@ export class OsmPreferences {
|
|||
return source;
|
||||
}
|
||||
|
||||
public GetPreference(key: string, prefix: string = "mapcomplete-"): UIEventSource<string> {
|
||||
public GetPreference(key: string, defaultValue : string = undefined, prefix: string = "mapcomplete-"): UIEventSource<string> {
|
||||
key = prefix + key;
|
||||
key = key.replace(/[:\\\/"' {}.%]/g, '')
|
||||
if (key.length >= 255) {
|
||||
|
@ -120,7 +120,7 @@ export class OsmPreferences {
|
|||
this.UpdatePreferences();
|
||||
}
|
||||
|
||||
const pref = new UIEventSource<string>(this.preferences.data[key], "osm-preference:" + key);
|
||||
const pref = new UIEventSource<string>(this.preferences.data[key] ?? defaultValue, "osm-preference:" + key);
|
||||
pref.addCallback((v) => {
|
||||
this.UploadPreference(key, v);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue