-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathLocations.js
More file actions
37 lines (30 loc) · 956 Bytes
/
Locations.js
File metadata and controls
37 lines (30 loc) · 956 Bytes
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
'use strict';
import {Position} from './Position.js';
class Locations {
constructor() {
this.locations = [];
}
getLocations(callback) {
if (this.locations.length > 0) {
callback(this.locations);
return;
}
$.ajax({
url: "resources/map_labels.json",
dataType: "json",
context: this,
success: function( data ) {
for (var i = 0; i < data.length; i++) {
this.locations.push({
"name": data[i].name,
"position": new Position(data[i].worldX, data[i].worldY, data[i].plane),
"size": data[i].textScale,
"color": data[i].textColor
});
}
callback(this.locations);
}
});
}
}
export default (new Locations);