forked from MauPalantir/mapbox-gl-draw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (27 loc) · 754 Bytes
/
index.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
import runSetup from './src/setup.js';
import setupOptions from './src/options.js';
import setupAPI from './src/api.js';
import modes from './src/modes/index.js';
import * as Constants from './src/constants.js';
import * as lib from './src/lib/index.js';
const setupDraw = function(options, api) {
options = setupOptions(options);
const ctx = {
options
};
api = setupAPI(ctx, api);
ctx.api = api;
const setup = runSetup(ctx);
api.onAdd = setup.onAdd;
api.onRemove = setup.onRemove;
api.types = Constants.types;
api.options = options;
return api;
};
function MapboxDraw(options) {
setupDraw(options, this);
}
MapboxDraw.modes = modes;
MapboxDraw.constants = Constants;
MapboxDraw.lib = lib;
export default MapboxDraw;