-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaps.js
More file actions
34 lines (30 loc) · 739 Bytes
/
maps.js
File metadata and controls
34 lines (30 loc) · 739 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
/* eslint-disable no-unused-vars */
/* eslint-env browser*/
var Map = function (container) {
'use strict';
this.data = {
'started': false,
'loaded': false,
'loader': function () {},
'info': null
};
this.map = null;
this.container = container;
this.setContainer = function (container) {
this.container = container;
};
this.addScript = function (url) {
var script = document.createElement('script');
script.setAttribute('src', url);
script.setAttribute('defer', '');
script.setAttribute('async', '');
document.head.appendChild(script);
};
this.setLoader = function (loadInfo) {
this.data.loader = loadInfo;
if (this.data.started) {
this.data.loader();
this.data.loaded = true;
}
};
};