-
Notifications
You must be signed in to change notification settings - Fork 194
Expand file tree
/
Copy pathzoom_features.html
More file actions
263 lines (244 loc) · 8.79 KB
/
Copy pathzoom_features.html
File metadata and controls
263 lines (244 loc) · 8.79 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Map with zoom-in, zoom-out buttons and zoom on mousewheel</title>
<style type="text/css">
body {
color: #5d5d5d;
font-family: Helvetica, Arial, sans-serif;
}
h1 {
font-size: 30px;
margin: auto;
margin-top: 50px;
}
.container {
max-width: 800px;
margin: auto;
}
/* Specific mapael css class are below
* 'mapael' class is added by plugin
*/
.mapael .map {
background-color: #cddee0;
margin-bottom: 10px;
position: relative;
}
/* For all zoom buttons */
.mapael .zoomButton {
background-color: #fff;
border: 1px solid #ccc;
color: #000;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
border-radius: 3px;
cursor: pointer;
position: absolute;
top: 0;
font-weight: bold;
left: 10px;
-webkit-user-select: none;
-khtml-user-select : none;
-moz-user-select: none;
-o-user-select : none;
user-select: none;
}
/* Reset Zoom button first */
.mapael .zoomReset {
top: 10px;
}
/* Then Zoom In button */
.mapael .zoomIn {
top: 30px;
}
/* Then Zoom Out button */
.mapael .zoomOut {
top: 50px;
}
.mapael .mapTooltip {
position: absolute;
background-color: #474c4b;
moz-opacity: 0.70;
opacity: 0.70;
filter: alpha(opacity=70);
border-radius: 10px;
padding: 10px;
z-index: 1000;
max-width: 200px;
display: none;
color: #fff;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"
charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.7/raphael.min.js" charset="utf-8"></script>
<script src="../../js/jquery.mapael.js" charset="utf-8"></script>
<script src="../../js/maps/france_departments.js" charset="utf-8"></script>
<script src="../../js/maps/world_countries.js" charset="utf-8"></script>
<script src="../../js/maps/usa_states.js" charset="utf-8"></script>
<script type="text/javascript">
$(function () {
$(".mapcontainer").mapael({
map: {
name: "france_departments"
// Enable zoom on the map
, zoom: {
enabled: true,
maxLevel: 10,
scalePlots: true
}
// Set default plots and areas style
, defaultPlot: {
attrs: {
fill: "#004a9b"
, opacity: 0.6
}
, attrsHover: {
opacity: 1
}
, text: {
attrs: {
fill: "#505444"
}
, attrsHover: {
fill: "#000"
}
}
}
, defaultArea: {
attrs: {
fill: "#f4f4e8"
, stroke: "#ced8d0"
}
, attrsHover: {
fill: "#a4e100"
}
, text: {
attrs: {
fill: "#505444"
}
, attrsHover: {
fill: "#000"
}
}
}
},
// Customize some areas of the map
areas: {
"department-56": {
text: {content: "Morbihan", attrs: {"font-size": 10}},
tooltip: {content: "Morbihan (56)"}
},
"department-21": {
attrs: {
fill: "#488402"
}
, attrsHover: {
fill: "#a4e100"
}
}
},
// Add some plots on the map
plots: {
// Image plot
'paris': {
type: "image",
url: "http://www.neveldo.fr/mapael/assets/img/marker.png",
width: 12,
height: 40,
latitude: 48.86,
longitude: 2.3444,
attrs: {
opacity: 1,
transform: "s0.75"
},
attrsHover: {
transform: "...s1.5"
}
},
// SVG plot
'Limoge': {
type: "svg",
path: "M 24.267286,27.102843 15.08644,22.838269 6.3686216,27.983579 7.5874348,17.934248 0,11.2331 9.9341158,9.2868473 13.962641,0 l 4.920808,8.8464793 10.077199,0.961561 -6.892889,7.4136777 z",
width: 30,
height: 30,
latitude: 45.8188276,
longitude: 1.1060351,
attrs: {
opacity: 1
}
},
// Circle plot
'lyon': {
type: "circle",
size: 50,
latitude: 45.758888888889,
longitude: 4.8413888888889,
value: 700000,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Lyon"},
text: {content: "Lyon"}
},
// Square plot
'rennes': {
type: "square",
size: 20,
latitude: 48.114166666667,
longitude: -1.6808333333333,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Rennes"},
text: {content: "Rennes"}
},
// Plot positioned by x and y instead of latitude, longitude
'myplot': {
x: 300,
y: 200,
text: {
content: "My plot"
, position: "bottom"
, attrs: {"font-size": 10, fill: "#004a9b", opacity: 0.6}
, attrsHover: {fill: "#004a9b", opacity: 1}
},
},
'Bordeaux': {
type: "circle",
size: 30,
latitude: 44.834763,
longitude: -0.580991,
attrs: {
opacity: 1
},
text: {
content: "33",
position: "inner",
attrs: {
"font-size": 16
, "font-weight": "bold"
, fill: "#fff"
},
attrsHover: {
"font-size": 16
, "font-weight": "bold"
, fill: "#fff"
}
}
}
}
});
});
</script>
</head>
<body>
<div class="container">
<h1>Map with zoom-in, zoom-out buttons and zoom on mousewheel</h1>
<div class="mapcontainer">
<div class="map">
<span>Alternative content for the map</span>
</div>
</div>
<p><b>All example for jQuery Mapael are available <a href="https://www.vincentbroute.fr/mapael/">here</a>.</b></p>
</div>
</body>
</html>