-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
47 lines (44 loc) · 1.37 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
import btn_ctrl from './src/modes/btn_ctrl';
import draw_handler from './src/draw_handler';
let MapboxDraw = {};
const ctx = {};
const drawApi = draw_handler(ctx);
MapboxDraw = Object.assign(MapboxDraw, {
init: function (map, options, controlPosition) {
return Object.assign(MapboxDraw, drawApi.init(map, options, controlPosition));
},
setOptions: function (options) {
return Object.assign(MapboxDraw, drawApi.setOptions(options));
},
dispose: function () {
return Object.assign(MapboxDraw, drawApi.dispose());
},
undoOperation: function () {
drawApi.undoOperation();
},
redoOperation: function () {
drawApi.redoOperation();
},
onBtnCtrlActive: function (mode) {
btn_ctrl(this, mode);
},
setFeatures: function (features) {
return drawApi.setFeatures(features);
},
removeFeatures: function (features) {
return drawApi.removeFeatures(features);
},
setSelected: function (feature) {
return drawApi.setSelected(feature);
},
setFeatureProperties: function (feature, props) {
return drawApi.setFeatureProperties(feature, props);
},
getAllHistoryRecords: function () {
return drawApi.getAllHistoryRecords();
},
clearHistoryRecords: function () {
return drawApi.clearHistoryRecords();
}
});
export default MapboxDraw;