-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
37 lines (32 loc) · 1.19 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var editorName = 'Luke Sidewalker'
var version = '0.0.1'
var useTestServer = false;
var urlOverpass = 'https://overpass-api.de/api/interpreter?data=';
var urlJosm = 'http://127.0.0.1:8111/import?url=';
var urlID = 'https://www.openstreetmap.org/edit?editor=id';
var urlOsm = useTestServer
? 'https://master.apis.dev.openstreetmap.org'
: 'https://www.openstreetmap.org';
var redirectPath = window.location.origin + window.location.pathname;
console.log(redirectPath)
var auth = useTestServer
? osmAuth.osmAuth({
url: urlOsm,
client_id: "luke_sidewalker",
redirect_uri: redirectPath + "land.html",
scope: "read_prefs write_api",
singlepage: false
})
: osmAuth.osmAuth({
url: urlOsm,
client_id: "A5-wd3saMmeWsH__bVeSTP1Qv4AmMz5_BheZ7-7Fk8g",
redirect_uri: redirectPath + "land.html",
scope: "read_prefs write_api",
singlepage: false
});
if (window.location.search.slice(1).split('&').some(function(p) { return p.indexOf('code=') === 0; })) {
auth.authenticate(function() {
history.pushState({}, null, window.location.pathname);
checkOSMAuth();
});
}