forked from Beakerboy/OSMBuilding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapis.js
More file actions
23 lines (23 loc) · 674 Bytes
/
apis.js
File metadata and controls
23 lines (23 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const osmApiUrl = new URLSearchParams(location.search).get('osmApiUrl') || 'https://api.openstreetmap.org/api/0.6';
const apis = {
bounding: {
api: osmApiUrl + '/map?bbox=',
url: (left, bottom, right, top) => {
return apis.bounding.api + left + ',' + bottom + ',' + right + ',' + top;
},
},
getRelation: {
api: osmApiUrl + '/relation/',
parameters: '/full',
url: (relationId) => {
return apis.getRelation.api + relationId + apis.getRelation.parameters;
},
},
getWay: {
api: osmApiUrl + '/way/',
parameters: '/full',
url: (wayId) => {
return apis.getWay.api + wayId + apis.getWay.parameters;
},
},
};