From 52b8be74cdd2788645682ed3fadd82ea1a09b452 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Tue, 17 Sep 2019 14:02:36 +0100 Subject: [PATCH] Whitespace cleanup --- README.md | 8 +++++--- deriviste.css | 56 +++++++++++++++++++++++++-------------------------- deriviste.js | 56 +++++++++++++++++++++++++-------------------------- index.html | 19 ++++++++++------- 4 files changed, 73 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index dde42e6..3126372 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # Deriviste -Deriviste is a proof-of-concept OpenStreetMap editor for adding POIs directly from street-level imagery (Mapillary). Ok, it's not really an editor as you can't edit anything, only create. +Deriviste is a proof-of-concept OpenStreetMap editor for adding POIs directly from street-level imagery (Mapillary). +Ok, it's not really an editor as you can't edit anything, only create. -Deriviste is written in largely prehistoric JavaScript and is licensed WTFPL with no warranty. Patches are lovely. Please send patches. +Deriviste is written in largely prehistoric JavaScript and is licensed WTFPL with no warranty. +Patches are lovely. Please send patches. You can see it live at https://osm.cycle.travel/deriviste/. -Richard Fairhurst, October 2018 \ No newline at end of file +Richard Fairhurst, October 2018 diff --git a/deriviste.css b/deriviste.css index 46a6650..63c4246 100644 --- a/deriviste.css +++ b/deriviste.css @@ -1,7 +1,7 @@ -html,body { +html, body { font-family: Avenir Next, Avenir, Helvetica, sans-serif; } -#mapillary,#introduction { +#mapillary, #introduction { position: absolute; right: 0; top: 0; @@ -70,8 +70,8 @@ html,body { } #tag { margin-left: auto; - margin-right: auto; - text-align: center; + margin-right: auto; + text-align: center; } #tag_editor input { padding: 0; @@ -83,7 +83,7 @@ html,body { width: 300px; height: 50px; margin: auto; - top: 0; left: 0; bottom: 0; right: 0; + top: 0; left: 0; bottom: 0; right: 0; background-color: #3F3; color: black; font-size: 1.3em; @@ -95,37 +95,37 @@ html,body { /* Autocomplete */ -.aa-input-container { display: inline-block; position: relative; margin-bottom: 10px;} +.aa-input-container { display: inline-block; position: relative; margin-bottom: 10px; } .aa-input-search { - min-width: 200px; - border: 1px solid rgba(228, 228, 228, 0.6); - padding: 12px 28px 12px 12px; - box-sizing: border-box; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; + min-width: 200px; + border: 1px solid rgba(228, 228, 228, 0.6); + padding: 12px 28px 12px 12px; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } .aa-input-search::-webkit-search-decoration, .aa-input-search::-webkit-search-cancel-button, .aa-input-search::-webkit-search-results-button, .aa-input-search::-webkit-search-results-decoration { - display: none; + display: none; } .aa-input-icon { - height: 16px; - width: 16px; - position: absolute; - top: 50%; - right: 16px; - -webkit-transform: translateY(-50%); - transform: translateY(-50%); - fill: #e4e4e4; + height: 16px; + width: 16px; + position: absolute; + top: 50%; + right: 16px; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + fill: #e4e4e4; } .aa-dropdown-menu { - background-color: #fff; - border: 1px solid rgba(228, 228, 228, 0.6); - min-width: 200px; - box-sizing: border-box; - margin-top: -5px; + background-color: #fff; + border: 1px solid rgba(228, 228, 228, 0.6); + min-width: 200px; + box-sizing: border-box; + margin-top: -5px; } .aa-suggestion { padding: 0 12px 0 12px; cursor: pointer; } .aa-suggestion * { margin: 0 !important; } -.aa-suggestion + .aa-suggestion { border-top: 1px solid rgba(228, 228, 228, 0.6); } +.aa-suggestion + .aa-suggestion { border-top: 1px solid rgba(228, 228, 228, 0.6); } .aa-suggestion:hover, .aa-suggestion.aa-cursor { background-color: rgba(0, 241, 241, 0.35); } diff --git a/deriviste.js b/deriviste.js index cf98c33..c488d98 100644 --- a/deriviste.js +++ b/deriviste.js @@ -1,11 +1,11 @@ -var map, mly; // Leaflet and Mapillary objects -var markers = []; // array of all new markers -var mapillaryMarkers = [] // array of all new Mapillary markers -var selectedMarker; // currently selected marker -var currentMarketId = 0; // current Mapillary marker -var presets; // presets.json -var beamIcon,beamMarker,redIcon; // custom icons -var clickTimer, swallowClick; // double-click handling +var map, mly; // Leaflet and Mapillary objects +var markers = []; // array of all new markers +var mapillaryMarkers = [] // array of all new Mapillary markers +var selectedMarker; // currently selected marker +var currentMarketId = 0; // current Mapillary marker +var presets; // presets.json +var beamIcon,beamMarker,redIcon; // custom icons +var clickTimer, swallowClick; // double-click handling // ========================================================================= // Initialise the app @@ -53,7 +53,7 @@ function initialise() { maxzoom: 24 }).addTo(map); // Initialise Leaflet - L.Control.geocoder({ expand: 'click', }).addTo(map); + L.Control.geocoder({ expand: 'click', }).addTo(map); L.control.layers({ "OSM": osm, "Bing aerial": bing, "ESRI Clarity": esri }, { "Mapillary": mapillaryRaster }).addTo(map); map.on('click', clickMap); map.on('dblclick', doubleClickMap); @@ -66,20 +66,20 @@ function initialise() { popupAnchor: [1,-34], tooltipAnchor: [16,-28], shadowSize:[41,41] }); // Initialise Mapillary - mly = new Mapillary.Viewer( - 'mapillary', - 'ZXZyTWZwdkg1WFBIZ2hGVEkySlFiUTpjZWJmMWU3MTViMGMwOTY3', - null, - { - component: { - marker: { - visibleBBoxSize: 100, - }, - mouse: { - doubleClickZoom: false, - }, - }, - } + mly = new Mapillary.Viewer( + 'mapillary', + 'ZXZyTWZwdkg1WFBIZ2hGVEkySlFiUTpjZWJmMWU3MTViMGMwOTY3', + null, + { + component: { + marker: { + visibleBBoxSize: 100, + }, + mouse: { + doubleClickZoom: false, + }, + }, + } ); // activate hover effect var hover = document.createElement("script"); @@ -88,7 +88,7 @@ function initialise() { hover.src = "hover.js"; document.head.appendChild(hover); mly.setRenderMode(Mapillary.RenderMode.Letterbox); - window.addEventListener("resize", function() { mly.resize(); }); + window.addEventListener("resize", function() { mly.resize(); }); mly.on('dblclick', doubleClickMapillary); mly.on('nodechanged', mapillaryMoved); mly.on('bearingchanged', mapillaryRotated); @@ -202,7 +202,7 @@ function createNewMarkerAt(ll) { // User navigated somewhere on the Mapillary viewer function mapillaryMoved(node) { - var loc = node.computedLatLon ? [node.computedLatLon.lat, node.computedLatLon.lon] : [node.latLon.lat, node.latLon.lon]; + var loc = node.computedLatLon ? [node.computedLatLon.lat, node.computedLatLon.lon] : [node.latLon.lat, node.latLon.lon]; if (beamMarker) { beamMarker.setLatLng(loc); } else { @@ -327,7 +327,7 @@ function startUpload() { fetch("https://www.openstreetmap.org/api/0.6/changeset/create", { method: "PUT", - headers: { "Content-Type": "text/xml", + headers: { "Content-Type": "text/xml", "Authorization": "Basic " + window.btoa(unescape(encodeURIComponent(username + ":" + password))) }, body: new XMLSerializer().serializeToString(xml) }).then(response => { @@ -370,13 +370,13 @@ function uploadData(changesetId) { // Upload fetch("https://www.openstreetmap.org/api/0.6/changeset/"+changesetId+"/upload", { method: "POST", - headers: { "Content-Type": "text/xml", + headers: { "Content-Type": "text/xml", "Authorization": "Basic " + window.btoa(unescape(encodeURIComponent(u('#username').first().value + ":" + u('#password').first().value))) }, body: new XMLSerializer().serializeToString(xml) }).then(response => { response.text().then(text => { // we could probably parse the diff result here and keep the markers around - // for editing (with new id/version), but for now, let's just delete them + // for editing (with new id/version), but for now, let's just delete them flash("Nodes uploaded."); console.log(text); deleteAllMarkers(); diff --git a/index.html b/index.html index 94403de..f2388ac 100644 --- a/index.html +++ b/index.html @@ -1,15 +1,15 @@ - + - + - + @@ -43,10 +43,15 @@
- - - - + + + +