My Calendar - Version 2.4.19

Version Description

  • IMPORTANT: SECURITY RELEASE
  • Security fix: XSS vulnerability: user who could create or edit an event could insert a XSS attack.
  • Security fix: Phishing vulnerability: user who could create or edit an event could insert an iFrame for phishing
  • Security fix: Possible to programmatically alter the event being edited to push edits into a different event.
  • Security fix: Possible to programmatically alter the author of the edited event.

Other changes in this release:

  • Screen-reader-text class was duplicated on mini calendar dates
  • New class: 'all-categories' on all categories link
  • New filter: filter All Categories text
  • New filter: filter Map URL & Map Label
  • Bug fix: when sequentially switching from Month to Week to Month & back to Week, Week would revert to first week of month.
  • Bug fix: Maintain current view when switching categories
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 2.4.19
Comparing to
See all releases

Code changes from version 2.4.0 to 2.4.19

Files changed (53) hide show
  1. css/mc-print.css +4 -3
  2. css/mc-styles.css +47 -12
  3. css/reset.css +25 -0
  4. js/gmap3.min.js +8 -1925
  5. js/mc-list.js +7 -5
  6. js/pickadate/themes/default.date.css +2 -2
  7. lang/my-calendar-ca.mo +0 -0
  8. lang/my-calendar-cs_CZ.mo +0 -0
  9. lang/my-calendar-de_DE.mo +0 -0
  10. lang/my-calendar-es_ES.mo +0 -0
  11. lang/my-calendar-fi.mo +0 -0
  12. lang/my-calendar-fr_FR.mo +0 -0
  13. lang/my-calendar-it_IT.mo +0 -0
  14. lang/my-calendar-ja.mo +0 -0
  15. lang/my-calendar-pl_PL.mo +0 -0
  16. lang/my-calendar-pt_BR.mo +0 -0
  17. lang/my-calendar-pt_PT.mo +0 -0
  18. lang/my-calendar-ru_RU.mo +0 -0
  19. lang/my-calendar-sv_SE.mo +0 -0
  20. lang/my-calendar.pot +0 -4046
  21. my-calendar-api.php +52 -9
  22. my-calendar-behaviors.php +3 -2
  23. my-calendar-categories.php +23 -13
  24. my-calendar-core.php +203 -171
  25. my-calendar-event-manager.php +130 -91
  26. my-calendar-events.php +39 -6
  27. my-calendar-generator.php +1 -0
  28. my-calendar-group-manager.php +28 -25
  29. my-calendar-help.php +18 -11
  30. my-calendar-install.php +19 -47
  31. my-calendar-limits.php +23 -1
  32. my-calendar-locations.php +29 -5
  33. my-calendar-output.php +199 -135
  34. my-calendar-settings.php +27 -17
  35. my-calendar-shortcodes.php +3 -2
  36. my-calendar-styles.php +23 -18
  37. my-calendar-templates.php +55 -32
  38. my-calendar-templating.php +6 -6
  39. my-calendar-widgets.php +59 -33
  40. my-calendar.php +30 -46
  41. php-errors.log +0 -0
  42. readme.txt +191 -14
  43. styles/dark.css +8 -3
  44. styles/inherit.css +5 -0
  45. styles/light.css +8 -3
  46. styles/my-calendar.css +8 -3
  47. styles/refresh.css +8 -3
  48. templates/dark.css +8 -3
  49. templates/inherit.css +5 -0
  50. templates/light.css +8 -3
  51. templates/my-calendar.css +8 -3
  52. templates/refresh.css +8 -3
  53. uninstall.php +1 -0
css/mc-print.css CHANGED
@@ -1,6 +1,6 @@
1
/* If copying this stylesheet, place in your theme directory in a /css subdirectory. /wp-content/yourtheme/css/mc-print.css */
2
3
- .my-calendar-header, h3 img, .mc-toggle, .mc_edit_links, #mc-export, .longdesc, .shortdesc, .mc-print, form {
4
display: none;
5
}
6
@@ -77,6 +77,7 @@ a {
77
}
78
79
.return {
80
- width: 910px;
81
- margin: 10px auto;
82
}
1
/* If copying this stylesheet, place in your theme directory in a /css subdirectory. /wp-content/yourtheme/css/mc-print.css */
2
3
+ .my-calendar-header, h3 img, .mc-toggle, .mc_edit_links, #mc-export, .longdesc, .shortdesc, .mc-print, form, .screen-reader-text {
4
display: none;
5
}
6
77
}
78
79
.return {
80
+ font-weight: 700;
81
+ font-size: 1.5em;
82
+ text-align: center;
83
}
css/mc-styles.css CHANGED
@@ -7,7 +7,7 @@
7
background: #fff;
8
}
9
10
- .mcbuy, .mcsbuy {
11
font-size: 1.1em;
12
line-height: 1.5
13
}
@@ -20,9 +20,10 @@
20
21
.mc-button a {
22
padding: 3px 8px;
23
- border: 1px solid;
24
- border-radius: 5px;
25
- background: #fff
26
}
27
28
.mcd {
@@ -58,10 +59,6 @@
58
border: 1px solid #000
59
}
60
61
- .jd-my-calendar .postbox h3 {
62
- cursor: text
63
- }
64
-
65
.active-link {
66
font-weight: 700;
67
text-decoration: underline
@@ -73,6 +70,13 @@ ul.links li {
73
font-size: .9em
74
}
75
76
#toggle {
77
height: 2em
78
}
@@ -82,6 +86,13 @@ ul.links li {
82
margin-right: 5px
83
}
84
85
.jd-my-calendar .spam {
86
background: #ffa
87
}
@@ -202,10 +213,6 @@ ul.links li {
202
width: 100%
203
}
204
205
- .mc-clear {
206
- clear: both
207
- }
208
-
209
.jd-my-calendar pre {
210
background: #fff;
211
padding: 5px;
@@ -311,6 +318,7 @@ strong.label {
311
display: inline;
312
margin: 0 auto;
313
line-height: 1;
314
}
315
316
.mc-tabs .tabs a {
@@ -537,6 +545,11 @@ strong.label {
537
float: right;
538
}
539
540
.sales {
541
background: #e25822;
542
color: #fff;
@@ -580,6 +593,28 @@ tr.problem .error {
580
float: none;
581
}
582
583
@media (max-width: 1140px) {
584
.mc-locations .locations-container input {
585
max-width: 70%;
7
background: #fff;
8
}
9
10
+ .mcbuy {
11
font-size: 1.1em;
12
line-height: 1.5
13
}
20
21
.mc-button a {
22
padding: 3px 8px;
23
+ border: 1px outset;
24
+ border-radius: 7px;
25
+ background: #fff;
26
+ font-weight: 700;
27
}
28
29
.mcd {
59
border: 1px solid #000
60
}
61
62
.active-link {
63
font-weight: 700;
64
text-decoration: underline
70
font-size: .9em
71
}
72
73
+ .jd-my-calendar .metabox-holder .postbox > h2 {
74
+ font-size: 14px;
75
+ padding: 8px 12px;
76
+ margin: 0;
77
+ line-height: 1.4;
78
+ }
79
+
80
#toggle {
81
height: 2em
82
}
86
margin-right: 5px
87
}
88
89
+ span.mc-notice {
90
+ padding: 3px;
91
+ background: #ffc;
92
+ font-weight: 700;
93
+ border: 1px solid #900;
94
+ }
95
+
96
.jd-my-calendar .spam {
97
background: #ffa
98
}
213
width: 100%
214
}
215
216
.jd-my-calendar pre {
217
background: #fff;
218
padding: 5px;
318
display: inline;
319
margin: 0 auto;
320
line-height: 1;
321
+ float: none;
322
}
323
324
.mc-tabs .tabs a {
545
float: right;
546
}
547
548
+ .postbox.sell {
549
+ background: #fff;
550
+ color: #000;
551
+ }
552
+
553
.sales {
554
background: #e25822;
555
color: #fff;
593
float: none;
594
}
595
596
+ .mc-support-me p {
597
+ font-size: 1.6em;
598
+ font-weight: 600;
599
+ background: #007eb3;
600
+ text-shadow: 1px 1px rgb( 35, 60, 127 );
601
+ padding: 1em;
602
+ text-align: center;
603
+ margin: 0 0 1em;
604
+ }
605
+
606
+ .mc-support-me p, .mc-support-me a {
607
+ color: #fff;
608
+ }
609
+
610
+ .mc-support-me a:hover, .mc-support-me a:focus {
611
+ text-decoration: none;
612
+ }
613
+
614
+ .jd-my-calendar .mc-none {
615
+ clear: both;
616
+ }
617
+
618
@media (max-width: 1140px) {
619
.mc-locations .locations-container input {
620
max-width: 70%;
css/reset.css CHANGED
@@ -74,4 +74,29 @@ button.mc-toggle {
74
background-color: transparent;
75
}
76
77
.mcjs .mc-main .details, .mcjs .mc-main .calendar-events { display: none; }
74
background-color: transparent;
75
}
76
77
+ button.mc-text-button {
78
+ border: 0;
79
+ color: inherit;
80
+ background-color: transparent;
81
+ text-decoration: none;
82
+ }
83
+
84
+ button.mc-text-button:hover, button .mc-text-button:focus {
85
+ text-decoration: underline;
86
+ background-color: transparent;
87
+ }
88
+
89
+ /**
90
+ * This is focus passed to a div for the purpose of navigation; visible focus not required.
91
+ */
92
+ .mc-main:focus {
93
+ outline: none;
94
+ }
95
+
96
+ /* Prevent missing background image on google maps */
97
+ .mc-gmap-fupup img {
98
+ max-width: none ! important;
99
+ }
100
+
101
.mcjs .mc-main .details, .mcjs .mc-main .calendar-events { display: none; }
102
+ .mcjs .mc-main .single-event .details, .mcjs .mc-main .list.day .details { display: block; }
js/gmap3.min.js CHANGED
@@ -1,1930 +1,13 @@
1
/*!
2
- * GMAP3 Plugin for JQuery
3
- * Version : 5.1.1
4
- * Date : 2013-05-25
5
- * Licence : GPL v3 : http://www.gnu.org/licenses/gpl.html
6
* Author : DEMONTE Jean-Baptiste
7
* Contact : jbdemonte@gmail.com
8
* Web site : http://gmap3.net
9
*/
10
- (function (y, t) {
11
- var z, i = 0;
12
-
13
- function J() {
14
- if (!z) {
15
- z = {
16
- verbose: false,
17
- queryLimit: {attempt: 5, delay: 250, random: 250},
18
- classes: {
19
- Map: google.maps.Map,
20
- Marker: google.maps.Marker,
21
- InfoWindow: google.maps.InfoWindow,
22
- Circle: google.maps.Circle,
23
- Rectangle: google.maps.Rectangle,
24
- OverlayView: google.maps.OverlayView,
25
- StreetViewPanorama: google.maps.StreetViewPanorama,
26
- KmlLayer: google.maps.KmlLayer,
27
- TrafficLayer: google.maps.TrafficLayer,
28
- BicyclingLayer: google.maps.BicyclingLayer,
29
- GroundOverlay: google.maps.GroundOverlay,
30
- StyledMapType: google.maps.StyledMapType,
31
- ImageMapType: google.maps.ImageMapType
32
- },
33
- map: {mapTypeId: google.maps.MapTypeId.ROADMAP, center: [46.578498, 2.457275], zoom: 2},
34
- overlay: {pane: "floatPane", content: "", offset: {x: 0, y: 0}},
35
- geoloc: {getCurrentPosition: {maximumAge: 60000, timeout: 5000}}
36
- }
37
- }
38
- }
39
-
40
- function k(M, L) {
41
- return M !== t ? M : "gmap3_" + (L ? i + 1 : ++i)
42
- }
43
-
44
- function d(L) {
45
- var O = function (P) {
46
- return parseInt(P, 10)
47
- }, N = google.maps.version.split(".").map(O), M;
48
- L = L.split(".").map(O);
49
- for (M = 0; M < L.length; M++) {
50
- if (N.hasOwnProperty(M)) {
51
- if (N[M] < L[M]) {
52
- return false
53
- }
54
- } else {
55
- return false
56
- }
57
- }
58
- return true
59
- }
60
-
61
- function n(P, L, N, Q, O) {
62
- if (L.todo.events || L.todo.onces) {
63
- var M = {id: Q, data: L.todo.data, tag: L.todo.tag};
64
- if (L.todo.events) {
65
- y.each(L.todo.events, function (R, U) {
66
- var T = P, S = U;
67
- if (y.isArray(U)) {
68
- T = U[0];
69
- S = U[1]
70
- }
71
- google.maps.event.addListener(N, R, function (V) {
72
- S.apply(T, [O ? O : N, V, M])
73
- })
74
- })
75
- }
76
- if (L.todo.onces) {
77
- y.each(L.todo.onces, function (R, U) {
78
- var T = P, S = U;
79
- if (y.isArray(U)) {
80
- T = U[0];
81
- S = U[1]
82
- }
83
- google.maps.event.addListenerOnce(N, R, function (V) {
84
- S.apply(T, [O ? O : N, V, M])
85
- })
86
- })
87
- }
88
- }
89
- }
90
-
91
- function l() {
92
- var L = [];
93
- this.empty = function () {
94
- return !L.length
95
- };
96
- this.add = function (M) {
97
- L.push(M)
98
- };
99
- this.get = function () {
100
- return L.length ? L[0] : false
101
- };
102
- this.ack = function () {
103
- L.shift()
104
- }
105
- }
106
-
107
- function w(T, L, N) {
108
- var R = {}, P = this, Q, S = {
109
- latLng: {
110
- map: false,
111
- marker: false,
112
- infowindow: false,
113
- circle: false,
114
- overlay: false,
115
- getlatlng: false,
116
- getmaxzoom: false,
117
- getelevation: false,
118
- streetviewpanorama: false,
119
- getaddress: true
120
- }, geoloc: {getgeoloc: true}
121
- };
122
- if (typeof N === "string") {
123
- N = M(N)
124
- }
125
- function M(V) {
126
- var U = {};
127
- U[V] = {};
128
- return U
129
- }
130
-
131
- function O() {
132
- var U;
133
- for (U in N) {
134
- if (U in R) {
135
- continue
136
- }
137
- return U
138
- }
139
- }
140
-
141
- this.run = function () {
142
- var U, V;
143
- while (U = O()) {
144
- if (typeof T[U] === "function") {
145
- Q = U;
146
- V = y.extend(true, {}, z[U] || {}, N[U].options || {});
147
- if (U in S.latLng) {
148
- if (N[U].values) {
149
- x(N[U].values, T, T[U], {todo: N[U], opts: V, session: R})
150
- } else {
151
- v(T, T[U], S.latLng[U], {todo: N[U], opts: V, session: R})
152
- }
153
- } else {
154
- if (U in S.geoloc) {
155
- o(T, T[U], {todo: N[U], opts: V, session: R})
156
- } else {
157
- T[U].apply(T, [{todo: N[U], opts: V, session: R}])
158
- }
159
- }
160
- return
161
- } else {
162
- R[U] = null
163
- }
164
- }
165
- L.apply(T, [N, R])
166
- };
167
- this.ack = function (U) {
168
- R[Q] = U;
169
- P.run.apply(P, [])
170
- }
171
- }
172
-
173
- function c(N) {
174
- var L, M = [];
175
- for (L in N) {
176
- M.push(L)
177
- }
178
- return M
179
- }
180
-
181
- function b(N, Q) {
182
- var L = {};
183
- if (N.todo) {
184
- for (var M in N.todo) {
185
- if ((M !== "options") && (M !== "values")) {
186
- L[M] = N.todo[M]
187
- }
188
- }
189
- }
190
- var O, P = ["data", "tag", "id", "events", "onces"];
191
- for (O = 0; O < P.length; O++) {
192
- A(L, P[O], Q, N.todo)
193
- }
194
- L.options = y.extend({}, N.opts || {}, Q.options || {});
195
- return L
196
- }
197
-
198
- function A(N, M) {
199
- for (var L = 2; L < arguments.length; L++) {
200
- if (M in arguments[L]) {
201
- N[M] = arguments[L][M];
202
- return
203
- }
204
- }
205
- }
206
-
207
- function r() {
208
- var L = [];
209
- this.get = function (S) {
210
- if (L.length) {
211
- var P, O, N, R, M, Q = c(S);
212
- for (P = 0; P < L.length; P++) {
213
- R = L[P];
214
- M = Q.length == R.keys.length;
215
- for (O = 0; (O < Q.length) && M; O++) {
216
- N = Q[O];
217
- M = N in R.request;
218
- if (M) {
219
- if ((typeof S[N] === "object") && ("equals" in S[N]) && (typeof S[N] === "function")) {
220
- M = S[N].equals(R.request[N])
221
- } else {
222
- M = S[N] === R.request[N]
223
- }
224
- }
225
- }
226
- if (M) {
227
- return R.results
228
- }
229
- }
230
- }
231
- };
232
- this.store = function (N, M) {
233
- L.push({request: N, keys: c(N), results: M})
234
- }
235
- }
236
-
237
- function e(Q, P, O, L) {
238
- var N = this, M = [];
239
- z.classes.OverlayView.call(this);
240
- this.setMap(Q);
241
- this.onAdd = function () {
242
- var R = this.getPanes();
243
- if (P.pane in R) {
244
- y(R[P.pane]).append(L)
245
- }
246
- y.each("dblclick click mouseover mousemove mouseout mouseup mousedown".split(" "), function (T, S) {
247
- M.push(google.maps.event.addDomListener(L[0], S, function (U) {
248
- y.Event(U).stopPropagation();
249
- google.maps.event.trigger(N, S, [U]);
250
- N.draw()
251
- }))
252
- });
253
- M.push(google.maps.event.addDomListener(L[0], "contextmenu", function (S) {
254
- y.Event(S).stopPropagation();
255
- google.maps.event.trigger(N, "rightclick", [S]);
256
- N.draw()
257
- }))
258
- };
259
- this.getPosition = function () {
260
- return O
261
- };
262
- this.draw = function () {
263
- var R = this.getProjection().fromLatLngToDivPixel(O);
264
- L.css("left", (R.x + P.offset.x) + "px").css("top", (R.y + P.offset.y) + "px")
265
- };
266
- this.onRemove = function () {
267
- for (var R = 0; R < M.length; R++) {
268
- google.maps.event.removeListener(M[R])
269
- }
270
- L.remove()
271
- };
272
- this.hide = function () {
273
- L.hide()
274
- };
275
- this.show = function () {
276
- L.show()
277
- };
278
- this.toggle = function () {
279
- if (L) {
280
- if (L.is(":visible")) {
281
- this.show()
282
- } else {
283
- this.hide()
284
- }
285
- }
286
- };
287
- this.toggleDOM = function () {
288
- if (this.getMap()) {
289
- this.setMap(null)
290
- } else {
291
- this.setMap(Q)
292
- }
293
- };
294
- this.getDOMElement = function () {
295
- return L[0]
296
- }
297
- }
298
-
299
- function f(O, L) {
300
- function M() {
301
- this.onAdd = function () {
302
- };
303
- this.onRemove = function () {
304
- };
305
- this.draw = function () {
306
- };
307
- return z.classes.OverlayView.apply(this, [])
308
- }
309
-
310
- M.prototype = z.classes.OverlayView.prototype;
311
- var N = new M();
312
- N.setMap(O);
313
- return N
314
- }
315
-
316
- function F(ae, ao, aa) {
317
- var an = false, ai = false, af = false, Z = false, W = true, V = this, N = [], T = {}, ad = {}, U = {}, aj = [], ah = [], O = [], ak = f(ao, aa.radius), Y, ap, am, P, Q;
318
- S();
319
- function L(aq) {
320
- if (!aj[aq]) {
321
- delete ah[aq].options.map;
322
- aj[aq] = new z.classes.Marker(ah[aq].options);
323
- n(ae, {todo: ah[aq]}, aj[aq], ah[aq].id)
324
- }
325
- }
326
-
327
- this.getById = function (aq) {
328
- if (aq in ad) {
329
- L(ad[aq]);
330
- return aj[ad[aq]]
331
- }
332
- return false
333
- };
334
- this.rm = function (ar) {
335
- var aq = ad[ar];
336
- if (aj[aq]) {
337
- aj[aq].setMap(null)
338
- }
339
- delete aj[aq];
340
- aj[aq] = false;
341
- delete ah[aq];
342
- ah[aq] = false;
343
- delete O[aq];
344
- O[aq] = false;
345
- delete ad[ar];
346
- delete U[aq];
347
- ai = true
348
- };
349
- this.clearById = function (aq) {
350
- if (aq in ad) {
351
- this.rm(aq);
352
- return true
353
- }
354
- };
355
- this.clear = function (az, av, aA) {
356
- var ar, ay, at, aw, au, ax = [], aq = C(aA);
357
- if (az) {
358
- ar = ah.length - 1;
359
- ay = -1;
360
- at = -1
361
- } else {
362
- ar = 0;
363
- ay = ah.length;
364
- at = 1
365
- }
366
- for (aw = ar; aw != ay; aw += at) {
367
- if (ah[aw]) {
368
- if (!aq || aq(ah[aw].tag)) {
369
- ax.push(U[aw]);
370
- if (av || az) {
371
- break
372
- }
373
- }
374
- }
375
- }
376
- for (au = 0; au < ax.length; au++) {
377
- this.rm(ax[au])
378
- }
379
- };
380
- this.add = function (aq, ar) {
381
- aq.id = k(aq.id);
382
- this.clearById(aq.id);
383
- ad[aq.id] = aj.length;
384
- U[aj.length] = aq.id;
385
- aj.push(null);
386
- ah.push(aq);
387
- O.push(ar);
388
- ai = true
389
- };
390
- this.addMarker = function (ar, aq) {
391
- aq = aq || {};
392
- aq.id = k(aq.id);
393
- this.clearById(aq.id);
394
- if (!aq.options) {
395
- aq.options = {}
396
- }
397
- aq.options.position = ar.getPosition();
398
- n(ae, {todo: aq}, ar, aq.id);
399
- ad[aq.id] = aj.length;
400
- U[aj.length] = aq.id;
401
- aj.push(ar);
402
- ah.push(aq);
403
- O.push(aq.data || {});
404
- ai = true
405
- };
406
- this.todo = function (aq) {
407
- return ah[aq]
408
- };
409
- this.value = function (aq) {
410
- return O[aq]
411
- };
412
- this.marker = function (aq) {
413
- if (aq in aj) {
414
- L(aq);
415
- return aj[aq]
416
- }
417
- return false
418
- };
419
- this.markerIsSet = function (aq) {
420
- return Boolean(aj[aq])
421
- };
422
- this.setMarker = function (ar, aq) {
423
- aj[ar] = aq
424
- };
425
- this.store = function (aq, ar, at) {
426
- T[aq.ref] = {obj: ar, shadow: at}
427
- };
428
- this.free = function () {
429
- for (var aq = 0; aq < N.length; aq++) {
430
- google.maps.event.removeListener(N[aq])
431
- }
432
- N = [];
433
- y.each(T, function (ar) {
434
- ac(ar)
435
- });
436
- T = {};
437
- y.each(ah, function (ar) {
438
- ah[ar] = null
439
- });
440
- ah = [];
441
- y.each(aj, function (ar) {
442
- if (aj[ar]) {
443
- aj[ar].setMap(null);
444
- delete aj[ar]
445
- }
446
- });
447
- aj = [];
448
- y.each(O, function (ar) {
449
- delete O[ar]
450
- });
451
- O = [];
452
- ad = {};
453
- U = {}
454
- };
455
- this.filter = function (aq) {
456
- am = aq;
457
- ag()
458
- };
459
- this.enable = function (aq) {
460
- if (W != aq) {
461
- W = aq;
462
- ag()
463
- }
464
- };
465
- this.display = function (aq) {
466
- P = aq
467
- };
468
- this.error = function (aq) {
469
- Q = aq
470
- };
471
- this.beginUpdate = function () {
472
- an = true
473
- };
474
- this.endUpdate = function () {
475
- an = false;
476
- if (ai) {
477
- ag()
478
- }
479
- };
480
- this.autofit = function (ar) {
481
- for (var aq = 0; aq < ah.length; aq++) {
482
- if (ah[aq]) {
483
- ar.extend(ah[aq].options.position)
484
- }
485
- }
486
- };
487
- function S() {
488
- ap = ak.getProjection();
489
- if (!ap) {
490
- setTimeout(function () {
491
- S.apply(V, [])
492
- }, 25);
493
- return
494
- }
495
- Z = true;
496
- N.push(google.maps.event.addListener(ao, "zoom_changed", function () {
497
- al()
498
- }));
499
- N.push(google.maps.event.addListener(ao, "bounds_changed", function () {
500
- al()
501
- }));
502
- ag()
503
- }
504
-
505
- function ac(aq) {
506
- if (typeof T[aq] === "object") {
507
- if (typeof(T[aq].obj.setMap) === "function") {
508
- T[aq].obj.setMap(null)
509
- }
510
- if (typeof(T[aq].obj.remove) === "function") {
511
- T[aq].obj.remove()
512
- }
513
- if (typeof(T[aq].shadow.remove) === "function") {
514
- T[aq].obj.remove()
515
- }
516
- if (typeof(T[aq].shadow.setMap) === "function") {
517
- T[aq].shadow.setMap(null)
518
- }
519
- delete T[aq].obj;
520
- delete T[aq].shadow
521
- } else {
522
- if (aj[aq]) {
523
- aj[aq].setMap(null)
524
- }
525
- }
526
- delete T[aq]
527
- }
528
-
529
- function M() {
530
- var ay, ax, aw, au, av, at, ar, aq;
531
- if (arguments[0] instanceof google.maps.LatLng) {
532
- ay = arguments[0].lat();
533
- aw = arguments[0].lng();
534
- if (arguments[1] instanceof google.maps.LatLng) {
535
- ax = arguments[1].lat();
536
- au = arguments[1].lng()
537
- } else {
538
- ax = arguments[1];
539
- au = arguments[2]
540
- }
541
- } else {
542
- ay = arguments[0];
543
- aw = arguments[1];
544
- if (arguments[2] instanceof google.maps.LatLng) {
545
- ax = arguments[2].lat();
546
- au = arguments[2].lng()
547
- } else {
548
- ax = arguments[2];
549
- au = arguments[3]
550
- }
551
- }
552
- av = Math.PI * ay / 180;
553
- at = Math.PI * aw / 180;
554
- ar = Math.PI * ax / 180;
555
- aq = Math.PI * au / 180;
556
- return 1000 * 6371 * Math.acos(Math.min(Math.cos(av) * Math.cos(ar) * Math.cos(at) * Math.cos(aq) + Math.cos(av) * Math.sin(at) * Math.cos(ar) * Math.sin(aq) + Math.sin(av) * Math.sin(ar), 1))
557
- }
558
-
559
- function R() {
560
- var aq = M(ao.getCenter(), ao.getBounds().getNorthEast()), ar = new google.maps.Circle({
561
- center: ao.getCenter(),
562
- radius: 1.25 * aq
563
- });
564
- return ar.getBounds()
565
- }
566
-
567
- function X() {
568
- var ar = {}, aq;
569
- for (aq in T) {
570
- ar[aq] = true
571
- }
572
- return ar
573
- }
574
-
575
- function al() {
576
- clearTimeout(Y);
577
- Y = setTimeout(function () {
578
- ag()
579
- }, 25)
580
- }
581
-
582
- function ab(ar) {
583
- var au = ap.fromLatLngToDivPixel(ar), at = ap.fromDivPixelToLatLng(new google.maps.Point(au.x + aa.radius, au.y - aa.radius)), aq = ap.fromDivPixelToLatLng(new google.maps.Point(au.x - aa.radius, au.y + aa.radius));
584
- return new google.maps.LatLngBounds(aq, at)
585
- }
586
-
587
- function ag() {
588
- if (an || af || !Z) {
589
- return
590
- }
591
- var aE = [], aG = {}, aF = ao.getZoom(), aH = ("maxZoom" in aa) && (aF > aa.maxZoom), aw = X(), av, au, at, aA, ar = false, aq, aD, ay, az, aB, aC, ax;
592
- ai = false;
593
- if (aF > 3) {
594
- aq = R();
595
- ar = aq.getSouthWest().lng() < aq.getNorthEast().lng()
596
- }
597
- for (av = 0; av < ah.length; av++) {
598
- if (ah[av] && (!ar || aq.contains(ah[av].options.position)) && (!am || am(O[av]))) {
599
- aE.push(av)
600
- }
601
- }
602
- while (1) {
603
- av = 0;
604
- while (aG[av] && (av < aE.length)) {
605
- av++
606
- }
607
- if (av == aE.length) {
608
- break
609
- }
610
- aA = [];
611
- if (W && !aH) {
612
- ax = 10;
613
- do {
614
- az = aA;
615
- aA = [];
616
- ax--;
617
- if (az.length) {
618
- ay = aq.getCenter()
619
- } else {
620
- ay = ah[aE[av]].options.position
621
- }
622
- aq = ab(ay);
623
- for (au = av; au < aE.length; au++) {
624
- if (aG[au]) {
625
- continue
626
- }
627
- if (aq.contains(ah[aE[au]].options.position)) {
628
- aA.push(au)
629
- }
630
- }
631
- } while ((az.length < aA.length) && (aA.length > 1) && ax)
632
- } else {
633
- for (au = av; au < aE.length; au++) {
634
- if (aG[au]) {
635
- continue
636
- }
637
- aA.push(au);
638
- break
639
- }
640
- }
641
- aD = {indexes: [], ref: []};
642
- aB = aC = 0;
643
- for (at = 0; at < aA.length; at++) {
644
- aG[aA[at]] = true;
645
- aD.indexes.push(aE[aA[at]]);
646
- aD.ref.push(aE[aA[at]]);
647
- aB += ah[aE[aA[at]]].options.position.lat();
648
- aC += ah[aE[aA[at]]].options.position.lng()
649
- }
650
- aB /= aA.length;
651
- aC /= aA.length;
652
- aD.latLng = new google.maps.LatLng(aB, aC);
653
- aD.ref = aD.ref.join("-");
654
- if (aD.ref in aw) {
655
- delete aw[aD.ref]
656
- } else {
657
- if (aA.length === 1) {
658
- T[aD.ref] = true
659
- }
660
- P(aD)
661
- }
662
- }
663
- y.each(aw, function (aI) {
664
- ac(aI)
665
- });
666
- af = false
667
- }
668
- }
669
-
670
- function a(M, L) {
671
- this.id = function () {
672
- return M
673
- };
674
- this.filter = function (N) {
675
- L.filter(N)
676
- };
677
- this.enable = function () {
678
- L.enable(true)
679
- };
680
- this.disable = function () {
681
- L.enable(false)
682
- };
683
- this.add = function (O, N, P) {
684
- if (!P) {
685
- L.beginUpdate()
686
- }
687
- L.addMarker(O, N);
688
- if (!P) {
689
- L.endUpdate()
690
- }
691
- };
692
- this.getById = function (N) {
693
- return L.getById(N)
694
- };
695
- this.clearById = function (P, O) {
696
- var N;
697
- if (!O) {
698
- L.beginUpdate()
699
- }
700
- N = L.clearById(P);
701
- if (!O) {
702
- L.endUpdate()
703
- }
704
- return N
705
- };
706
- this.clear = function (P, Q, N, O) {
707
- if (!O) {
708
- L.beginUpdate()
709
- }
710
- L.clear(P, Q, N);
711
- if (!O) {
712
- L.endUpdate()
713
- }
714
- }
715
- }
716
-
717
- function D() {
718
- var M = {}, N = {};
719
-
720
- function L(P) {
721
- return {id: P.id, name: P.name, object: P.obj, tag: P.tag, data: P.data}
722
- }
723
-
724
- this.add = function (R, Q, T, S) {
725
- var P = R.todo || {}, U = k(P.id);
726
- if (!M[Q]) {
727
- M[Q] = []
728
- }
729
- if (U in N) {
730
- this.clearById(U)
731
- }
732
- N[U] = {obj: T, sub: S, name: Q, id: U, tag: P.tag, data: P.data};
733
- M[Q].push(U);
734
- return U
735
- };
736
- this.getById = function (R, Q, P) {
737
- if (R in N) {
738
- if (Q) {
739
- return N[R].sub
740
- } else {
741
- if (P) {
742
- return L(N[R])
743
- }
744
- }
745
- return N[R].obj
746
- }
747
- return false
748
- };
749
- this.get = function (R, T, P, S) {
750
- var V, U, Q = C(P);
751
- if (!M[R] || !M[R].length) {
752
- return null
753
- }
754
- V = M[R].length;
755
- while (V) {
756
- V--;
757
- U = M[R][T ? V : M[R].length - V - 1];
758
- if (U && N[U]) {
759
- if (Q && !Q(N[U].tag)) {
760
- continue
761
- }
762
- return S ? L(N[U]) : N[U].obj
763
- }
764
- }
765
- return null
766
- };
767
- this.all = function (S, Q, T) {
768
- var P = [], R = C(Q), U = function (X) {
769
- var V, W;
770
- for (V = 0; V < M[X].length; V++) {
771
- W = M[X][V];
772
- if (W && N[W]) {
773
- if (R && !R(N[W].tag)) {
774
- continue
775
- }
776
- P.push(T ? L(N[W]) : N[W].obj)
777
- }
778
- }
779
- };
780
- if (S in M) {
781
- U(S)
782
- } else {
783
- if (S === t) {
784
- for (S in M) {
785
- U(S)
786
- }
787
- }
788
- }
789
- return P
790
- };
791
- function O(P) {
792
- if (typeof(P.setMap) === "function") {
793
- P.setMap(null)
794
- }
795
- if (typeof(P.remove) === "function") {
796
- P.remove()
797
- }
798
- if (typeof(P.free) === "function") {
799
- P.free()
800
- }
801
- P = null
802
- }
803
-
804
- this.rm = function (S, Q, R) {
805
- var P, T;
806
- if (!M[S]) {
807
- return false
808
- }
809
- if (Q) {
810
- if (R) {
811
- for (P = M[S].length - 1; P >= 0; P--) {
812
- T = M[S][P];
813
- if (Q(N[T].tag)) {
814
- break
815
- }
816
- }
817
- } else {
818
- for (P = 0; P < M[S].length; P++) {
819
- T = M[S][P];
820
- if (Q(N[T].tag)) {
821
- break
822
- }
823
- }
824
- }
825
- } else {
826
- P = R ? M[S].length - 1 : 0
827
- }
828
- if (!(P in M[S])) {
829
- return false
830
- }
831
- return this.clearById(M[S][P], P)
832
- };
833
- this.clearById = function (S, P) {
834
- if (S in N) {
835
- var R, Q = N[S].name;
836
- for (R = 0; P === t && R < M[Q].length; R++) {
837
- if (S === M[Q][R]) {
838
- P = R
839
- }
840
- }
841
- O(N[S].obj);
842
- if (N[S].sub) {
843
- O(N[S].sub)
844
- }
845
- delete N[S];
846
- M[Q].splice(P, 1);
847
- return true
848
- }
849
- return false
850
- };
851
- this.objGetById = function (R) {
852
- var Q;
853
- if (M.clusterer) {
854
- for (var P in M.clusterer) {
855
- if ((Q = N[M.clusterer[P]].obj.getById(R)) !== false) {
856
- return Q
857
- }
858
- }
859
- }
860
- return false
861
- };
862
- this.objClearById = function (Q) {
863
- if (M.clusterer) {
864
- for (var P in M.clusterer) {
865
- if (N[M.clusterer[P]].obj.clearById(Q)) {
866
- return true
867
- }
868
- }
869
- }
870
- return null
871
- };
872
- this.clear = function (V, U, W, P) {
873
- var R, T, S, Q = C(P);
874
- if (!V || !V.length) {
875
- V = [];
876
- for (R in M) {
877
- V.push(R)
878
- }
879
- } else {
880
- V = g(V)
881
- }
882
- for (T = 0; T < V.length; T++) {
883
- S = V[T];
884
- if (U) {
885
- this.rm(S, Q, true)
886
- } else {
887
- if (W) {
888
- this.rm(S, Q, false)
889
- } else {
890
- while (this.rm(S, Q, false)) {
891
- }
892
- }
893
- }
894
- }
895
- };
896
- this.objClear = function (S, R, T, Q) {
897
- if (M.clusterer && (y.inArray("marker", S) >= 0 || !S.length)) {
898
- for (var P in M.clusterer) {
899
- N[M.clusterer[P]].obj.clear(R, T, Q)
900
- }
901
- }
902
- }
903
- }
904
-
905
- var m = {}, H = new r();
906
-
907
- function p() {
908
- if (!m.geocoder) {
909
- m.geocoder = new google.maps.Geocoder()
910
- }
911
- return m.geocoder
912
- }
913
-
914
- function G() {
915
- if (!m.directionsService) {
916
- m.directionsService = new google.maps.DirectionsService()
917
- }
918
- return m.directionsService
919
- }
920
-
921
- function h() {
922
- if (!m.elevationService) {
923
- m.elevationService = new google.maps.ElevationService()
924
- }
925
- return m.elevationService
926
- }
927
-
928
- function q() {
929
- if (!m.maxZoomService) {
930
- m.maxZoomService = new google.maps.MaxZoomService()
931
- }
932
- return m.maxZoomService
933
- }
934
-
935
- function B() {
936
- if (!m.distanceMatrixService) {
937
- m.distanceMatrixService = new google.maps.DistanceMatrixService()
938
- }
939
- return m.distanceMatrixService
940
- }
941
-
942
- function u() {
943
- if (z.verbose) {
944
- var L, M = [];
945
- if (window.console && (typeof console.error === "function")) {
946
- for (L = 0; L < arguments.length; L++) {
947
- M.push(arguments[L])
948
- }
949
- console.error.apply(console, M)
950
- } else {
951
- M = "";
952
- for (L = 0; L < arguments.length; L++) {
953
- M += arguments[L].toString() + " "
954
- }
955
- alert(M)
956
- }
957
- }
958
- }
959
-
960
- function E(L) {
961
- return (typeof(L) === "number" || typeof(L) === "string") && L !== "" && !isNaN(L)
962
- }
963
-
964
- function g(N) {
965
- var M, L = [];
966
- if (N !== t) {
967
- if (typeof(N) === "object") {
968
- if (typeof(N.length) === "number") {
969
- L = N
970
- } else {
971
- for (M in N) {
972
- L.push(N[M])
973
- }
974
- }
975
- } else {
976
- L.push(N)
977
- }
978
- }
979
- return L
980
- }
981
-
982
- function C(L) {
983
- if (L) {
984
- if (typeof L === "function") {
985
- return L
986
- }
987
- L = g(L);
988
- return function (N) {
989
- if (N === t) {
990
- return false
991
- }
992
- if (typeof N === "object") {
993
- for (var M = 0; M < N.length; M++) {
994
- if (y.inArray(N[M], L) >= 0) {
995
- return true
996
- }
997
- }
998
- return false
999
- }
1000
- return y.inArray(N, L) >= 0
1001
- }
1002
- }
1003
- }
1004
-
1005
- function I(M, O, L) {
1006
- var N = O ? M : null;
1007
- if (!M || (typeof M === "string")) {
1008
- return N
1009
- }
1010
- if (M.latLng) {
1011
- return I(M.latLng)
1012
- }
1013
- if (M instanceof google.maps.LatLng) {
1014
- return M
1015
- } else {
1016
- if (E(M.lat)) {
1017
- return new google.maps.LatLng(M.lat, M.lng)
1018
- } else {
1019
- if (!L && y.isArray(M)) {
1020
- if (!E(M[0]) || !E(M[1])) {
1021
- return N
1022
- }
1023
- return new google.maps.LatLng(M[0], M[1])
1024
- }
1025
- }
1026
- }
1027
- return N
1028
- }
1029
-
1030
- function j(M) {
1031
- var N, L;
1032
- if (!M || M instanceof google.maps.LatLngBounds) {
1033
- return M || null
1034
- }
1035
- if (y.isArray(M)) {
1036
- if (M.length == 2) {
1037
- N = I(M[0]);
1038
- L = I(M[1])
1039
- } else {
1040
- if (M.length == 4) {
1041
- N = I([M[0], M[1]]);
1042
- L = I([M[2], M[3]])
1043
- }
1044
- }
1045
- } else {
1046
- if (("ne" in M) && ("sw" in M)) {
1047
- N = I(M.ne);
1048
- L = I(M.sw)
1049
- } else {
1050
- if (("n" in M) && ("e" in M) && ("s" in M) && ("w" in M)) {
1051
- N = I([M.n, M.e]);
1052
- L = I([M.s, M.w])
1053
- }
1054
- }
1055
- }
1056
- if (N && L) {
1057
- return new google.maps.LatLngBounds(L, N)
1058
- }
1059
- return null
1060
- }
1061
-
1062
- function v(T, L, O, S, P) {
1063
- var N = O ? I(S.todo, false, true) : false, R = N ? {latLng: N} : (S.todo.address ? (typeof(S.todo.address) === "string" ? {address: S.todo.address} : S.todo.address) : false), M = R ? H.get(R) : false, Q = this;
1064
- if (R) {
1065
- P = P || 0;
1066
- if (M) {
1067
- S.latLng = M.results[0].geometry.location;
1068
- S.results = M.results;
1069
- S.status = M.status;
1070
- L.apply(T, [S])
1071
- } else {
1072
- if (R.location) {
1073
- R.location = I(R.location)
1074
- }
1075
- if (R.bounds) {
1076
- R.bounds = j(R.bounds)
1077
- }
1078
- p().geocode(R, function (V, U) {
1079
- if (U === google.maps.GeocoderStatus.OK) {
1080
- H.store(R, {results: V, status: U});
1081
- S.latLng = V[0].geometry.location;
1082
- S.results = V;
1083
- S.status = U;
1084
- L.apply(T, [S])
1085
- } else {
1086
- if ((U === google.maps.GeocoderStatus.OVER_QUERY_LIMIT) && (P < z.queryLimit.attempt)) {
1087
- setTimeout(function () {
1088
- v.apply(Q, [T, L, O, S, P + 1])
1089
- }, z.queryLimit.delay + Math.floor(Math.random() * z.queryLimit.random))
1090
- } else {
1091
- u("geocode failed", U, R);
1092
- S.latLng = S.results = false;
1093
- S.status = U;
1094
- L.apply(T, [S])
1095
- }
1096
- }
1097
- })
1098
- }
1099
- } else {
1100
- S.latLng = I(S.todo, false, true);
1101
- L.apply(T, [S])
1102
- }
1103
- }
1104
-
1105
- function x(Q, L, R, M) {
1106
- var O = this, N = -1;
1107
-
1108
- function P() {
1109
- do {
1110
- N++
1111
- } while ((N < Q.length) && !("address" in Q[N]));
1112
- if (N >= Q.length) {
1113
- R.apply(L, [M]);
1114
- return
1115
- }
1116
- v(O, function (S) {
1117
- delete S.todo;
1118
- y.extend(Q[N], S);
1119
- P.apply(O, [])
1120
- }, true, {todo: Q[N]})
1121
- }
1122
-
1123
- P()
1124
- }
1125
-
1126
- function o(L, O, M) {
1127
- var N = false;
1128
- if (navigator && navigator.geolocation) {
1129
- navigator.geolocation.getCurrentPosition(function (P) {
1130
- if (N) {
1131
- return
1132
- }
1133
- N = true;
1134
- M.latLng = new google.maps.LatLng(P.coords.latitude, P.coords.longitude);
1135
- O.apply(L, [M])
1136
- }, function () {
1137
- if (N) {
1138
- return
1139
- }
1140
- N = true;
1141
- M.latLng = false;
1142
- O.apply(L, [M])
1143
- }, M.opts.getCurrentPosition)
1144
- } else {
1145
- M.latLng = false;
1146
- O.apply(L, [M])
1147
- }
1148
- }
1149
-
1150
- function K(T) {
1151
- var S = this, U = new l(), V = new D(), N = null, P;
1152
- this._plan = function (Z) {
1153
- for (var Y = 0; Y < Z.length; Y++) {
1154
- U.add(new w(S, R, Z[Y]))
1155
- }
1156
- Q()
1157
- };
1158
- function Q() {
1159
- if (!P && (P = U.get())) {
1160
- P.run()
1161
- }
1162
- }
1163
-
1164
- function R() {
1165
- P = null;
1166
- U.ack();
1167
- Q.call(S)
1168
- }
1169
-
1170
- function X(Y) {
1171
- if (Y.todo.callback) {
1172
- var Z = Array.prototype.slice.call(arguments, 1);
1173
- if (typeof Y.todo.callback === "function") {
1174
- Y.todo.callback.apply(T, Z)
1175
- } else {
1176
- if (y.isArray(Y.todo.callback)) {
1177
- if (typeof Y.todo.callback[1] === "function") {
1178
- Y.todo.callback[1].apply(Y.todo.callback[0], Z)
1179
- }
1180
- }
1181
- }
1182
- }
1183
- }
1184
-
1185
- function O(Y, Z, aa) {
1186
- if (aa) {
1187
- n(T, Y, Z, aa)
1188
- }
1189
- X(Y, Z);
1190
- P.ack(Z)
1191
- }
1192
-
1193
- function L(aa, Y) {
1194
- Y = Y || {};
1195
- if (N) {
1196
- if (Y.todo && Y.todo.options) {
1197
- if (Y.todo.options.center) {
1198
- Y.todo.options.center = I(Y.todo.options.center)
1199
- }
1200
- N.setOptions(Y.todo.options)
1201
- }
1202
- } else {
1203
- var Z = Y.opts || y.extend(true, {}, z.map, Y.todo && Y.todo.options ? Y.todo.options : {});
1204
- Z.center = aa || I(Z.center);
1205
- N = new z.classes.Map(T.get(0), Z)
1206
- }
1207
- }
1208
-
1209
- this.map = function (Y) {
1210
- L(Y.latLng, Y);
1211
- n(T, Y, N);
1212
- O(Y, N)
1213
- };
1214
- this.destroy = function (Y) {
1215
- V.clear();
1216
- T.empty();
1217
- if (N) {
1218
- N = null
1219
- }
1220
- O(Y, true)
1221
- };
1222
- this.infowindow = function (Z) {
1223
- var aa = [], Y = "values" in Z.todo;
1224
- if (!Y) {
1225
- if (Z.latLng) {
1226
- Z.opts.position = Z.latLng
1227
- }
1228
- Z.todo.values = [{options: Z.opts}]
1229
- }
1230
- y.each(Z.todo.values, function (ac, ad) {
1231
- var af, ae, ab = b(Z, ad);
1232
- ab.options.position = ab.options.position ? I(ab.options.position) : I(ad.latLng);
1233
- if (!N) {
1234
- L(ab.options.position)
1235
- }
1236
- ae = new z.classes.InfoWindow(ab.options);
1237
- if (ae && ((ab.open === t) || ab.open)) {
1238
- if (Y) {
1239
- ae.open(N, ab.anchor ? ab.anchor : t)
1240
- } else {
1241
- ae.open(N, ab.anchor ? ab.anchor : (Z.latLng ? t : (Z.session.marker ? Z.session.marker : t)))
1242
- }
1243
- }
1244
- aa.push(ae);
1245
- af = V.add({todo: ab}, "infowindow", ae);
1246
- n(T, {todo: ab}, ae, af)
1247
- });
1248
- O(Z, Y ? aa : aa[0])
1249
- };
1250
- this.circle = function (Z) {
1251
- var aa = [], Y = "values" in Z.todo;
1252
- if (!Y) {
1253
- Z.opts.center = Z.latLng || I(Z.opts.center);
1254
- Z.todo.values = [{options: Z.opts}]
1255
- }
1256
- if (!Z.todo.values.length) {
1257
- O(Z, false);
1258
- return
1259
- }
1260
- y.each(Z.todo.values, function (ac, ad) {
1261
- var af, ae, ab = b(Z, ad);
1262
- ab.options.center = ab.options.center ? I(ab.options.center) : I(ad);
1263
- if (!N) {
1264
- L(ab.options.center)
1265
- }
1266
- ab.options.map = N;
1267
- ae = new z.classes.Circle(ab.options);
1268
- aa.push(ae);
1269
- af = V.add({todo: ab}, "circle", ae);
1270
- n(T, {todo: ab}, ae, af)
1271
- });
1272
- O(Z, Y ? aa : aa[0])
1273
- };
1274
- this.overlay = function (aa, Z) {
1275
- var ab = [], Y = "values" in aa.todo;
1276
- if (!Y) {
1277
- aa.todo.values = [{latLng: aa.latLng, options: aa.opts}]
1278
- }
1279
- if (!aa.todo.values.length) {
1280
- O(aa, false);
1281
- return
1282
- }
1283
- if (!e.__initialised) {
1284
- e.prototype = new z.classes.OverlayView();
1285
- e.__initialised = true
1286
- }
1287
- y.each(aa.todo.values, function (ae, af) {
1288
- var ah, ag, ac = b(aa, af), ad = y(document.createElement("div")).css({
1289
- border: "none",
1290
- borderWidth: "0px",
1291
- position: "absolute"
1292
- });
1293
- ad.append(ac.options.content);
1294
- ag = new e(N, ac.options, I(ac) || I(af), ad);
1295
- ab.push(ag);
1296
- ad = null;
1297
- if (!Z) {
1298
- ah = V.add(aa, "overlay", ag);
1299
- n(T, {todo: ac}, ag, ah)
1300
- }
1301
- });
1302
- if (Z) {
1303
- return ab[0]
1304
- }
1305
- O(aa, Y ? ab : ab[0])
1306
- };
1307
- this.getaddress = function (Y) {
1308
- X(Y, Y.results, Y.status);
1309
- P.ack()
1310
- };
1311
- this.getlatlng = function (Y) {
1312
- X(Y, Y.results, Y.status);
1313
- P.ack()
1314
- };
1315
- this.getmaxzoom = function (Y) {
1316
- q().getMaxZoomAtLatLng(Y.latLng, function (Z) {
1317
- X(Y, Z.status === google.maps.MaxZoomStatus.OK ? Z.zoom : false, status);
1318
- P.ack()
1319
- })
1320
- };
1321
- this.getelevation = function (Z) {
1322
- var aa, Y = [], ab = function (ad, ac) {
1323
- X(Z, ac === google.maps.ElevationStatus.OK ? ad : false, ac);
1324
- P.ack()
1325
- };
1326
- if (Z.latLng) {
1327
- Y.push(Z.latLng)
1328
- } else {
1329
- Y = g(Z.todo.locations || []);
1330
- for (aa = 0; aa < Y.length; aa++) {
1331
- Y[aa] = I(Y[aa])
1332
- }
1333
- }
1334
- if (Y.length) {
1335
- h().getElevationForLocations({locations: Y}, ab)
1336
- } else {
1337
- if (Z.todo.path && Z.todo.path.length) {
1338
- for (aa = 0; aa < Z.todo.path.length; aa++) {
1339
- Y.push(I(Z.todo.path[aa]))
1340
- }
1341
- }
1342
- if (Y.length) {
1343
- h().getElevationAlongPath({path: Y, samples: Z.todo.samples}, ab)
1344
- } else {
1345
- P.ack()
1346
- }
1347
- }
1348
- };
1349
- this.defaults = function (Y) {
1350
- y.each(Y.todo, function (Z, aa) {
1351
- if (typeof z[Z] === "object") {
1352
- z[Z] = y.extend({}, z[Z], aa)
1353
- } else {
1354
- z[Z] = aa
1355
- }
1356
- });
1357
- P.ack(true)
1358
- };
1359
- this.rectangle = function (Z) {
1360
- var aa = [], Y = "values" in Z.todo;
1361
- if (!Y) {
1362
- Z.todo.values = [{options: Z.opts}]
1363
- }
1364
- if (!Z.todo.values.length) {
1365
- O(Z, false);
1366
- return
1367
- }
1368
- y.each(Z.todo.values, function (ac, ad) {
1369
- var af, ae, ab = b(Z, ad);
1370
- ab.options.bounds = ab.options.bounds ? j(ab.options.bounds) : j(ad);
1371
- if (!N) {
1372
- L(ab.options.bounds.getCenter())
1373
- }
1374
- ab.options.map = N;
1375
- ae = new z.classes.Rectangle(ab.options);
1376
- aa.push(ae);
1377
- af = V.add({todo: ab}, "rectangle", ae);
1378
- n(T, {todo: ab}, ae, af)
1379
- });
1380
- O(Z, Y ? aa : aa[0])
1381
- };
1382
- function M(Z, aa, ab) {
1383
- var ac = [], Y = "values" in Z.todo;
1384
- if (!Y) {
1385
- Z.todo.values = [{options: Z.opts}]
1386
- }
1387
- if (!Z.todo.values.length) {
1388
- O(Z, false);
1389
- return
1390
- }
1391
- L();
1392
- y.each(Z.todo.values, function (af, ah) {
1393
- var aj, ag, ae, ai, ad = b(Z, ah);
1394
- if (ad.options[ab]) {
1395
- if (ad.options[ab][0][0] && y.isArray(ad.options[ab][0][0])) {
1396
- for (ag = 0; ag < ad.options[ab].length; ag++) {
1397
- for (ae = 0; ae < ad.options[ab][ag].length; ae++) {
1398
- ad.options[ab][ag][ae] = I(ad.options[ab][ag][ae])
1399
- }
1400
- }
1401
- } else {
1402
- for (ag = 0; ag < ad.options[ab].length; ag++) {
1403
- ad.options[ab][ag] = I(ad.options[ab][ag])
1404
- }
1405
- }
1406
- }
1407
- ad.options.map = N;
1408
- ai = new google.maps[aa](ad.options);
1409
- ac.push(ai);
1410
- aj = V.add({todo: ad}, aa.toLowerCase(), ai);
1411
- n(T, {todo: ad}, ai, aj)
1412
- });
1413
- O(Z, Y ? ac : ac[0])
1414
- }
1415
-
1416
- this.polyline = function (Y) {
1417
- M(Y, "Polyline", "path")
1418
- };
1419
- this.polygon = function (Y) {
1420
- M(Y, "Polygon", "paths")
1421
- };
1422
- this.trafficlayer = function (Y) {
1423
- L();
1424
- var Z = V.get("trafficlayer");
1425
- if (!Z) {
1426
- Z = new z.classes.TrafficLayer();
1427
- Z.setMap(N);
1428
- V.add(Y, "trafficlayer", Z)
1429
- }
1430
- O(Y, Z)
1431
- };
1432
- this.bicyclinglayer = function (Y) {
1433
- L();
1434
- var Z = V.get("bicyclinglayer");
1435
- if (!Z) {
1436
- Z = new z.classes.BicyclingLayer();
1437
- Z.setMap(N);
1438
- V.add(Y, "bicyclinglayer", Z)
1439
- }
1440
- O(Y, Z)
1441
- };
1442
- this.groundoverlay = function (Y) {
1443
- Y.opts.bounds = j(Y.opts.bounds);
1444
- if (Y.opts.bounds) {
1445
- L(Y.opts.bounds.getCenter())
1446
- }
1447
- var aa, Z = new z.classes.GroundOverlay(Y.opts.url, Y.opts.bounds, Y.opts.opts);
1448
- Z.setMap(N);
1449
- aa = V.add(Y, "groundoverlay", Z);
1450
- O(Y, Z, aa)
1451
- };
1452
- this.streetviewpanorama = function (Y) {
1453
- if (!Y.opts.opts) {
1454
- Y.opts.opts = {}
1455
- }
1456
- if (Y.latLng) {
1457
- Y.opts.opts.position = Y.latLng
1458
- } else {
1459
- if (Y.opts.opts.position) {
1460
- Y.opts.opts.position = I(Y.opts.opts.position)
1461
- }
1462
- }
1463
- if (Y.todo.divId) {
1464
- Y.opts.container = document.getElementById(Y.todo.divId)
1465
- } else {
1466
- if (Y.opts.container) {
1467
- Y.opts.container = y(Y.opts.container).get(0)
1468
- }
1469
- }
1470
- var aa, Z = new z.classes.StreetViewPanorama(Y.opts.container, Y.opts.opts);
1471
- if (Z) {
1472
- N.setStreetView(Z)
1473
- }
1474
- aa = V.add(Y, "streetviewpanorama", Z);
1475
- O(Y, Z, aa)
1476
- };
1477
- this.kmllayer = function (Z) {
1478
- var aa = [], Y = "values" in Z.todo;
1479
- if (!Y) {
1480
- Z.todo.values = [{options: Z.opts}]
1481
- }
1482
- if (!Z.todo.values.length) {
1483
- O(Z, false);
1484
- return
1485
- }
1486
- y.each(Z.todo.values, function (ad, ae) {
1487
- var ag, af, ac, ab = b(Z, ae);
1488
- if (!N) {
1489
- L()
1490
- }
1491
- ac = ab.options;
1492
- if (ab.options.opts) {
1493
- ac = ab.options.opts;
1494
- if (ab.options.url) {
1495
- ac.url = ab.options.url
1496
- }
1497
- }
1498
- ac.map = N;
1499
- if (d("3.10")) {
1500
- af = new z.classes.KmlLayer(ac)
1501
- } else {
1502
- af = new z.classes.KmlLayer(ac.url, ac)
1503
- }
1504
- aa.push(af);
1505
- ag = V.add({todo: ab}, "kmllayer", af);
1506
- n(T, {todo: ab}, af, ag)
1507
- });
1508
- O(Z, Y ? aa : aa[0])
1509
- };
1510
- this.panel = function (ab) {
1511
- L();
1512
- var ad, Y = 0, ac = 0, aa, Z = y(document.createElement("div"));
1513
- Z.css({position: "absolute", zIndex: 1000, visibility: "hidden"});
1514
- if (ab.opts.content) {
1515
- aa = y(ab.opts.content);
1516
- Z.append(aa);
1517
- T.first().prepend(Z);
1518
- if (ab.opts.left !== t) {
1519
- Y = ab.opts.left
1520
- } else {
1521
- if (ab.opts.right !== t) {
1522
- Y = T.width() - aa.width() - ab.opts.right
1523
- } else {
1524
- if (ab.opts.center) {
1525
- Y = (T.width() - aa.width()) / 2
1526
- }
1527
- }
1528
- }
1529
- if (ab.opts.top !== t) {
1530
- ac = ab.opts.top
1531
- } else {
1532
- if (ab.opts.bottom !== t) {
1533
- ac = T.height() - aa.height() - ab.opts.bottom
1534
- } else {
1535
- if (ab.opts.middle) {
1536
- ac = (T.height() - aa.height()) / 2
1537
- }
1538
- }
1539
- }
1540
- Z.css({top: ac, left: Y, visibility: "visible"})
1541
- }
1542
- ad = V.add(ab, "panel", Z);
1543
- O(ab, Z, ad);
1544
- Z = null
1545
- };
1546
- function W(aa) {
1547
- var af = new F(T, N, aa), Y = {}, ab = {}, ae = [], ad = /^[0-9]+#x2F;, ac, Z;
1548
- for (Z in aa) {
1549
- if (ad.test(Z)) {
1550
- ae.push(1 * Z);
1551
- ab[Z] = aa[Z];
1552
- ab[Z].width = ab[Z].width || 0;
1553
- ab[Z].height = ab[Z].height || 0
1554
- } else {
1555
- Y[Z] = aa[Z]
1556
- }
1557
- }
1558
- ae.sort(function (ah, ag) {
1559
- return ah > ag
1560
- });
1561
- if (Y.calculator) {
1562
- ac = function (ag) {
1563
- var ah = [];
1564
- y.each(ag, function (aj, ai) {
1565
- ah.push(af.value(ai))
1566
- });
1567
- return Y.calculator.apply(T, [ah])
1568
- }
1569
- } else {
1570
- ac = function (ag) {
1571
- return ag.length
1572
- }
1573
- }
1574
- af.error(function () {
1575
- u.apply(S, arguments)
1576
- });
1577
- af.display(function (ag) {
1578
- var ai, aj, am, ak, al, ah = ac(ag.indexes);
1579
- if (aa.force || ah > 1) {
1580
- for (ai = 0; ai < ae.length; ai++) {
1581
- if (ae[ai] <= ah) {
1582
- aj = ab[ae[ai]]
1583
- }
1584
- }
1585
- }
1586
- if (aj) {
1587
- al = aj.offset || [-aj.width / 2, -aj.height / 2];
1588
- am = y.extend({}, Y);
1589
- am.options = y.extend({
1590
- pane: "overlayLayer",
1591
- content: aj.content ? aj.content.replace("CLUSTER_COUNT", ah) : "",
1592
- offset: {x: ("x" in al ? al.x : al[0]) || 0, y: ("y" in al ? al.y : al[1]) || 0}
1593
- }, Y.options || {});
1594
- ak = S.overlay({todo: am, opts: am.options, latLng: I(ag)}, true);
1595
- am.options.pane = "floatShadow";
1596
- am.options.content = y(document.createElement("div")).width(aj.width + "px").height(aj.height + "px").css({cursor: "pointer"});
1597
- shadow = S.overlay({todo: am, opts: am.options, latLng: I(ag)}, true);
1598
- Y.data = {latLng: I(ag), markers: []};
1599
- y.each(ag.indexes, function (ao, an) {
1600
- Y.data.markers.push(af.value(an));
1601
- if (af.markerIsSet(an)) {
1602
- af.marker(an).setMap(null)
1603
- }
1604
- });
1605
- n(T, {todo: Y}, shadow, t, {main: ak, shadow: shadow});
1606
- af.store(ag, ak, shadow)
1607
- } else {
1608
- y.each(ag.indexes, function (ao, an) {
1609
- af.marker(an).setMap(N)
1610
- })
1611
- }
1612
- });
1613
- return af
1614
- }
1615
-
1616
- this.marker = function (aa) {
1617
- var Y = "values" in aa.todo, ad = !N;
1618
- if (!Y) {
1619
- aa.opts.position = aa.latLng || I(aa.opts.position);
1620
- aa.todo.values = [{options: aa.opts}]
1621
- }
1622
- if (!aa.todo.values.length) {
1623
- O(aa, false);
1624
- return
1625
- }
1626
- if (ad) {
1627
- L()
1628
- }
1629
- if (aa.todo.cluster && !N.getBounds()) {
1630
- google.maps.event.addListenerOnce(N, "bounds_changed", function () {
1631
- S.marker.apply(S, [aa])
1632
- });
1633
- return
1634
- }
1635
- if (aa.todo.cluster) {
1636
- var Z, ab;
1637
- if (aa.todo.cluster instanceof a) {
1638
- Z = aa.todo.cluster;
1639
- ab = V.getById(Z.id(), true)
1640
- } else {
1641
- ab = W(aa.todo.cluster);
1642
- Z = new a(k(aa.todo.id, true), ab);
1643
- V.add(aa, "clusterer", Z, ab)
1644
- }
1645
- ab.beginUpdate();
1646
- y.each(aa.todo.values, function (af, ag) {
1647
- var ae = b(aa, ag);
1648
- ae.options.position = ae.options.position ? I(ae.options.position) : I(ag);
1649
- ae.options.map = N;
1650
- if (ad) {
1651
- N.setCenter(ae.options.position);
1652
- ad = false
1653
- }
1654
- ab.add(ae, ag)
1655
- });
1656
- ab.endUpdate();
1657
- O(aa, Z)
1658
- } else {
1659
- var ac = [];
1660
- y.each(aa.todo.values, function (af, ag) {
1661
- var ai, ah, ae = b(aa, ag);
1662
- ae.options.position = ae.options.position ? I(ae.options.position) : I(ag);
1663
- ae.options.map = N;
1664
- if (ad) {
1665
- N.setCenter(ae.options.position);
1666
- ad = false
1667
- }
1668
- ah = new z.classes.Marker(ae.options);
1669
- ac.push(ah);
1670
- ai = V.add({todo: ae}, "marker", ah);
1671
- n(T, {todo: ae}, ah, ai)
1672
- });
1673
- O(aa, Y ? ac : ac[0])
1674
- }
1675
- };
1676
- this.getroute = function (Y) {
1677
- Y.opts.origin = I(Y.opts.origin, true);
1678
- Y.opts.destination = I(Y.opts.destination, true);
1679
- G().route(Y.opts, function (aa, Z) {
1680
- X(Y, Z == google.maps.DirectionsStatus.OK ? aa : false, Z);
1681
- P.ack()
1682
- })
1683
- };
1684
- this.directionsrenderer = function (Y) {
1685
- Y.opts.map = N;
1686
- var aa, Z = new google.maps.DirectionsRenderer(Y.opts);
1687
- if (Y.todo.divId) {
1688
- Z.setPanel(document.getElementById(Y.todo.divId))
1689
- } else {
1690
- if (Y.todo.container) {
1691
- Z.setPanel(y(Y.todo.container).get(0))
1692
- }
1693
- }
1694
- aa = V.add(Y, "directionsrenderer", Z);
1695
- O(Y, Z, aa)
1696
- };
1697
- this.getgeoloc = function (Y) {
1698
- O(Y, Y.latLng)
1699
- };
1700
- this.styledmaptype = function (Y) {
1701
- L();
1702
- var Z = new z.classes.StyledMapType(Y.todo.styles, Y.opts);
1703
- N.mapTypes.set(Y.todo.id, Z);
1704
- O(Y, Z)
1705
- };
1706
- this.imagemaptype = function (Y) {
1707
- L();
1708
- var Z = new z.classes.ImageMapType(Y.opts);
1709
- N.mapTypes.set(Y.todo.id, Z);
1710
- O(Y, Z)
1711
- };
1712
- this.autofit = function (Y) {
1713
- var Z = new google.maps.LatLngBounds();
1714
- y.each(V.all(), function (aa, ab) {
1715
- if (ab.getPosition) {
1716
- Z.extend(ab.getPosition())
1717
- } else {
1718
- if (ab.getBounds) {
1719
- Z.extend(ab.getBounds().getNorthEast());
1720
- Z.extend(ab.getBounds().getSouthWest())
1721
- } else {
1722
- if (ab.getPaths) {
1723
- ab.getPaths().forEach(function (ac) {
1724
- ac.forEach(function (ad) {
1725
- Z.extend(ad)
1726
- })
1727
- })
1728
- } else {
1729
- if (ab.getPath) {
1730
- ab.getPath().forEach(function (ac) {
1731
- Z.extend(ac);
1732
- ""
1733
- })
1734
- } else {
1735
- if (ab.getCenter) {
1736
- Z.extend(ab.getCenter())
1737
- } else {
1738
- if (ab instanceof a) {
1739
- ab = V.getById(ab.id(), true);
1740
- if (ab) {
1741
- ab.autofit(Z)
1742
- }
1743
- }
1744
- }
1745
- }
1746
- }
1747
- }
1748
- }
1749
- });
1750
- if (!Z.isEmpty() && (!N.getBounds() || !N.getBounds().equals(Z))) {
1751
- if ("maxZoom" in Y.todo) {
1752
- google.maps.event.addListenerOnce(N, "bounds_changed", function () {
1753
- if (this.getZoom() > Y.todo.maxZoom) {
1754
- this.setZoom(Y.todo.maxZoom)
1755
- }
1756
- })
1757
- }
1758
- N.fitBounds(Z)
1759
- }
1760
- O(Y, true)
1761
- };
1762
- this.clear = function (Y) {
1763
- if (typeof Y.todo === "string") {
1764
- if (V.clearById(Y.todo) || V.objClearById(Y.todo)) {
1765
- O(Y, true);
1766
- return
1767
- }
1768
- Y.todo = {name: Y.todo}
1769
- }
1770
- if (Y.todo.id) {
1771
- y.each(g(Y.todo.id), function (Z, aa) {
1772
- V.clearById(aa) || V.objClearById(aa)
1773
- })
1774
- } else {
1775
- V.clear(g(Y.todo.name), Y.todo.last, Y.todo.first, Y.todo.tag);
1776
- V.objClear(g(Y.todo.name), Y.todo.last, Y.todo.first, Y.todo.tag)
1777
- }
1778
- O(Y, true)
1779
- };
1780
- this.exec = function (Y) {
1781
- var Z = this;
1782
- y.each(g(Y.todo.func), function (aa, ab) {
1783
- y.each(Z.get(Y.todo, true, Y.todo.hasOwnProperty("full") ? Y.todo.full : true), function (ac, ad) {
1784
- ab.call(T, ad)
1785
- })
1786
- });
1787
- O(Y, true)
1788
- };
1789
- this.get = function (aa, ad, ac) {
1790
- var Z, ab, Y = ad ? aa : aa.todo;
1791
- if (!ad) {
1792
- ac = Y.full
1793
- }
1794
- if (typeof Y === "string") {
1795
- ab = V.getById(Y, false, ac) || V.objGetById(Y);
1796
- if (ab === false) {
1797
- Z = Y;
1798
- Y = {}
1799
- }
1800
- } else {
1801
- Z = Y.name
1802
- }
1803
- if (Z === "map") {
1804
- ab = N
1805
- }
1806
- if (!ab) {
1807
- ab = [];
1808
- if (Y.id) {
1809
- y.each(g(Y.id), function (ae, af) {
1810
- ab.push(V.getById(af, false, ac) || V.objGetById(af))
1811
- });
1812
- if (!y.isArray(Y.id)) {
1813
- ab = ab[0]
1814
- }
1815
- } else {
1816
- y.each(Z ? g(Z) : [t], function (af, ag) {
1817
- var ae;
1818
- if (Y.first) {
1819
- ae = V.get(ag, false, Y.tag, ac);
1820
- if (ae) {
1821
- ab.push(ae)
1822
- }
1823
- } else {
1824
- if (Y.all) {
1825
- y.each(V.all(ag, Y.tag, ac), function (ai, ah) {
1826
- ab.push(ah)
1827
- })
1828
- } else {
1829
- ae = V.get(ag, true, Y.tag, ac);
1830
- if (ae) {
1831
- ab.push(ae)
1832
- }
1833
- }
1834
- }
1835
- });
1836
- if (!Y.all && !y.isArray(Z)) {
1837
- ab = ab[0]
1838
- }
1839
- }
1840
- }
1841
- ab = y.isArray(ab) || !Y.all ? ab : [ab];
1842
- if (ad) {
1843
- return ab
1844
- } else {
1845
- O(aa, ab)
1846
- }
1847
- };
1848
- this.getdistance = function (Y) {
1849
- var Z;
1850
- Y.opts.origins = g(Y.opts.origins);
1851
- for (Z = 0; Z < Y.opts.origins.length; Z++) {
1852
- Y.opts.origins[Z] = I(Y.opts.origins[Z], true)
1853
- }
1854
- Y.opts.destinations = g(Y.opts.destinations);
1855
- for (Z = 0; Z < Y.opts.destinations.length; Z++) {
1856
- Y.opts.destinations[Z] = I(Y.opts.destinations[Z], true)
1857
- }
1858
- B().getDistanceMatrix(Y.opts, function (ab, aa) {
1859
- X(Y, aa === google.maps.DistanceMatrixStatus.OK ? ab : false, aa);
1860
- P.ack()
1861
- })
1862
- };
1863
- this.trigger = function (Z) {
1864
- if (typeof Z.todo === "string") {
1865
- google.maps.event.trigger(N, Z.todo)
1866
- } else {
1867
- var Y = [N, Z.todo.eventName];
1868
- if (Z.todo.var_args) {
1869
- y.each(Z.todo.var_args, function (ab, aa) {
1870
- Y.push(aa)
1871
- })
1872
- }
1873
- google.maps.event.trigger.apply(google.maps.event, Y)
1874
- }
1875
- X(Z);
1876
- P.ack()
1877
- }
1878
- }
1879
-
1880
- function s(M) {
1881
- var L;
1882
- if (!typeof M === "object" || !M.hasOwnProperty("get")) {
1883
- return false
1884
- }
1885
- for (L in M) {
1886
- if (L !== "get") {
1887
- return false
1888
- }
1889
- }
1890
- return !M.get.hasOwnProperty("callback")
1891
- }
1892
-
1893
- y.fn.gmap3 = function () {
1894
- var M, O = [], N = true, L = [];
1895
- J();
1896
- for (M = 0; M < arguments.length; M++) {
1897
- if (arguments[M]) {
1898
- O.push(arguments[M])
1899
- }
1900
- }
1901
- if (!O.length) {
1902
- O.push("map")
1903
- }
1904
- y.each(this, function () {
1905
- var P = y(this), Q = P.data("gmap3");
1906
- N = false;
1907
- if (!Q) {
1908
- Q = new K(P);
1909
- P.data("gmap3", Q)
1910
- }
1911
- if (O.length === 1 && (O[0] === "get" || s(O[0]))) {
1912
- if (O[0] === "get") {
1913
- L.push(Q.get("map", true))
1914
- } else {
1915
- L.push(Q.get(O[0].get, true, O[0].get.full))
1916
- }
1917
- } else {
1918
- Q._plan(O)
1919
- }
1920
- });
1921
- if (L.length) {
1922
- if (L.length === 1) {
1923
- return L[0]
1924
- } else {
1925
- return L
1926
- }
1927
- }
1928
- return this
1929
- }
1930
- })(jQuery);
1
/*!
2
+ * GMAP3 Plugin for jQuery
3
+ * Version : 6.0.0
4
+ * Date : 2014-04-25
5
* Author : DEMONTE Jean-Baptiste
6
* Contact : jbdemonte@gmail.com
7
* Web site : http://gmap3.net
8
+ * Licence : GPL v3 : http://www.gnu.org/licenses/gpl.html
9
+ *
10
+ * Copyright (c) 2010-2014 Jean-Baptiste DEMONTE
11
+ * All rights reserved.
12
*/
13
+ !function(t,n){function e(t){return"object"==typeof t}function o(t){return"string"==typeof t}function i(t){return"number"==typeof t}function a(t){return t===n}function r(){q=google.maps,A||(A={verbose:!1,queryLimit:{attempt:5,delay:250,random:250},classes:function(){var n={};return t.each("Map Marker InfoWindow Circle Rectangle OverlayView StreetViewPanorama KmlLayer TrafficLayer BicyclingLayer GroundOverlay StyledMapType ImageMapType".split(" "),function(t,e){n[e]=q[e]}),n}(),map:{mapTypeId:q.MapTypeId.ROADMAP,center:[46.578498,2.457275],zoom:2},overlay:{pane:"floatPane",content:"",offset:{x:0,y:0}},geoloc:{getCurrentPosition:{maximumAge:6e4,timeout:5e3}}})}function s(t,n){return a(t)?"gmap3_"+(n?Z+1:++Z):t}function u(t){var n,e=q.version.split(".");for(t=t.split("."),n=0;n<e.length;n++)e[n]=parseInt(e[n],10);for(n=0;n<t.length;n++){if(t[n]=parseInt(t[n],10),!e.hasOwnProperty(n))return!1;if(e[n]<t[n])return!1}return!0}function l(n,e,o,i,a){function r(e,i){e&&t.each(e,function(t,e){var r=n,s=e;R(e)&&(r=e[0],s=e[1]),i(o,t,function(t){s.apply(r,[a||o,t,u])})})}var s=e.td||{},u={id:i,data:s.data,tag:s.tag};r(s.events,q.event.addListener),r(s.onces,q.event.addListenerOnce)}function d(t){var n,e=[];for(n in t)t.hasOwnProperty(n)&&e.push(n);return e}function c(t,n){var e,o=arguments;for(e=2;e<o.length;e++)if(n in o[e]&&o[e].hasOwnProperty(n))return void(t[n]=o[e][n])}function p(n,e){var o,i,a=["data","tag","id","events","onces"],r={};if(n.td)for(o in n.td)n.td.hasOwnProperty(o)&&"options"!==o&&"values"!==o&&(r[o]=n.td[o]);for(i=0;i<a.length;i++)c(r,a[i],e,n.td);return r.options=t.extend({},n.opts||{},e.options||{}),r}function f(){if(A.verbose){var t,n=[];if(window.console&&z(console.error)){for(t=0;t<arguments.length;t++)n.push(arguments[t]);console.error.apply(console,n)}else{for(n="",t=0;t<arguments.length;t++)n+=arguments[t].toString()+" ";alert(n)}}}function g(t){return(i(t)||o(t))&&""!==t&&!isNaN(t)}function h(t){var n,o=[];if(!a(t))if(e(t))if(i(t.length))o=t;else for(n in t)o.push(t[n]);else o.push(t);return o}function v(n){return n?z(n)?n:(n=h(n),function(o){var i;if(a(o))return!1;if(e(o)){for(i=0;i<o.length;i++)if(t.inArray(o[i],n)>=0)return!0;return!1}return t.inArray(o,n)>=0}):void 0}function m(t,n,e){var i=n?t:null;return!t||o(t)?i:t.latLng?m(t.latLng):t instanceof q.LatLng?t:g(t.lat)?new q.LatLng(t.lat,t.lng):!e&&R(t)&&g(t[0])&&g(t[1])?new q.LatLng(t[0],t[1]):i}function y(t){var n,e;return!t||t instanceof q.LatLngBounds?t||null:(R(t)?2===t.length?(n=m(t[0]),e=m(t[1])):4===t.length&&(n=m([t[0],t[1]]),e=m([t[2],t[3]])):"ne"in t&&"sw"in t?(n=m(t.ne),e=m(t.sw)):"n"in t&&"e"in t&&"s"in t&&"w"in t&&(n=m([t.n,t.e]),e=m([t.s,t.w])),n&&e?new q.LatLngBounds(e,n):null)}function w(t,n,e,i,a){var r=e?m(i.td,!1,!0):!1,s=r?{latLng:r}:i.td.address?o(i.td.address)?{address:i.td.address}:i.td.address:!1,u=s?G.get(s):!1,l=this;s?(a=a||0,u?(i.latLng=u.results[0].geometry.location,i.results=u.results,i.status=u.status,n.apply(t,[i])):(s.location&&(s.location=m(s.location)),s.bounds&&(s.bounds=y(s.bounds)),M().geocode(s,function(o,r){r===q.GeocoderStatus.OK?(G.store(s,{results:o,status:r}),i.latLng=o[0].geometry.location,i.results=o,i.status=r,n.apply(t,[i])):r===q.GeocoderStatus.OVER_QUERY_LIMIT&&a<A.queryLimit.attempt?setTimeout(function(){w.apply(l,[t,n,e,i,a+1])},A.queryLimit.delay+Math.floor(Math.random()*A.queryLimit.random)):(f("geocode failed",r,s),i.latLng=i.results=!1,i.status=r,n.apply(t,[i]))}))):(i.latLng=m(i.td,!1,!0),n.apply(t,[i]))}function L(n,e,o,i){function a(){do s++;while(s<n.length&&!("address"in n[s]));return s>=n.length?void o.apply(e,[i]):void w(r,function(e){delete e.td,t.extend(n[s],e),a.apply(r,[])},!0,{td:n[s]})}var r=this,s=-1;a()}function b(t,n,e){var o=!1;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(function(i){o||(o=!0,e.latLng=new q.LatLng(i.coords.latitude,i.coords.longitude),n.apply(t,[e]))},function(){o||(o=!0,e.latLng=!1,n.apply(t,[e]))},e.opts.getCurrentPosition):(e.latLng=!1,n.apply(t,[e]))}function x(t){var n,o=!1;if(e(t)&&t.hasOwnProperty("get")){for(n in t)if("get"!==n)return!1;o=!t.get.hasOwnProperty("callback")}return o}function M(){return V.geocoder||(V.geocoder=new q.Geocoder),V.geocoder}function I(){var t=[];this.get=function(n){if(t.length){var o,i,a,r,s,u=d(n);for(o=0;o<t.length;o++){for(r=t[o],s=u.length===r.keys.length,i=0;i<u.length&&s;i++)a=u[i],s=a in r.request,s&&(s=e(n[a])&&"equals"in n[a]&&z(n[a])?n[a].equals(r.request[a]):n[a]===r.request[a]);if(s)return r.results}}},this.store=function(n,e){t.push({request:n,keys:d(n),results:e})}}function P(){var t=[],n=this;n.empty=function(){return!t.length},n.add=function(n){t.push(n)},n.get=function(){return t.length?t[0]:!1},n.ack=function(){t.shift()}}function k(){function n(t){return{id:t.id,name:t.name,object:t.obj,tag:t.tag,data:t.data}}function e(t){z(t.setMap)&&t.setMap(null),z(t.remove)&&t.remove(),z(t.free)&&t.free(),t=null}var o={},i={},r=this;r.add=function(t,n,e,a){var u=t.td||{},l=s(u.id);return o[n]||(o[n]=[]),l in i&&r.clearById(l),i[l]={obj:e,sub:a,name:n,id:l,tag:u.tag,data:u.data},o[n].push(l),l},r.getById=function(t,e,o){var a=!1;return t in i&&(a=e?i[t].sub:o?n(i[t]):i[t].obj),a},r.get=function(t,e,a,r){var s,u,l=v(a);if(!o[t]||!o[t].length)return null;for(s=o[t].length;s;)if(s--,u=o[t][e?s:o[t].length-s-1],u&&i[u]){if(l&&!l(i[u].tag))continue;return r?n(i[u]):i[u].obj}return null},r.all=function(t,e,r){var s=[],u=v(e),l=function(t){var e,a;for(e=0;e<o[t].length;e++)if(a=o[t][e],a&&i[a]){if(u&&!u(i[a].tag))continue;s.push(r?n(i[a]):i[a].obj)}};if(t in o)l(t);else if(a(t))for(t in o)l(t);return s},r.rm=function(t,n,e){var a,s;if(!o[t])return!1;if(n)if(e)for(a=o[t].length-1;a>=0&&(s=o[t][a],!n(i[s].tag));a--);else for(a=0;a<o[t].length&&(s=o[t][a],!n(i[s].tag));a++);else a=e?o[t].length-1:0;return a in o[t]?r.clearById(o[t][a],a):!1},r.clearById=function(t,n){if(t in i){var r,s=i[t].name;for(r=0;a(n)&&r<o[s].length;r++)t===o[s][r]&&(n=r);return e(i[t].obj),i[t].sub&&e(i[t].sub),delete i[t],o[s].splice(n,1),!0}return!1},r.objGetById=function(t){var n,e;if(o.clusterer)for(e in o.clusterer)if((n=i[o.clusterer[e]].obj.getById(t))!==!1)return n;return!1},r.objClearById=function(t){var n;if(o.clusterer)for(n in o.clusterer)if(i[o.clusterer[n]].obj.clearById(t))return!0;return null},r.clear=function(t,n,e,i){var a,s,u,l=v(i);if(t&&t.length)t=h(t);else{t=[];for(a in o)t.push(a)}for(s=0;s<t.length;s++)if(u=t[s],n)r.rm(u,l,!0);else if(e)r.rm(u,l,!1);else for(;r.rm(u,l,!1););},r.objClear=function(n,e,a,r){var s;if(o.clusterer&&(t.inArray("marker",n)>=0||!n.length))for(s in o.clusterer)i[o.clusterer[s]].obj.clear(e,a,r)}}function B(n,e,i){function a(t){var n={};return n[t]={},n}function r(){var t;for(t in i)if(i.hasOwnProperty(t)&&!u.hasOwnProperty(t))return t}var s,u={},l=this,d={latLng:{map:!1,marker:!1,infowindow:!1,circle:!1,overlay:!1,getlatlng:!1,getmaxzoom:!1,getelevation:!1,streetviewpanorama:!1,getaddress:!0},geoloc:{getgeoloc:!0}};o(i)&&(i=a(i)),l.run=function(){for(var o,a;o=r();){if(z(n[o]))return s=o,a=t.extend(!0,{},A[o]||{},i[o].options||{}),void(o in d.latLng?i[o].values?L(i[o].values,n,n[o],{td:i[o],opts:a,session:u}):w(n,n[o],d.latLng[o],{td:i[o],opts:a,session:u}):o in d.geoloc?b(n,n[o],{td:i[o],opts:a,session:u}):n[o].apply(n,[{td:i[o],opts:a,session:u}]));u[o]=null}e.apply(n,[i,u])},l.ack=function(t){u[s]=t,l.run.apply(l,[])}}function j(){return V.ds||(V.ds=new q.DirectionsService),V.ds}function O(){return V.dms||(V.dms=new q.DistanceMatrixService),V.dms}function C(){return V.mzs||(V.mzs=new q.MaxZoomService),V.mzs}function E(){return V.es||(V.es=new q.ElevationService),V.es}function S(t){function n(){var t=this;return t.onAdd=function(){},t.onRemove=function(){},t.draw=function(){},A.classes.OverlayView.apply(t,[])}n.prototype=A.classes.OverlayView.prototype;var e=new n;return e.setMap(t),e}function T(n,o,i){function a(t){T[t]||(delete _[t].options.map,T[t]=new A.classes.Marker(_[t].options),l(n,{td:_[t]},T[t],_[t].id))}function r(){return(y=U.getProjection())?(P=!0,j.push(q.event.addListener(o,"zoom_changed",f)),j.push(q.event.addListener(o,"bounds_changed",f)),void h()):void setTimeout(function(){r.apply(B,[])},25)}function u(t){e(O[t])?(z(O[t].obj.setMap)&&O[t].obj.setMap(null),z(O[t].obj.remove)&&O[t].obj.remove(),z(O[t].shadow.remove)&&O[t].obj.remove(),z(O[t].shadow.setMap)&&O[t].shadow.setMap(null),delete O[t].obj,delete O[t].shadow):T[t]&&T[t].setMap(null),delete O[t]}function d(){var t,n,e,o,i,a,r,s,u=Math.cos,l=Math.sin,d=arguments;return d[0]instanceof q.LatLng?(t=d[0].lat(),e=d[0].lng(),d[1]instanceof q.LatLng?(n=d[1].lat(),o=d[1].lng()):(n=d[1],o=d[2])):(t=d[0],e=d[1],d[2]instanceof q.LatLng?(n=d[2].lat(),o=d[2].lng()):(n=d[2],o=d[3])),i=Math.PI*t/180,a=Math.PI*e/180,r=Math.PI*n/180,s=Math.PI*o/180,6371e3*Math.acos(Math.min(u(i)*u(r)*u(a)*u(s)+u(i)*l(a)*u(r)*l(s)+l(i)*l(r),1))}function c(){var t=d(o.getCenter(),o.getBounds().getNorthEast()),n=new q.Circle({center:o.getCenter(),radius:1.25*t});return n.getBounds()}function p(){var t,n={};for(t in O)n[t]=!0;return n}function f(){clearTimeout(m),m=setTimeout(h,25)}function g(t){var n=y.fromLatLngToDivPixel(t),e=y.fromDivPixelToLatLng(new q.Point(n.x+i.radius,n.y-i.radius)),o=y.fromDivPixelToLatLng(new q.Point(n.x-i.radius,n.y+i.radius));return new q.LatLngBounds(o,e)}function h(){if(!x&&!I&&P){var n,e,a,r,s,l,d,f,h,v,m,y=!1,b=[],B={},j=o.getZoom(),C="maxZoom"in i&&j>i.maxZoom,E=p();for(M=!1,j>3&&(s=c(),y=s.getSouthWest().lng()<s.getNorthEast().lng()),n=0;n<_.length;n++)!_[n]||y&&!s.contains(_[n].options.position)||w&&!w(D[n])||b.push(n);for(;;){for(n=0;B[n]&&n<b.length;)n++;if(n===b.length)break;if(r=[],k&&!C){m=10;do for(f=r,r=[],m--,d=f.length?s.getCenter():_[b[n]].options.position,s=g(d),e=n;e<b.length;e++)B[e]||s.contains(_[b[e]].options.position)&&r.push(e);while(f.length<r.length&&r.length>1&&m)}else for(e=n;e<b.length;e++)if(!B[e]){r.push(e);break}for(l={indexes:[],ref:[]},h=v=0,a=0;a<r.length;a++)B[r[a]]=!0,l.indexes.push(b[r[a]]),l.ref.push(b[r[a]]),h+=_[b[r[a]]].options.position.lat(),v+=_[b[r[a]]].options.position.lng();h/=r.length,v/=r.length,l.latLng=new q.LatLng(h,v),l.ref=l.ref.join("-"),l.ref in E?delete E[l.ref]:(1===r.length&&(O[l.ref]=!0),L(l))}t.each(E,function(t){u(t)}),I=!1}}var m,y,w,L,b,x=!1,M=!1,I=!1,P=!1,k=!0,B=this,j=[],O={},C={},E={},T=[],_=[],D=[],U=S(o,i.radius);r(),B.getById=function(t){return t in C?(a(C[t]),T[C[t]]):!1},B.rm=function(t){var n=C[t];T[n]&&T[n].setMap(null),delete T[n],T[n]=!1,delete _[n],_[n]=!1,delete D[n],D[n]=!1,delete C[t],delete E[n],M=!0},B.clearById=function(t){return t in C?(B.rm(t),!0):void 0},B.clear=function(t,n,e){var o,i,a,r,s,u=[],l=v(e);for(t?(o=_.length-1,i=-1,a=-1):(o=0,i=_.length,a=1),r=o;r!==i&&(!_[r]||l&&!l(_[r].tag)||(u.push(E[r]),!n&&!t));r+=a);for(s=0;s<u.length;s++)B.rm(u[s])},B.add=function(t,n){t.id=s(t.id),B.clearById(t.id),C[t.id]=T.length,E[T.length]=t.id,T.push(null),_.push(t),D.push(n),M=!0},B.addMarker=function(t,e){e=e||{},e.id=s(e.id),B.clearById(e.id),e.options||(e.options={}),e.options.position=t.getPosition(),l(n,{td:e},t,e.id),C[e.id]=T.length,E[T.length]=e.id,T.push(t),_.push(e),D.push(e.data||{}),M=!0},B.td=function(t){return _[t]},B.value=function(t){return D[t]},B.marker=function(t){return t in T?(a(t),T[t]):!1},B.markerIsSet=function(t){return Boolean(T[t])},B.setMarker=function(t,n){T[t]=n},B.store=function(t,n,e){O[t.ref]={obj:n,shadow:e}},B.free=function(){var n;for(n=0;n<j.length;n++)q.event.removeListener(j[n]);j=[],t.each(O,function(t){u(t)}),O={},t.each(_,function(t){_[t]=null}),_=[],t.each(T,function(t){T[t]&&(T[t].setMap(null),delete T[t])}),T=[],t.each(D,function(t){delete D[t]}),D=[],C={},E={}},B.filter=function(t){w=t,h()},B.enable=function(t){k!==t&&(k=t,h())},B.display=function(t){L=t},B.error=function(t){b=t},B.beginUpdate=function(){x=!0},B.endUpdate=function(){x=!1,M&&h()},B.autofit=function(t){var n;for(n=0;n<_.length;n++)_[n]&&t.extend(_[n].options.position)}}function _(t,n){var e=this;e.id=function(){return t},e.filter=function(t){n.filter(t)},e.enable=function(){n.enable(!0)},e.disable=function(){n.enable(!1)},e.add=function(t,e,o){o||n.beginUpdate(),n.addMarker(t,e),o||n.endUpdate()},e.getById=function(t){return n.getById(t)},e.clearById=function(t,e){var o;return e||n.beginUpdate(),o=n.clearById(t),e||n.endUpdate(),o},e.clear=function(t,e,o,i){i||n.beginUpdate(),n.clear(t,e,o),i||n.endUpdate()}}function D(n,e,o,i){var a=this,r=[];A.classes.OverlayView.call(a),a.setMap(n),a.onAdd=function(){var n=a.getPanes();e.pane in n&&t(n[e.pane]).append(i),t.each("dblclick click mouseover mousemove mouseout mouseup mousedown".split(" "),function(n,e){r.push(q.event.addDomListener(i[0],e,function(n){t.Event(n).stopPropagation(),q.event.trigger(a,e,[n]),a.draw()}))}),r.push(q.event.addDomListener(i[0],"contextmenu",function(n){t.Event(n).stopPropagation(),q.event.trigger(a,"rightclick",[n]),a.draw()}))},a.getPosition=function(){return o},a.setPosition=function(t){o=t,a.draw()},a.draw=function(){var t=a.getProjection().fromLatLngToDivPixel(o);i.css("left",t.x+e.offset.x+"px").css("top",t.y+e.offset.y+"px")},a.onRemove=function(){var t;for(t=0;t<r.length;t++)q.event.removeListener(r[t]);i.remove()},a.hide=function(){i.hide()},a.show=function(){i.show()},a.toggle=function(){i&&(i.is(":visible")?a.show():a.hide())},a.toggleDOM=function(){a.setMap(a.getMap()?null:n)},a.getDOMElement=function(){return i[0]}}function U(i){function r(){!b&&(b=M.get())&&b.run()}function d(){b=null,M.ack(),r.call(x)}function c(t){var n,e=t.td.callback;e&&(n=Array.prototype.slice.call(arguments,1),z(e)?e.apply(i,n):R(e)&&z(e[1])&&e[1].apply(e[0],n))}function g(t,n,e){e&&l(i,t,n,e),c(t,n),b.ack(n)}function v(n,e){e=e||{};var o=e.td&&e.td.options?e.td.options:0;S?o&&(o.center&&(o.center=m(o.center)),S.setOptions(o)):(o=e.opts||t.extend(!0,{},A.map,o||{}),o.center=n||m(o.center),S=new A.classes.Map(i.get(0),o))}function w(e){var o,a,r=new T(i,S,e),s={},u={},d=[],c=/^[0-9]+#x2F;;for(a in e)c.test(a)?(d.push(1*a),u[a]=e[a],u[a].width=u[a].width||0,u[a].height=u[a].height||0):s[a]=e[a];return d.sort(function(t,n){return t>n}),o=s.calculator?function(n){var e=[];return t.each(n,function(t,n){e.push(r.value(n))}),s.calculator.apply(i,[e])}:function(t){return t.length},r.error(function(){f.apply(x,arguments)}),r.display(function(a){var c,p,f,g,h,v,y=o(a.indexes);if(e.force||y>1)for(c=0;c<d.length;c++)d[c]<=y&&(p=u[d[c]]);p?(h=p.offset||[-p.width/2,-p.height/2],f=t.extend({},s),f.options=t.extend({pane:"overlayLayer",content:p.content?p.content.replace("CLUSTER_COUNT",y):"",offset:{x:("x"in h?h.x:h[0])||0,y:("y"in h?h.y:h[1])||0}},s.options||{}),g=x.overlay({td:f,opts:f.options,latLng:m(a)},!0),f.options.pane="floatShadow",f.options.content=t(document.createElement("div")).width(p.width+"px").height(p.height+"px").css({cursor:"pointer"}),v=x.overlay({td:f,opts:f.options,latLng:m(a)},!0),s.data={latLng:m(a),markers:[]},t.each(a.indexes,function(t,n){s.data.markers.push(r.value(n)),r.markerIsSet(n)&&r.marker(n).setMap(null)}),l(i,{td:s},v,n,{main:g,shadow:v}),r.store(a,g,v)):t.each(a.indexes,function(t,n){r.marker(n).setMap(S)})}),r}function L(n,e,o){var a=[],r="values"in n.td;return r||(n.td.values=[{options:n.opts}]),n.td.values.length?(v(),t.each(n.td.values,function(t,r){var s,u,d,c,f=p(n,r);if(f.options[o])if(f.options[o][0][0]&&R(f.options[o][0][0]))for(u=0;u<f.options[o].length;u++)for(d=0;d<f.options[o][u].length;d++)f.options[o][u][d]=m(f.options[o][u][d]);else for(u=0;u<f.options[o].length;u++)f.options[o][u]=m(f.options[o][u]);f.options.map=S,c=new q[e](f.options),a.push(c),s=I.add({td:f},e.toLowerCase(),c),l(i,{td:f},c,s)}),void g(n,r?a:a[0])):void g(n,!1)}var b,x=this,M=new P,I=new k,S=null;x._plan=function(t){var n;for(n=0;n<t.length;n++)M.add(new B(x,d,t[n]));r()},x.map=function(t){v(t.latLng,t),l(i,t,S),g(t,S)},x.destroy=function(t){I.clear(),i.empty(),S&&(S=null),g(t,!0)},x.overlay=function(n,e){var o=[],a="values"in n.td;return a||(n.td.values=[{latLng:n.latLng,options:n.opts}]),n.td.values.length?(D.__initialised||(D.prototype=new A.classes.OverlayView,D.__initialised=!0),t.each(n.td.values,function(a,r){var s,u,d=p(n,r),c=t(document.createElement("div")).css({border:"none",borderWidth:0,position:"absolute"});c.append(d.options.content),u=new D(S,d.options,m(d)||m(r),c),o.push(u),c=null,e||(s=I.add(n,"overlay",u),l(i,{td:d},u,s))}),e?o[0]:void g(n,a?o:o[0])):void g(n,!1)},x.marker=function(n){var e,o,a,r="values"in n.td,u=!S;return r||(n.opts.position=n.latLng||m(n.opts.position),n.td.values=[{options:n.opts}]),n.td.values.length?(u&&v(),n.td.cluster&&!S.getBounds()?void q.event.addListenerOnce(S,"bounds_changed",function(){x.marker.apply(x,[n])}):void(n.td.cluster?(n.td.cluster instanceof _?(o=n.td.cluster,a=I.getById(o.id(),!0)):(a=w(n.td.cluster),o=new _(s(n.td.id,!0),a),I.add(n,"clusterer",o,a)),a.beginUpdate(),t.each(n.td.values,function(t,e){var o=p(n,e);o.options.position=m(o.options.position?o.options.position:e),o.options.position&&(o.options.map=S,u&&(S.setCenter(o.options.position),u=!1),a.add(o,e))}),a.endUpdate(),g(n,o)):(e=[],t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.position=m(s.options.position?s.options.position:o),s.options.position&&(s.options.map=S,u&&(S.setCenter(s.options.position),u=!1),r=new A.classes.Marker(s.options),e.push(r),a=I.add({td:s},"marker",r),l(i,{td:s},r,a))}),g(n,r?e:e[0])))):void g(n,!1)},x.getroute=function(t){t.opts.origin=m(t.opts.origin,!0),t.opts.destination=m(t.opts.destination,!0),j().route(t.opts,function(n,e){c(t,e===q.DirectionsStatus.OK?n:!1,e),b.ack()})},x.getdistance=function(t){var n;for(t.opts.origins=h(t.opts.origins),n=0;n<t.opts.origins.length;n++)t.opts.origins[n]=m(t.opts.origins[n],!0);for(t.opts.destinations=h(t.opts.destinations),n=0;n<t.opts.destinations.length;n++)t.opts.destinations[n]=m(t.opts.destinations[n],!0);O().getDistanceMatrix(t.opts,function(n,e){c(t,e===q.DistanceMatrixStatus.OK?n:!1,e),b.ack()})},x.infowindow=function(e){var o=[],r="values"in e.td;r||(e.latLng&&(e.opts.position=e.latLng),e.td.values=[{options:e.opts}]),t.each(e.td.values,function(t,s){var u,d,c=p(e,s);c.options.position=m(c.options.position?c.options.position:s.latLng),S||v(c.options.position),d=new A.classes.InfoWindow(c.options),d&&(a(c.open)||c.open)&&(r?d.open(S,c.anchor||n):d.open(S,c.anchor||(e.latLng?n:e.session.marker?e.session.marker:n))),o.push(d),u=I.add({td:c},"infowindow",d),l(i,{td:c},d,u)}),g(e,r?o:o[0])},x.circle=function(n){var e=[],o="values"in n.td;return o||(n.opts.center=n.latLng||m(n.opts.center),n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.center=m(s.options.center?s.options.center:o),S||v(s.options.center),s.options.map=S,r=new A.classes.Circle(s.options),e.push(r),a=I.add({td:s},"circle",r),l(i,{td:s},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.getaddress=function(t){c(t,t.results,t.status),b.ack()},x.getlatlng=function(t){c(t,t.results,t.status),b.ack()},x.getmaxzoom=function(t){C().getMaxZoomAtLatLng(t.latLng,function(n){c(t,n.status===q.MaxZoomStatus.OK?n.zoom:!1,status),b.ack()})},x.getelevation=function(t){var n,e=[],o=function(n,e){c(t,e===q.ElevationStatus.OK?n:!1,e),b.ack()};if(t.latLng)e.push(t.latLng);else for(e=h(t.td.locations||[]),n=0;n<e.length;n++)e[n]=m(e[n]);if(e.length)E().getElevationForLocations({locations:e},o);else{if(t.td.path&&t.td.path.length)for(n=0;n<t.td.path.length;n++)e.push(m(t.td.path[n]));e.length?E().getElevationAlongPath({path:e,samples:t.td.samples},o):b.ack()}},x.defaults=function(n){t.each(n.td,function(n,o){A[n]=e(A[n])?t.extend({},A[n],o):o}),b.ack(!0)},x.rectangle=function(n){var e=[],o="values"in n.td;return o||(n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.bounds=y(s.options.bounds?s.options.bounds:o),S||v(s.options.bounds.getCenter()),s.options.map=S,r=new A.classes.Rectangle(s.options),e.push(r),a=I.add({td:s},"rectangle",r),l(i,{td:s},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.polyline=function(t){L(t,"Polyline","path")},x.polygon=function(t){L(t,"Polygon","paths")},x.trafficlayer=function(t){v();var n=I.get("trafficlayer");n||(n=new A.classes.TrafficLayer,n.setMap(S),I.add(t,"trafficlayer",n)),g(t,n)},x.bicyclinglayer=function(t){v();var n=I.get("bicyclinglayer");n||(n=new A.classes.BicyclingLayer,n.setMap(S),I.add(t,"bicyclinglayer",n)),g(t,n)},x.groundoverlay=function(t){t.opts.bounds=y(t.opts.bounds),t.opts.bounds&&v(t.opts.bounds.getCenter());var n,e=new A.classes.GroundOverlay(t.opts.url,t.opts.bounds,t.opts.opts);e.setMap(S),n=I.add(t,"groundoverlay",e),g(t,e,n)},x.streetviewpanorama=function(n){n.opts.opts||(n.opts.opts={}),n.latLng?n.opts.opts.position=n.latLng:n.opts.opts.position&&(n.opts.opts.position=m(n.opts.opts.position)),n.td.divId?n.opts.container=document.getElementById(n.td.divId):n.opts.container&&(n.opts.container=t(n.opts.container).get(0));var e,o=new A.classes.StreetViewPanorama(n.opts.container,n.opts.opts);o&&S.setStreetView(o),e=I.add(n,"streetviewpanorama",o),g(n,o,e)},x.kmllayer=function(n){var e=[],o="values"in n.td;return o||(n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s,d=p(n,o);S||v(),s=d.options,d.options.opts&&(s=d.options.opts,d.options.url&&(s.url=d.options.url)),s.map=S,r=u("3.10")?new A.classes.KmlLayer(s):new A.classes.KmlLayer(s.url,s),e.push(r),a=I.add({td:d},"kmllayer",r),l(i,{td:d},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.panel=function(n){v();var e,o,r=0,s=0,u=t(document.createElement("div"));u.css({position:"absolute",zIndex:1e3,visibility:"hidden"}),n.opts.content&&(o=t(n.opts.content),u.append(o),i.first().prepend(u),a(n.opts.left)?a(n.opts.right)?n.opts.center&&(r=(i.width()-o.width())/2):r=i.width()-o.width()-n.opts.right:r=n.opts.left,a(n.opts.top)?a(n.opts.bottom)?n.opts.middle&&(s=(i.height()-o.height())/2):s=i.height()-o.height()-n.opts.bottom:s=n.opts.top,u.css({top:s,left:r,visibility:"visible"})),e=I.add(n,"panel",u),g(n,u,e),u=null},x.directionsrenderer=function(n){n.opts.map=S;var e,o=new q.DirectionsRenderer(n.opts);n.td.divId?o.setPanel(document.getElementById(n.td.divId)):n.td.container&&o.setPanel(t(n.td.container).get(0)),e=I.add(n,"directionsrenderer",o),g(n,o,e)},x.getgeoloc=function(t){g(t,t.latLng)},x.styledmaptype=function(t){v();var n=new A.classes.StyledMapType(t.td.styles,t.opts);S.mapTypes.set(t.td.id,n),g(t,n)},x.imagemaptype=function(t){v();var n=new A.classes.ImageMapType(t.opts);S.mapTypes.set(t.td.id,n),g(t,n)},x.autofit=function(n){var e=new q.LatLngBounds;t.each(I.all(),function(t,n){n.getPosition?e.extend(n.getPosition()):n.getBounds?(e.extend(n.getBounds().getNorthEast()),e.extend(n.getBounds().getSouthWest())):n.getPaths?n.getPaths().forEach(function(t){t.forEach(function(t){e.extend(t)})}):n.getPath?n.getPath().forEach(function(t){e.extend(t)}):n.getCenter?e.extend(n.getCenter()):"function"==typeof _&&n instanceof _&&(n=I.getById(n.id(),!0),n&&n.autofit(e))}),e.isEmpty()||S.getBounds()&&S.getBounds().equals(e)||("maxZoom"in n.td&&q.event.addListenerOnce(S,"bounds_changed",function(){this.getZoom()>n.td.maxZoom&&this.setZoom(n.td.maxZoom)}),S.fitBounds(e)),g(n,!0)},x.clear=function(n){if(o(n.td)){if(I.clearById(n.td)||I.objClearById(n.td))return void g(n,!0);n.td={name:n.td}}n.td.id?t.each(h(n.td.id),function(t,n){I.clearById(n)||I.objClearById(n)}):(I.clear(h(n.td.name),n.td.last,n.td.first,n.td.tag),I.objClear(h(n.td.name),n.td.last,n.td.first,n.td.tag)),g(n,!0)},x.get=function(e,i,a){var r,s,u=i?e:e.td;return i||(a=u.full),o(u)?(s=I.getById(u,!1,a)||I.objGetById(u),s===!1&&(r=u,u={})):r=u.name,"map"===r&&(s=S),s||(s=[],u.id?(t.each(h(u.id),function(t,n){s.push(I.getById(n,!1,a)||I.objGetById(n))}),R(u.id)||(s=s[0])):(t.each(r?h(r):[n],function(n,e){var o;u.first?(o=I.get(e,!1,u.tag,a),o&&s.push(o)):u.all?t.each(I.all(e,u.tag,a),function(t,n){s.push(n)}):(o=I.get(e,!0,u.tag,a),o&&s.push(o))}),u.all||R(r)||(s=s[0]))),s=R(s)||!u.all?s:[s],i?s:void g(e,s)},x.exec=function(n){t.each(h(n.td.func),function(e,o){t.each(x.get(n.td,!0,n.td.hasOwnProperty("full")?n.td.full:!0),function(t,n){o.call(i,n)})}),g(n,!0)},x.trigger=function(n){if(o(n.td))q.event.trigger(S,n.td);else{var e=[S,n.td.eventName];n.td.var_args&&t.each(n.td.var_args,function(t,n){e.push(n)}),q.event.trigger.apply(q.event,e)}c(n),b.ack()}}var A,q,Z=0,z=t.isFunction,R=t.isArray,V={},G=new I;t.fn.gmap3=function(){var n,e=[],o=!0,i=[];for(r(),n=0;n<arguments.length;n++)arguments[n]&&e.push(arguments[n]);return e.length||e.push("map"),t.each(this,function(){var n=t(this),a=n.data("gmap3");o=!1,a||(a=new U(n),n.data("gmap3",a)),1!==e.length||"get"!==e[0]&&!x(e[0])?a._plan(e):i.push("get"===e[0]?a.get("map",!0):a.get(e[0].get,!0,e[0].get.full))}),i.length?1===i.length?i[0]:i:this}}(jQuery);