forked from MapComplete/MapComplete
Further work on infobox, styling everything, removing clutter
This commit is contained in:
parent
2acd53d150
commit
0b4016b65d
48 changed files with 1283 additions and 454 deletions
|
@ -9,29 +9,26 @@ import {UserDetails} from "./OsmConnection";
|
|||
export class OsmImageUploadHandler {
|
||||
private _tags: UIEventSource<any>;
|
||||
private _changeHandler: Changes;
|
||||
private _userdetails: UserDetails;
|
||||
private _userdetails: UIEventSource<UserDetails>;
|
||||
|
||||
constructor(tags: UIEventSource<any>,
|
||||
userdetails: UserDetails,
|
||||
userdetails: UIEventSource<UserDetails>,
|
||||
changeHandler: Changes
|
||||
) {
|
||||
if (tags === undefined || userdetails === undefined || changeHandler === undefined) {
|
||||
throw "Something is undefined"
|
||||
}
|
||||
console.log(tags, changeHandler, userdetails)
|
||||
this._tags = tags;
|
||||
this._changeHandler = changeHandler;
|
||||
this._userdetails = userdetails;
|
||||
}
|
||||
|
||||
private generateOptions(license: string) {
|
||||
console.log(this)
|
||||
console.log(this._tags, this._changeHandler, this._userdetails)
|
||||
const tags = this._tags.data;
|
||||
|
||||
const title = tags.name ?? "Unknown area";
|
||||
const description = [
|
||||
"author:" + this._userdetails.name,
|
||||
"author:" + this._userdetails.data.name,
|
||||
"license:" + license,
|
||||
"wikidata:" + tags.wikidata,
|
||||
"osmid:" + tags.id,
|
||||
|
@ -60,7 +57,9 @@ export class OsmImageUploadHandler {
|
|||
|
||||
getUI(): ImageUploadFlow {
|
||||
const self = this;
|
||||
return new ImageUploadFlow(function (license) {
|
||||
return new ImageUploadFlow(
|
||||
this._userdetails,
|
||||
function (license) {
|
||||
return self.generateOptions(license)
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue