-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
78 lines (78 loc) · 2.64 KB
/
index.js
File metadata and controls
78 lines (78 loc) · 2.64 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"use strict";
const tslib_1 = require("tslib");
const decorators_1 = require("esri/core/accessorSupport/decorators");
const Widget = require("esri/widgets/Widget");
const LayerList = require("esri/widgets/LayerList");
const Swipe = require("esri/widgets/Swipe");
const widget_1 = require("esri/widgets/support/widget");
const CSS = {
base: "esri-icon-edit"
};
let SwipeManager = class SwipeManager extends Widget {
constructor(params) {
super();
this._getWidgets = this._getWidgets.bind(this);
this.view = params.view;
this.layermanagerposition = params.layermanagerposition;
this.widgetsclosed = true;
this.trailingLayers = params.trailingLayers;
this.leadingLayers = params.leadingLayers;
this.swipe = new Swipe({
view: this.view
});
this.layerlist = new LayerList({
view: this.view
});
}
render() {
const icon = CSS.base;
let _this = this;
return (widget_1.tsx("div", { class: "esri-widget--button" },
widget_1.tsx("span", { "aria-hidden": "true", onclick: this._getWidgets, class: icon }),
widget_1.tsx("span", { class: "esri-icon-font-fallback-text" }, "Geni\u015Flet")));
}
_getWidgets() {
if (this.widgetsclosed) {
this.view.ui.add(this.layerlist, {
position: this.layermanagerposition
});
this.view.ui.add(this.swipe);
}
else {
if (this.view.ui.find(this.swipe.id)) {
this.view.ui.remove(this.swipe);
}
if (this.view.ui.find(this.layerlist.id)) {
this.view.ui.remove(this.layerlist);
}
}
this.widgetsclosed = !this.widgetsclosed;
}
};
tslib_1.__decorate([
decorators_1.property(),
widget_1.renderable()
], SwipeManager.prototype, "view", void 0);
tslib_1.__decorate([
decorators_1.property()
], SwipeManager.prototype, "layermanagerposition", void 0);
tslib_1.__decorate([
decorators_1.property()
], SwipeManager.prototype, "trailingLayers", void 0);
tslib_1.__decorate([
decorators_1.property()
], SwipeManager.prototype, "leadingLayers", void 0);
tslib_1.__decorate([
decorators_1.property()
], SwipeManager.prototype, "widgetsclosed", void 0);
tslib_1.__decorate([
decorators_1.property()
], SwipeManager.prototype, "layerlist", void 0);
tslib_1.__decorate([
decorators_1.property()
], SwipeManager.prototype, "swipe", void 0);
SwipeManager = tslib_1.__decorate([
decorators_1.subclass("esri.widgets.SwipeManager")
], SwipeManager);
module.exports = SwipeManager;
//# sourceMappingURL=index.js.map