From 8b533a57f53b2922d795264bab5773c624fb3637 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 22 Sep 2020 00:22:50 +0200 Subject: [PATCH] Attempt to add JOSM-edit-button --- InitUiElements.ts | 22 ++++- assets/josm_logo.svg | 208 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 227 insertions(+), 3 deletions(-) create mode 100644 assets/josm_logo.svg diff --git a/InitUiElements.ts b/InitUiElements.ts index afb7a6a..ef8dd01 100644 --- a/InitUiElements.ts +++ b/InitUiElements.ts @@ -422,10 +422,26 @@ export class InitUiElements { "edit here" + "" } - return new Combine([mapComplete, reportBug, " | ", stats, " | ",editHere]).Render(); + let editWithJosm = "" + if(location !== undefined && + State.state.osmConnection !== undefined && + State.state.bm !== undefined && + State.state.osmConnection.userDetails.data.csCount >= State.userJourney.tagsVisibleAndWikiLinked){ + const latLng = ( State.state.bm as Basemap).map.getBounds(); + const top = Math.max(latLng[0][0], latLng[0][1]); + const bottom = Math.min(latLng[0][0], latLng[0][1]); + const left = Math.min(latLng[1][0], latLng[1][1]); + const right = Math.max(latLng[1][0], latLng[1][1]); - }) - )); + const josmLink = `http://127.0.0.1:8111/load_and_zoom?left=${left}&right=${right}top=${top}&bottom=${bottom}` + editHere = + `edit here` + } + return new Combine([mapComplete, reportBug, " | ", stats, " | ",editHere, editWithJosm]).Render(); + + }, [State.state.osmConnection.userDetails]) + ) + ); State.state.bm = bm; State.state.layerUpdater = new LayerUpdater(State.state); const queryParam = QueryParameters.GetQueryParameter("background", State.state.layoutToUse.data.defaultBackground); diff --git a/assets/josm_logo.svg b/assets/josm_logo.svg new file mode 100644 index 0000000..7e8f5f3 --- /dev/null +++ b/assets/josm_logo.svg @@ -0,0 +1,208 @@ + + + JOSM Logotype 2019 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + JOSM Logotype 2019 + 2019-08-05 + + + Diamond00744 + + + + + Public Domain + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file