Skip to content
This repository was archived by the owner on Nov 8, 2025. It is now read-only.

Commit 52b8be7

Browse files
committed
Whitespace cleanup
1 parent 6ecdec0 commit 52b8be7

4 files changed

Lines changed: 73 additions & 66 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Deriviste
22

3-
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.
3+
Deriviste is a proof-of-concept OpenStreetMap editor for adding POIs directly from street-level imagery (Mapillary).
4+
Ok, it's not really an editor as you can't edit anything, only create.
45

5-
Deriviste is written in largely prehistoric JavaScript and is licensed WTFPL with no warranty. Patches are lovely. Please send patches.
6+
Deriviste is written in largely prehistoric JavaScript and is licensed WTFPL with no warranty.
7+
Patches are lovely. Please send patches.
68

79
You can see it live at https://osm.cycle.travel/deriviste/.
810

9-
Richard Fairhurst, October 2018
11+
Richard Fairhurst, October 2018

deriviste.css

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
html,body {
1+
html, body {
22
font-family: Avenir Next, Avenir, Helvetica, sans-serif;
33
}
4-
#mapillary,#introduction {
4+
#mapillary, #introduction {
55
position: absolute;
66
right: 0;
77
top: 0;
@@ -70,8 +70,8 @@ html,body {
7070
}
7171
#tag {
7272
margin-left: auto;
73-
margin-right: auto;
74-
text-align: center;
73+
margin-right: auto;
74+
text-align: center;
7575
}
7676
#tag_editor input {
7777
padding: 0;
@@ -83,7 +83,7 @@ html,body {
8383
width: 300px;
8484
height: 50px;
8585
margin: auto;
86-
top: 0; left: 0; bottom: 0; right: 0;
86+
top: 0; left: 0; bottom: 0; right: 0;
8787
background-color: #3F3;
8888
color: black;
8989
font-size: 1.3em;
@@ -95,37 +95,37 @@ html,body {
9595

9696
/* Autocomplete */
9797

98-
.aa-input-container { display: inline-block; position: relative; margin-bottom: 10px;}
98+
.aa-input-container { display: inline-block; position: relative; margin-bottom: 10px; }
9999
.aa-input-search {
100-
min-width: 200px;
101-
border: 1px solid rgba(228, 228, 228, 0.6);
102-
padding: 12px 28px 12px 12px;
103-
box-sizing: border-box;
104-
-webkit-appearance: none;
105-
-moz-appearance: none;
106-
appearance: none;
100+
min-width: 200px;
101+
border: 1px solid rgba(228, 228, 228, 0.6);
102+
padding: 12px 28px 12px 12px;
103+
box-sizing: border-box;
104+
-webkit-appearance: none;
105+
-moz-appearance: none;
106+
appearance: none;
107107
}
108108
.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 {
109-
display: none;
109+
display: none;
110110
}
111111
.aa-input-icon {
112-
height: 16px;
113-
width: 16px;
114-
position: absolute;
115-
top: 50%;
116-
right: 16px;
117-
-webkit-transform: translateY(-50%);
118-
transform: translateY(-50%);
119-
fill: #e4e4e4;
112+
height: 16px;
113+
width: 16px;
114+
position: absolute;
115+
top: 50%;
116+
right: 16px;
117+
-webkit-transform: translateY(-50%);
118+
transform: translateY(-50%);
119+
fill: #e4e4e4;
120120
}
121121
.aa-dropdown-menu {
122-
background-color: #fff;
123-
border: 1px solid rgba(228, 228, 228, 0.6);
124-
min-width: 200px;
125-
box-sizing: border-box;
126-
margin-top: -5px;
122+
background-color: #fff;
123+
border: 1px solid rgba(228, 228, 228, 0.6);
124+
min-width: 200px;
125+
box-sizing: border-box;
126+
margin-top: -5px;
127127
}
128128
.aa-suggestion { padding: 0 12px 0 12px; cursor: pointer; }
129129
.aa-suggestion * { margin: 0 !important; }
130-
.aa-suggestion + .aa-suggestion { border-top: 1px solid rgba(228, 228, 228, 0.6); }
130+
.aa-suggestion + .aa-suggestion { border-top: 1px solid rgba(228, 228, 228, 0.6); }
131131
.aa-suggestion:hover, .aa-suggestion.aa-cursor { background-color: rgba(0, 241, 241, 0.35); }

deriviste.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
var map, mly; // Leaflet and Mapillary objects
2-
var markers = []; // array of all new markers
3-
var mapillaryMarkers = [] // array of all new Mapillary markers
4-
var selectedMarker; // currently selected marker
5-
var currentMarketId = 0; // current Mapillary marker
6-
var presets; // presets.json
7-
var beamIcon,beamMarker,redIcon; // custom icons
8-
var clickTimer, swallowClick; // double-click handling
1+
var map, mly; // Leaflet and Mapillary objects
2+
var markers = []; // array of all new markers
3+
var mapillaryMarkers = [] // array of all new Mapillary markers
4+
var selectedMarker; // currently selected marker
5+
var currentMarketId = 0; // current Mapillary marker
6+
var presets; // presets.json
7+
var beamIcon,beamMarker,redIcon; // custom icons
8+
var clickTimer, swallowClick; // double-click handling
99

1010
// =========================================================================
1111
// Initialise the app
@@ -53,7 +53,7 @@ function initialise() {
5353
maxzoom: 24 }).addTo(map);
5454

5555
// Initialise Leaflet
56-
L.Control.geocoder({ expand: 'click', }).addTo(map);
56+
L.Control.geocoder({ expand: 'click', }).addTo(map);
5757
L.control.layers({ "OSM": osm, "Bing aerial": bing, "ESRI Clarity": esri }, { "Mapillary": mapillaryRaster }).addTo(map);
5858
map.on('click', clickMap);
5959
map.on('dblclick', doubleClickMap);
@@ -66,20 +66,20 @@ function initialise() {
6666
popupAnchor: [1,-34], tooltipAnchor: [16,-28], shadowSize:[41,41] });
6767

6868
// Initialise Mapillary
69-
mly = new Mapillary.Viewer(
70-
'mapillary',
71-
'ZXZyTWZwdkg1WFBIZ2hGVEkySlFiUTpjZWJmMWU3MTViMGMwOTY3',
72-
null,
73-
{
74-
component: {
75-
marker: {
76-
visibleBBoxSize: 100,
77-
},
78-
mouse: {
79-
doubleClickZoom: false,
80-
},
81-
},
82-
}
69+
mly = new Mapillary.Viewer(
70+
'mapillary',
71+
'ZXZyTWZwdkg1WFBIZ2hGVEkySlFiUTpjZWJmMWU3MTViMGMwOTY3',
72+
null,
73+
{
74+
component: {
75+
marker: {
76+
visibleBBoxSize: 100,
77+
},
78+
mouse: {
79+
doubleClickZoom: false,
80+
},
81+
},
82+
}
8383
);
8484
// activate hover effect
8585
var hover = document.createElement("script");
@@ -88,7 +88,7 @@ function initialise() {
8888
hover.src = "hover.js";
8989
document.head.appendChild(hover);
9090
mly.setRenderMode(Mapillary.RenderMode.Letterbox);
91-
window.addEventListener("resize", function() { mly.resize(); });
91+
window.addEventListener("resize", function() { mly.resize(); });
9292
mly.on('dblclick', doubleClickMapillary);
9393
mly.on('nodechanged', mapillaryMoved);
9494
mly.on('bearingchanged', mapillaryRotated);
@@ -202,7 +202,7 @@ function createNewMarkerAt(ll) {
202202

203203
// User navigated somewhere on the Mapillary viewer
204204
function mapillaryMoved(node) {
205-
var loc = node.computedLatLon ? [node.computedLatLon.lat, node.computedLatLon.lon] : [node.latLon.lat, node.latLon.lon];
205+
var loc = node.computedLatLon ? [node.computedLatLon.lat, node.computedLatLon.lon] : [node.latLon.lat, node.latLon.lon];
206206
if (beamMarker) {
207207
beamMarker.setLatLng(loc);
208208
} else {
@@ -327,7 +327,7 @@ function startUpload() {
327327

328328
fetch("https://www.openstreetmap.org/api/0.6/changeset/create", {
329329
method: "PUT",
330-
headers: { "Content-Type": "text/xml",
330+
headers: { "Content-Type": "text/xml",
331331
"Authorization": "Basic " + window.btoa(unescape(encodeURIComponent(username + ":" + password))) },
332332
body: new XMLSerializer().serializeToString(xml)
333333
}).then(response => {
@@ -370,13 +370,13 @@ function uploadData(changesetId) {
370370
// Upload
371371
fetch("https://www.openstreetmap.org/api/0.6/changeset/"+changesetId+"/upload", {
372372
method: "POST",
373-
headers: { "Content-Type": "text/xml",
373+
headers: { "Content-Type": "text/xml",
374374
"Authorization": "Basic " + window.btoa(unescape(encodeURIComponent(u('#username').first().value + ":" + u('#password').first().value))) },
375375
body: new XMLSerializer().serializeToString(xml)
376376
}).then(response => {
377377
response.text().then(text => {
378378
// we could probably parse the diff result here and keep the markers around
379-
// for editing (with new id/version), but for now, let's just delete them
379+
// for editing (with new id/version), but for now, let's just delete them
380380
flash("Nodes uploaded.");
381381
console.log(text);
382382
deleteAllMarkers();

index.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<html>
22
<head>
3-
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
3+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
44
<link rel="stylesheet" href="deriviste.css" />
55
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" />
6-
<link rel="stylesheet" href="https://unpkg.com/mapillary-js@2.15.0/dist/mapillary.min.css" />
6+
<link rel="stylesheet" href="https://unpkg.com/mapillary-js@2.15.0/dist/mapillary.min.css" />
77
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css" />
88
<script src="umbrella.min.js"></script>
99
<script src="autocomplete.min.js"></script>
1010
<script src="deriviste.js"></script>
1111
<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"></script>
12-
<script src="https://unpkg.com/mapillary-js@2.15.0/dist/mapillary.min.js"></script>
12+
<script src="https://unpkg.com/mapillary-js@2.15.0/dist/mapillary.min.js"></script>
1313
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>
1414
<script src="https://unpkg.com/leaflet.vectorgrid@latest/dist/Leaflet.VectorGrid.bundled.js"></script>
1515
<script src="leaflet.rotatedMarker.js"></script>
@@ -43,10 +43,15 @@
4343
<div id="controls">
4444
<div class='inner'>
4545
<div class="aa-input-container" id="aa-input-container">
46-
<input type="search" id="aa-search-input" class="aa-input-search" placeholder="Search for tags..." name="search" autocomplete="off" />
47-
<svg class="aa-input-icon" viewBox="654 -372 1664 1664">
48-
<path d="M1806,332c0-123.3-43.8-228.8-131.5-316.5C1586.8-72.2,1481.3-116,1358-116s-228.8,43.8-316.5,131.5 C953.8,103.2,910,208.7,910,332s43.8,228.8,131.5,316.5C1129.2,736.2,1234.7,780,1358,780s228.8-43.8,316.5-131.5 C1762.2,560.8,1806,455.3,1806,332z M2318,1164c0,34.7-12.7,64.7-38,90s-55.3,38-90,38c-36,0-66-12.7-90-38l-343-342 c-119.3,82.7-252.3,124-399,124c-95.3,0-186.5-18.5-273.5-55.5s-162-87-225-150s-113-138-150-225S654,427.3,654,332 s18.5-186.5,55.5-273.5s87-162,150-225s138-113,225-150S1262.7-372,1358-372s186.5,18.5,273.5,55.5s162,87,225,150s113,138,150,225 S2062,236.7,2062,332c0,146.7-41.3,279.7-124,399l343,343C2305.7,1098.7,2318,1128.7,2318,1164z" />
49-
</svg>
46+
<input type="search" id="aa-search-input" class="aa-input-search" placeholder="Search for tags..." name="search" autocomplete="off" />
47+
<svg class="aa-input-icon" viewBox="654 -372 1664 1664">
48+
<path d="M1806,332c0-123.3-43.8-228.8-131.5-316.5C1586.8-72.2,1481.3-116,1358-116s-228.8,43.8-316.5,131.5
49+
C953.8,103.2,910,208.7,910,332s43.8,228.8,131.5,316.5C1129.2,736.2,1234.7,780,1358,780s228.8-43.8,316.5-131.5
50+
C1762.2,560.8,1806,455.3,1806,332z M2318,1164c0,34.7-12.7,64.7-38,90s-55.3,38-90,38c-36,0-66-12.7-90-38l-343-342
51+
c-119.3,82.7-252.3,124-399,124c-95.3,0-186.5-18.5-273.5-55.5s-162-87-225-150s-113-138-150-225S654,427.3,654,332
52+
s18.5-186.5,55.5-273.5s87-162,150-225s138-113,225-150S1262.7-372,1358-372s186.5,18.5,273.5,55.5s162,87,225,150s113,138,150,225
53+
S2062,236.7,2062,332c0,146.7-41.3,279.7-124,399l343,343C2305.7,1098.7,2318,1128.7,2318,1164z" />
54+
</svg>
5055
</div>
5156
<button type='button' id='delete' onclick='deleteCurrentMarker()' disabled>Delete selected node</button>
5257
</div>

0 commit comments

Comments
 (0)