forked from cite-sa/es2-service-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gis-toolbar.js
105 lines (104 loc) · 4.11 KB
/
gis-toolbar.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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
$(function () {
$.widget("earthserver.gisToolbar", {
options: {
container: undefined
},
_create: function () {
this.element.attr({id: "gis-toolbar"})
.append(
$("<div>", {
id: "zoom-in-tool",
class: "gis-icon-container",
"data-toggle": "tooltip",
"data-placement": "left",
"data-container": "body",
"title": "Zoom In"
}).append(
$("<img>", {class: "gis-icon", src: "images/icons/zoom_in(h100)w.png"})
)
).append(
$("<div>", {
id: "zoom-out-tool",
class: "gis-icon-container",
"data-toggle": "tooltip",
"data-placement": "left",
"data-container": "body",
"title": "Zoom Out"
}).append(
$("<img>", {class: "gis-icon", src: "images/icons/zoom_out(h100)w.png"})
.click(function () {
console.log("Zooming out");
})
)
).append(
$("<div>", {
id: "fit-to-screen-tool",
class: "gis-icon-container",
"data-toggle": "tooltip",
"data-placement": "left",
"data-container": "body",
"title": "Fit to Screen"
}).append(
$("<img>", {class: "gis-icon", src: "images/icons/fit_to_screen(h100)w.png"})
.click(function () {
console.log("Zooming in");
})
)
).append(
$("<div>", {
id: "select-tool",
class: "gis-icon-container",
"data-toggle": "tooltip",
"data-placement": "left",
"data-container": "body",
"title": "Select"
}).append(
$("<img>", {class: "gis-icon", src: "images/icons/select(h100)w.png"})
.click(function () {
console.log("Zooming in");
})
)
).append(
$("<div>", {
id: "pan-tool",
class: "gis-icon-container",
"data-toggle": "tooltip",
"data-placement": "left",
"data-container": "body",
"title": "Pan"
}).append(
$("<img>", {class: "gis-icon", src: "images/icons/pan(h100)w.png"})
.click(function () {
console.log("Zooming in");
})
)
).appendTo(this.options.container);
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
});
},
addClickHandler: function (selector, callback) {
this.element.find(selector)
.off("click")
.click(function() {
callback()
});
},
addTool: function (icon, title, callback) {
this.element.append(
$("<div>", {
class: "gis-icon-container",
"data-toggle": "tooltip",
"data-placement": "left",
"data-container": "body",
"title": title
}).append(
$("<img>", {class: "gis-icon", src: icon})
.click(function () {
callback();
})
)
);
}
})
});