PageSourceSearch

https://www.ig-bdsm.ch/wp-content/plugins/directorist/assets/vendo…/openlayers/openlayers.js?ver=1790987219

js ig-bdsm.ch collected 2026-10-03 00:28:11 UTC 1,073,321 bytes, 24,510 lines download raw bytes

1/*
2
3  OpenLayers.js -- OpenLayers Map Viewer Library
4
5  Copyright (c) 2006-2013 by OpenLayers Contributors
6  Published under the 2-clause BSD license.
7  See http://openlayers.org/dev/license.txt for the full text of the license, and http://openlayers.org/dev/authors.txt for full list of contributors.
8
9  Includes compressed code under the following licenses:
10
11  (For uncompressed versions of the code used, please see the
12  OpenLayers Github repository: <https://github.com/openlayers/openlayers>)
13
14*/
15
16/**
17 * Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/>
18 * Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com)
19 *
20 * Licensed under the Apache License, Version 2.0 (the "License");
21 * you may not use this file except in compliance with the License.
22 * You may obtain a copy of the License at
23 * http://www.apache.org/licenses/LICENSE-2.0
24 */
25
26/**
27 * OpenLayers.Util.pagePosition is based on Yahoo's getXY method, which is
28 * Copyright (c) 2006, Yahoo! Inc.
29 * All rights reserved.
30 *
31 * Redistribution and use of this software in source and binary forms, with or
32 * without modification, are permitted provided that the following conditions
33 * are met:
34 *
35 * * Redistributions of source code must retain the above copyright notice,
36 *   this list of conditions and the following disclaimer.
37 *
38 * * Redistributions in binary form must reproduce the above copyright notice,
39 *   this list of conditions and the following disclaimer in the documentation
40 *   and/or other materials provided with the distribution.
41 *
42 * * Neither the name of Yahoo! Inc. nor the names of its contributors may be
43 *   used to endorse or promote products derived from this software without
44 *   specific prior written permission of Yahoo! Inc.
45 *
46 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
47 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
50 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
51 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
52 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
53 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
54 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
55 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
56 * POSSIBILITY OF SUCH DAMAGE.
57 */
58 var OpenLayers = {
59  VERSION_NUMBER: "Release 2.13.1",
60  singleFile: !0,
61  _getScriptLocation: (function () {
62      for (var a = /(^|(.*?\/))(OpenLayers[^\/]*?\.js)(\?|$)/, b = document.getElementsByTagName("script"), c, d = "", e = 0, f = b.length; e < f; e++)
63          if ((c = b[e].getAttribute("src")))
64              if ((c = c.match(a))) {
65                  d = c[1];
66                  break;
67              }
68      return function () {
69          return d;
70      };
71  })(),
72  ImgPath: "",
73};
74OpenLayers.Class = function () {
75  var a = arguments.length,
76      b = arguments[0],
77      c = arguments[a - 1],
78      d =
79          "function" == typeof c.initialize
80              ? c.initialize
81              : function () {
82                    b.prototype.initialize.apply(this, arguments);
83                };
84  1 < a ? ((a = [d, b].concat(Array.prototype.slice.call(arguments).slice(1, a - 1), c)), OpenLayers.inherit.apply(null, a)) : (d.prototype = c);
85  return d;
86};
87OpenLayers.inherit = function (a, b) {
88  var c = function () {};
89  c.prototype = b.prototype;
90  a.prototype = new c();
91  var d,
92      e,
93      c = 2;
94  for (d = arguments.length; c < d; c++) (e = arguments[c]), "function" === typeof e && (e = e.prototype), OpenLayers.Util.extend(a.prototype, e);
95};
96OpenLayers.Util = OpenLayers.Util || {};
97OpenLayers.Util.extend = function (a, b) {
98  a = a || {};
99  if (b) {
100      for (var c in b) {
101          var d = b[c];
102          void 0 !== d && (a[c] = d);
103      }
104      ("function" == typeof window.Event && b instanceof window.Event) || !b.hasOwnProperty || !b.hasOwnProperty("toString") || (a.toString = b.toString);
105  }
106  return a;
107};
108OpenLayers.String = {
109  startsWith: function (a, b) {
110      return 0 == a.indexOf(b);
111  },
112  contains: function (a, b) {
113      return -1 != a.indexOf(b);
114  },
115  trim: function (a) {
116      return a.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
117  },
118  camelize: function (a) {
119      a = a.split("-");
120      for (var b = a[0], c = 1, d = a.length; c < d; c++) var e = a[c], b = b + (e.charAt(0).toUpperCase() + e.substring(1));
121      return b;
122  },
123  format: function (a, b, c) {
124      b || (b = window);
125      return a.replace(OpenLayers.String.tokenRegEx, function (a, e) {
126          for (var f, g = e.split(/\.+/), h = 0; h < g.length; h++) {
127              0 == h && (f = b);
128              if (void 0 === f) break;
129              f = f[g[h]];
130          }
131          "function" == typeof f && (f = c ? f.apply(null, c) : f());
132          return "undefined" == typeof f ? "undefined" : f;
133      });
134  },
135  tokenRegEx: /\$\{([\w.]+?)\}/g,
136  numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
137  isNumeric: function (a) {
138      return OpenLayers.String.numberRegEx.test(a);
139  },
140  numericIf: function (a, b) {
141      var c = a;
142      !0 === b && null != a && a.replace && (a = a.replace(/^\s*|\s*$/g, ""));
143      return OpenLayers.String.isNumeric(a) ? parseFloat(a) : c;
144  },
145};
146OpenLayers.Number = {
147  decimalSeparator: ".",
148  thousandsSeparator: ",",
149  limitSigDigs: function (a, b) {
150      var c = 0;
151      0 < b && (c = parseFloat(a.toPrecision(b)));
152      return c;
153  },
154  format: function (a, b, c, d) {
155      b = "undefined" != typeof b ? b : 0;
156      c = "undefined" != typeof c ? c : OpenLayers.Number.thousandsSeparator;
157      d = "undefined" != typeof d ? d : OpenLayers.Number.decimalSeparator;
158      null != b && (a = parseFloat(a.toFixed(b)));
159      var e = a.toString().split(".");
160      1 == e.length && null == b && (b = 0);
161      a = e[0];
162      if (c) for (var f = /(-?[0-9]+)([0-9]{3})/; f.test(a); ) a = a.replace(f, "$1" + c + "$2");
163      0 == b ? (b = a) : ((c = 1 < e.length ? e[1] : "0"), null != b && (c += Array(b - c.length + 1).join("0")), (b = a + d + c));
164      return b;
165  },
166  zeroPad: function (a, b, c) {
167      for (a = a.toString(c || 10); a.length < b; ) a = "0" + a;
168      return a;
169  },
170};
171OpenLayers.Function = {
172  bind: function (a, b) {
173      var c = Array.prototype.slice.apply(arguments, [2]);
174      return function () {
175          var d = c.concat(Array.prototype.slice.apply(arguments, [0]));
176          return a.apply(b, d);
177      };
178  },
179  bindAsEventListener: function (a, b) {
180      return function (c) {
181          return a.call(b, c || window.event);
182      };
183  },
184  False: function () {
185      return !1;
186  },
187  True: function () {
188      return !0;
189  },
190  Void: function () {},
191};
192OpenLayers.Array = {
193  filter: function (a, b, c) {
194      var d = [];
195      if (Array.prototype.filter) d = a.filter(b, c);
196      else {
197          var e = a.length;
198          if ("function" != typeof b) throw new TypeError();
199          for (var f = 0; f < e; f++)
200              if (f in a) {
201                  var g = a[f];
202                  b.call(c, g, f, a) && d.push(g);
203              }
204      }
205      return d;
206  },
207};
208OpenLayers.Bounds = OpenLayers.Class({
209  left: null,
210  bottom: null,
211  right: null,
212  top: null,
213  centerLonLat: null,
214  initialize: function (a, b, c, d) {
215      OpenLayers.Util.isArray(a) && ((d = a[3]), (c = a[2]), (b = a[1]), (a = a[0]));
216      null != a && (this.left = OpenLayers.Util.toFloat(a));
217      null != b && (this.bottom = OpenLayers.Util.toFloat(b));
218      null != c && (this.right = OpenLayers.Util.toFloat(c));
219      null != d && (this.top = OpenLayers.Util.toFloat(d));
220  },
221  clone: function () {
222      return new OpenLayers.Bounds(this.left, this.bottom, this.right, this.top);
223  },
224  equals: function (a) {
225      var b = !1;
226      null != a && (b = this.left == a.left && this.right == a.right && this.top == a.top && this.bottom == a.bottom);
227      return b;
228  },
229  toString: function () {
230      return [this.left, this.bottom, this.right, this.top].join();
231  },
232  toArray: function (a) {
233      return !0 === a ? [this.bottom, this.left, this.top, this.right] : [this.left, this.bottom, this.right, this.top];
234  },
235  toBBOX: function (a, b) {
236      null == a && (a = 6);
237      var c = Math.pow(10, a),
238          d = Math.round(this.left * c) / c,
239          e = Math.round(this.bottom * c) / c,
240          f = Math.round(this.right * c) / c,
241          c = Math.round(this.top * c) / c;
242      return !0 === b ? e + "," + d + "," + c + "," + f : d + "," + e + "," + f + "," + c;
243  },
244  toGeometry: function () {
245      return new OpenLayers.Geometry.Polygon([
246          new OpenLayers.Geometry.LinearRing([
247              new OpenLayers.Geometry.Point(this.left, this.bottom),
248              new OpenLayers.Geometry.Point(this.right, this.bottom),
249              new OpenLayers.Geometry.Point(this.right, this.top),
250              new OpenLayers.Geometry.Point(this.left, this.top),
251          ]),
252      ]);
253  },
254  getWidth: function () {
255      return this.right - this.left;
256  },
257  getHeight: function () {
258      return this.top - this.bottom;
259  },
260  getSize: function () {
261      return new OpenLayers.Size(this.getWidth(), this.getHeight());
262  },
263  getCenterPixel: function () {
264      return new OpenLayers.Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
265  },
266  getCenterLonLat: function () {
267      this.centerLonLat || (this.centerLonLat = new OpenLayers.LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2));
268      return this.centerLonLat;
269  },
270  scale: function (a, b) {
271      null == b && (b = this.getCenterLonLat());
272      var c, d;
273      "OpenLayers.LonLat" == b.CLASS_NAME ? ((c = b.lon), (d = b.lat)) : ((c = b.x), (d = b.y));
274      return new OpenLayers.Bounds((this.left - c) * a + c, (this.bottom - d) * a + d, (this.right - c) * a + c, (this.top - d) * a + d);
275  },
276  add: function (a, b) {
277      if (null == a || null == b) throw new TypeError("Bounds.add cannot receive null values");
278      return new OpenLayers.Bounds(this.left + a, this.bottom + b, this.right + a, this.top + b);
279  },
280  extend: function (a) {
281      if (a)
282          switch (a.CLASS_NAME) {
283              case "OpenLayers.LonLat":
284                  this.extendXY(a.lon, a.lat);
285                  break;
286              case "OpenLayers.Geometry.Point":
287                  this.extendXY(a.x, a.y);
288                  break;
289              case "OpenLayers.Bounds":
290                  this.centerLonLat = null;
291                  if (null == this.left || a.left < this.left) this.left = a.left;
292                  if (null == this.bottom || a.bottom < this.bottom) this.bottom = a.bottom;
293                  if (null == this.right || a.right > this.right) this.right = a.right;
294                  if (null == this.top || a.top > this.top) this.top = a.top;
295          }
296  },
297  extendXY: function (a, b) {
298      this.centerLonLat = null;
299      if (null == this.left || a < this.left) this.left = a;
300      if (null == this.bottom || b < this.bottom) this.bottom = b;
301      if (null == this.right || a > this.right) this.right = a;
302      if (null == this.top || b > this.top) this.top = b;
303  },
304  containsLonLat: function (a, b) {
305      "boolean" === typeof b && (b = { inclusive: b });
306      b = b || {};
307      var c = this.contains(a.lon, a.lat, b.inclusive),
308          d = b.worldBounds;
309      d && !c && ((c = d.getWidth()), (d = Math.round((a.lon - (d.left + d.right) / 2) / c)), (c = this.containsLonLat({ lon: a.lon - d * c, lat: a.lat }, { inclusive: b.inclusive })));
310      return c;
311  },
312  containsPixel: function (a, b) {
313      return this.contains(a.x, a.y, b);
314  },
315  contains: function (a, b, c) {
316      null == c && (c = !0);
317      if (null == a || null == b) return !1;
318      a = OpenLayers.Util.toFloat(a);
319      b = OpenLayers.Util.toFloat(b);
320      var d = !1;
321      return (d = c ? a >= this.left && a <= this.right && b >= this.bottom && b <= this.top : a > this.left && a < this.right && b > this.bottom && b < this.top);
322  },
323  intersectsBounds: function (a, b) {
324      "boolean" === typeof b && (b = { inclusive: b });
325      b = b || {};
326      if (b.worldBounds) {
327          var c = this.wrapDateLine(b.worldBounds);
328          a = a.wrapDateLine(b.worldBounds);
329      } else c = this;
330      null == b.inclusive && (b.inclusive = !0);
331      var d = !1,
332          e = c.left == a.right || c.right == a.left || c.top == a.bottom || c.bottom == a.top;
333      if (b.inclusive || !e)
334          var d = (a.top >= c.bottom && a.top <= c.top) || (c.top > a.bottom && c.top < a.top),
335              e = (a.left >= c.left && a.left <= c.right) || (c.left >= a.left && c.left <= a.right),
336              f = (a.right >= c.left && a.right <= c.right) || (c.right >= a.left && c.right <= a.right),
337              d = ((a.bottom >= c.bottom && a.bottom <= c.top) || (c.bottom >= a.bottom && c.bottom <= a.top) || d) && (e || f);
338      if (b.worldBounds && !d) {
339          var g = b.worldBounds,
340              e = g.getWidth(),
341              f = !g.containsBounds(c),
342              g = !g.containsBounds(a);
343          f && !g ? ((a = a.add(-e, 0)), (d = c.intersectsBounds(a, { inclusive: b.inclusive }))) : g && !f && ((c = c.add(-e, 0)), (d = a.intersectsBounds(c, { inclusive: b.inclusive })));
344      }
345      return d;
346  },
347  containsBounds: function (a, b, c) {
348      null == b && (b = !1);
349      null == c && (c = !0);
350      var d = this.contains(a.left, a.bottom, c),
351          e = this.contains(a.right, a.bottom, c),
352          f = this.contains(a.left, a.top, c);
353      a = this.contains(a.right, a.top, c);
354      return b ? d || e || f || a : d && e && f && a;
355  },
356  determineQuadrant: function (a) {
357      var b = "",
358          c = this.getCenterLonLat(),
359          b = b + (a.lat < c.lat ? "b" : "t");
360      return (b += a.lon < c.lon ? "l" : "r");
361  },
362  transform: function (a, b) {
363      this.centerLonLat = null;
364      var c = OpenLayers.Projection.transform({ x: this.left, y: this.bottom }, a, b),
365          d = OpenLayers.Projection.transform({ x: this.right, y: this.bottom }, a, b),
366          e = OpenLayers.Projection.transform({ x: this.left, y: this.top }, a, b),
367          f = OpenLayers.Projection.transform({ x: this.right, y: this.top }, a, b);
368      this.left = Math.min(c.x, e.x);
369      this.bottom = Math.min(c.y, d.y);
370      this.right = Math.max(d.x, f.x);
371      this.top = Math.max(e.y, f.y);
372      return this;
373  },
374  wrapDateLine: function (a, b) {
375      b = b || {};
376      var c = b.leftTolerance || 0,
377          d = b.rightTolerance || 0,
378          e = this.clone();
379      if (a) {
380          for (var f = a.getWidth(); e.left < a.left && e.right - d <= a.left; ) e = e.add(f, 0);
381          for (; e.left + c >= a.right && e.right > a.right; ) e = e.add(-f, 0);
382          c = e.left + c;
383          c < a.right && c > a.left && e.right - d > a.right && (e = e.add(-f, 0));
384      }
385      return e;
386  },
387  CLASS_NAME: "OpenLayers.Bounds",
388});
389OpenLayers.Bounds.fromString = function (a, b) {
390  var c = a.split(",");
391  return OpenLayers.Bounds.fromArray(c, b);
392};
393OpenLayers.Bounds.fromArray = function (a, b) {
394  return !0 === b ? new OpenLayers.Bounds(a[1], a[0], a[3], a[2]) : new OpenLayers.Bounds(a[0], a[1], a[2], a[3]);
395};
396OpenLayers.Bounds.fromSize = function (a) {
397  return new OpenLayers.Bounds(0, a.h, a.w, 0);
398};
399OpenLayers.Bounds.oppositeQuadrant = function (a) {
400  var b;
401  b = "" + ("t" == a.charAt(0) ? "b" : "t");
402  return (b += "l" == a.charAt(1) ? "r" : "l");
403};
404OpenLayers.Element = {
405  visible: function (a) {
406      return "none" != OpenLayers.Util.getElement(a).style.display;
407  },
408  toggle: function () {
409      for (var a = 0, b = arguments.length; a < b; a++) {
410          var c = OpenLayers.Util.getElement(arguments[a]),
411              d = OpenLayers.Element.visible(c) ? "none" : "";
412          c.style.display = d;
413      }
414  },
415  remove: function (a) {
416      a = OpenLayers.Util.getElement(a);
417      a.parentNode.removeChild(a);
418  },
419  getHeight: function (a) {
420      a = OpenLayers.Util.getElement(a);
421      return a.offsetHeight;
422  },
423  hasClass: function (a, b) {
424      var c = a.className;
425      return !!c && RegExp("(^|\\s)" + b + "(\\s|$)").test(c);
426  },
427  addClass: function (a, b) {
428      OpenLayers.Element.hasClass(a, b) || (a.className += (a.className ? " " : "") + b);
429      return a;
430  },
431  removeClass: function (a, b) {
432      var c = a.className;
433      c && (a.className = OpenLayers.String.trim(c.replace(RegExp("(^|\\s+)" + b + "(\\s+|$)"), " ")));
434      return a;
435  },
436  toggleClass: function (a, b) {
437      OpenLayers.Element.hasClass(a, b) ? OpenLayers.Element.removeClass(a, b) : OpenLayers.Element.addClass(a, b);
438      return a;
439  },
440  getStyle: function (a, b) {
441      a = OpenLayers.Util.getElement(a);
442      var c = null;
443      if (a && a.style) {
444          c = a.style[OpenLayers.String.camelize(b)];
445          c ||
446              (document.defaultView && document.defaultView.getComputedStyle
447                  ? (c = (c = document.defaultView.getComputedStyle(a, null)) ? c.getPropertyValue(b) : null)
448                  : a.currentStyle && (c = a.currentStyle[OpenLayers.String.camelize(b)]));
449          var d = ["left", "top", "right", "bottom"];
450          window.opera && -1 != OpenLayers.Util.indexOf(d, b) && "static" == OpenLayers.Element.getStyle(a, "position") && (c = "auto");
451      }
452      return "auto" == c ? null : c;
453  },
454};
455OpenLayers.LonLat = OpenLayers.Class({
456  lon: 0,
457  lat: 0,
458  initialize: function (a, b) {
459      OpenLayers.Util.isArray(a) && ((b = a[1]), (a = a[0]));
460      this.lon = OpenLayers.Util.toFloat(a);
461      this.lat = OpenLayers.Util.toFloat(b);
462  },
463  toString: function () {
464      return "lon=" + this.lon + ",lat=" + this.lat;
465  },
466  toShortString: function () {
467      return this.lon + ", " + this.lat;
468  },
469  clone: function () {
470      return new OpenLayers.LonLat(this.lon, this.lat);
471  },
472  add: function (a, b) {
473      if (null == a || null == b) throw new TypeError("LonLat.add cannot receive null values");
474      return new OpenLayers.LonLat(this.lon + OpenLayers.Util.toFloat(a), this.lat + OpenLayers.Util.toFloat(b));
475  },
476  equals: function (a) {
477      var b = !1;
478      null != a && (b = (this.lon == a.lon && this.lat == a.lat) || (isNaN(this.lon) && isNaN(this.lat) && isNaN(a.lon) && isNaN(a.lat)));
479      return b;
480  },
481  transform: function (a, b) {
482      var c = OpenLayers.Projection.transform({ x: this.lon, y: this.lat }, a, b);
483      this.lon = c.x;
484      this.lat = c.y;
485      return this;
486  },
487  wrapDateLine: function (a) {
488      var b = this.clone();
489      if (a) {
490          for (; b.lon < a.left; ) b.lon += a.getWidth();
491          for (; b.lon > a.right; ) b.lon -= a.getWidth();
492      }
493      return b;
494  },
495  CLASS_NAME: "OpenLayers.LonLat",
496});
497OpenLayers.LonLat.fromString = function (a) {
498  a = a.split(",");
499  return new OpenLayers.LonLat(a[0], a[1]);
500};
501OpenLayers.LonLat.fromArray = function (a) {
502  var b = OpenLayers.Util.isArray(a);
503  return new OpenLayers.LonLat(b && a[0], b && a[1]);
504};
505OpenLayers.Pixel = OpenLayers.Class({
506  x: 0,
507  y: 0,
508  initialize: function (a, b) {
509      this.x = parseFloat(a);
510      this.y = parseFloat(b);
511  },
512  toString: function () {
513      return "x=" + this.x + ",y=" + this.y;
514  },
515  clone: function () {
516      return new OpenLayers.Pixel(this.x, this.y);
517  },
518  equals: function (a) {
519      var b = !1;
520      null != a && (b = (this.x == a.x && this.y == a.y) || (isNaN(this.x) && isNaN(this.y) && isNaN(a.x) && isNaN(a.y)));
521      return b;
522  },
523  distanceTo: function (a) {
524      return Math.sqrt(Math.pow(this.x - a.x, 2) + Math.pow(this.y - a.y, 2));
525  },
526  add: function (a, b) {
527      if (null == a || null == b) throw new TypeError("Pixel.add cannot receive null values");
528      return new OpenLayers.Pixel(this.x + a, this.y + b);
529  },
530  offset: function (a) {
531      var b = this.clone();
532      a && (b = this.add(a.x, a.y));
533      return b;
534  },
535  CLASS_NAME: "OpenLayers.Pixel",
536});
537OpenLayers.Size = OpenLayers.Class({
538  w: 0,
539  h: 0,
540  initialize: function (a, b) {
541      this.w = parseFloat(a);
542      this.h = parseFloat(b);
543  },
544  toString: function () {
545      return "w=" + this.w + ",h=" + this.h;
546  },
547  clone: function () {
548      return new OpenLayers.Size(this.w, this.h);
549  },
550  equals: function (a) {
551      var b = !1;
552      null != a && (b = (this.w == a.w && this.h == a.h) || (isNaN(this.w) && isNaN(this.h) && isNaN(a.w) && isNaN(a.h)));
553      return b;
554  },
555  CLASS_NAME: "OpenLayers.Size",
556});
557OpenLayers.Console = {
558  log: function () {},
559  debug: function () {},
560  info: function () {},
561  warn: function () {},
562  error: function () {},
563  userError: function (a) {
564      alert(a);
565  },
566  assert: function () {},
567  dir: function () {},
568  dirxml: function () {},
569  trace: function () {},
570  group: function () {},
571  groupEnd: function () {},
572  time: function () {},
573  timeEnd: function () {},
574  profile: function () {},
575  profileEnd: function () {},
576  count: function () {},
577  CLASS_NAME: "OpenLayers.Console",
578};
579(function () {
580  for (var a = document.getElementsByTagName("script"), b = 0, c = a.length; b < c; ++b)
581      if (-1 != a[b].src.indexOf("firebug.js") && console) {
582          OpenLayers.Util.extend(OpenLayers.Console, console);
583          break;
584      }
585})();
586OpenLayers.Lang = {
587  code: null,
588  defaultCode: "en",
589  getCode: function () {
590      OpenLayers.Lang.code || OpenLayers.Lang.setCode();
591      return OpenLayers.Lang.code;
592  },
593  setCode: function (a) {
594      var b;
595      a || (a = "msie" == OpenLayers.BROWSER_NAME ? navigator.userLanguage : navigator.language);
596      a = a.split("-");
597      a[0] = a[0].toLowerCase();
598      "object" == typeof OpenLayers.Lang[a[0]] && (b = a[0]);
599      if (a[1]) {
600          var c = a[0] + "-" + a[1].toUpperCase();
601          "object" == typeof OpenLayers.Lang[c] && (b = c);
602      }
603      b || (OpenLayers.Console.warn("Failed to find OpenLayers.Lang." + a.join("-") + " dictionary, falling back to default language"), (b = OpenLayers.Lang.defaultCode));
604      OpenLayers.Lang.code = b;
605  },
606  translate: function (a, b) {
607      var c = OpenLayers.Lang[OpenLayers.Lang.getCode()];
608      (c = c && c[a]) || (c = a);
609      b && (c = OpenLayers.String.format(c, b));
610      return c;
611  },
612};
613OpenLayers.i18n = OpenLayers.Lang.translate;
614OpenLayers.Util = OpenLayers.Util || {};
615OpenLayers.Util.getElement = function () {
616  for (var a = [], b = 0, c = arguments.length; b < c; b++) {
617      var d = arguments[b];
618      "string" == typeof d && (d = document.getElementById(d));
619      if (1 == arguments.length) return d;
620      a.push(d);
621  }
622  return a;
623};
624OpenLayers.Util.isElement = function (a) {
625  return !(!a || 1 !== a.nodeType);
626};
627OpenLayers.Util.isArray = function (a) {
628  return "[object Array]" === Object.prototype.toString.call(a);
629};
630OpenLayers.Util.removeItem = function (a, b) {
631  for (var c = a.length - 1; 0 <= c; c--) a[c] == b && a.splice(c, 1);
632  return a;
633};
634OpenLayers.Util.indexOf = function (a, b) {
635  if ("function" == typeof a.indexOf) return a.indexOf(b);
636  for (var c = 0, d = a.length; c < d; c++) if (a[c] == b) return c;
637  return -1;
638};
639OpenLayers.Util.dotless = /\./g;
640OpenLayers.Util.modifyDOMElement = function (a, b, c, d, e, f, g, h) {
641  b && (a.id = b.replace(OpenLayers.Util.dotless, "_"));
642  c && ((a.style.left = c.x + "px"), (a.style.top = c.y + "px"));
643  d && ((a.style.width = d.w + "px"), (a.style.height = d.h + "px"));
644  e && (a.style.position = e);
645  f && (a.style.border = f);
646  g && (a.style.overflow = g);
647  0 <= parseFloat(h) && 1 > parseFloat(h) ? ((a.style.filter = "alpha(opacity=" + 100 * h + ")"), (a.style.opacity = h)) : 1 == parseFloat(h) && ((a.style.filter = ""), (a.style.opacity = ""));
648};
649OpenLayers.Util.createDiv = function (a, b, c, d, e, f, g, h) {
650  var k = document.createElement("div");
651  d && (k.style.backgroundImage = "url(" + d + ")");
652  a || (a = OpenLayers.Util.createUniqueID("OpenLayersDiv"));
653  e || (e = "absolute");
654  OpenLayers.Util.modifyDOMElement(k, a, b, c, e, f, g, h);
655  return k;
656};
657OpenLayers.Util.createImage = function (a, b, c, d, e, f, g, h) {
658  var k = document.createElement("img");
659  a || (a = OpenLayers.Util.createUniqueID("OpenLayersDiv"));
660  e || (e = "relative");
661  OpenLayers.Util.modifyDOMElement(k, a, b, c, e, f, null, g);
662  h &&
663      ((k.style.display = "none"),
664      (b = function () {
665          k.style.display = "";
666          OpenLayers.Event.stopObservingElement(k);
667      }),
668      OpenLayers.Event.observe(k, "load", b),
669      OpenLayers.Event.observe(k, "error", b));
670  k.style.alt = a;
671  k.galleryImg = "no";
672  d && (k.src = d);
673  return k;
674};
675OpenLayers.IMAGE_RELOAD_ATTEMPTS = 0;
676OpenLayers.Util.alphaHackNeeded = null;
677OpenLayers.Util.alphaHack = function () {
678  if (null == OpenLayers.Util.alphaHackNeeded) {
679      var a = navigator.appVersion.split("MSIE"),
680          a = parseFloat(a[1]),
681          b = !1;
682      try {
683          b = !!document.body.filters;
684      } catch (c) {}
685      OpenLayers.Util.alphaHackNeeded = b && 5.5 <= a && 7 > a;
686  }
687  return OpenLayers.Util.alphaHackNeeded;
688};
689OpenLayers.Util.modifyAlphaImageDiv = function (a, b, c, d, e, f, g, h, k) {
690  OpenLayers.Util.modifyDOMElement(a, b, c, d, f, null, null, k);
691  b = a.childNodes[0];
692  e && (b.src = e);
693  OpenLayers.Util.modifyDOMElement(b, a.id + "_innerImage", null, d, "relative", g);
694  OpenLayers.Util.alphaHack() &&
695      ("none" != a.style.display && (a.style.display = "inline-block"),
696      null == h && (h = "scale"),
697      (a.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + b.src + "', sizingMethod='" + h + "')"),
698      0 <= parseFloat(a.style.opacity) && 1 > parseFloat(a.style.opacity) && (a.style.filter += " alpha(opacity=" + 100 * a.style.opacity + ")"),
699      (b.style.filter = "alpha(opacity=0)"));
700};
701OpenLayers.Util.createAlphaImageDiv = function (a, b, c, d, e, f, g, h, k) {
702  var l = OpenLayers.Util.createDiv();
703  k = OpenLayers.Util.createImage(null, null, null, null, null, null, null, k);
704  k.className = "olAlphaImg";
705  l.appendChild(k);
706  OpenLayers.Util.modifyAlphaImageDiv(l, a, b, c, d, e, f, g, h);
707  return l;
708};
709OpenLayers.Util.upperCaseObject = function (a) {
710  var b = {},
711      c;
712  for (c in a) b[c.toUpperCase()] = a[c];
713  return b;
714};
715OpenLayers.Util.applyDefaults = function (a, b) {
716  a = a || {};
717  var c = "function" == typeof window.Event && b instanceof window.Event,
718      d;
719  for (d in b) if (void 0 === a[d] || (!c && b.hasOwnProperty && b.hasOwnProperty(d) && !a.hasOwnProperty(d))) a[d] = b[d];
720  !c && b && b.hasOwnProperty && b.hasOwnProperty("toString") && !a.hasOwnProperty("toString") && (a.toString = b.toString);
721  return a;
722};
723OpenLayers.Util.getParameterString = function (a) {
724  var b = [],
725      c;
726  for (c in a) {
727      var d = a[c];
728      if (null != d && "function" != typeof d) {
729          if ("object" == typeof d && d.constructor == Array) {
730              for (var e = [], f, g = 0, h = d.length; g < h; g++) (f = d[g]), e.push(encodeURIComponent(null === f || void 0 === f ? "" : f));
731              d = e.join(",");
732          } else d = encodeURIComponent(d);
733          b.push(encodeURIComponent(c) + "=" + d);
734      }
735  }
736  return b.join("&");
737};
738OpenLayers.Util.urlAppend = function (a, b) {
739  var c = a;
740  if (b)
741      var d = (a + " ").split(/[?&]/),
742          c = c + (" " === d.pop() ? b : d.length ? "&" + b : "?" + b);
743  return c;
744};
745OpenLayers.Util.getImagesLocation = function () {
746  return OpenLayers.ImgPath || OpenLayers._getScriptLocation() + "img/";
747};
748OpenLayers.Util.getImageLocation = function (a) {
749  return OpenLayers.Util.getImagesLocation() + a;
750};
751OpenLayers.Util.Try = function () {
752  for (var a = null, b = 0, c = arguments.length; b < c; b++) {
753      var d = arguments[b];
754      try {
755          a = d();
756          break;
757      } catch (e) {}
758  }
759  return a;
760};
761OpenLayers.Util.getXmlNodeValue = function (a) {
762  var b = null;
763  OpenLayers.Util.Try(
764      function () {
765          b = a.text;
766          b || (b = a.textContent);
767          b || (b = a.firstChild.nodeValue);
768      },
769      function () {
770          b = a.textContent;
771      }
772  );
773  return b;
774};
775OpenLayers.Util.mouseLeft = function (a, b) {
776  for (var c = a.relatedTarget ? a.relatedTarget : a.toElement; c != b && null != c; ) c = c.parentNode;
777  return c != b;
778};
779OpenLayers.Util.DEFAULT_PRECISION = 14;
780OpenLayers.Util.toFloat = function (a, b) {
781  null == b && (b = OpenLayers.Util.DEFAULT_PRECISION);
782  "number" !== typeof a && (a = parseFloat(a));
783  return 0 === b ? a : parseFloat(a.toPrecision(b));
784};
785OpenLayers.Util.rad = function (a) {
786  return (a * Math.PI) / 180;
787};
788OpenLayers.Util.deg = function (a) {
789  return (180 * a) / Math.PI;
790};
791OpenLayers.Util.VincentyConstants = { a: 6378137, b: 6356752.3142, f: 1 / 298.257223563 };
792OpenLayers.Util.distVincenty = function (a, b) {
793  for (
794      var c = OpenLayers.Util.VincentyConstants,
795          d = c.a,
796          e = c.b,
797          c = c.f,
798          f = OpenLayers.Util.rad(b.lon - a.lon),
799          g = Math.atan((1 - c) * Math.tan(OpenLayers.Util.rad(a.lat))),
800          h = Math.atan((1 - c) * Math.tan(OpenLayers.Util.rad(b.lat))),
801          k = Math.sin(g),
802          g = Math.cos(g),
803          l = Math.sin(h),
804          h = Math.cos(h),
805          m = f,
806          n = 2 * Math.PI,
807          p = 20;
808      1e-12 < Math.abs(m - n) && 0 < --p;
809
810  ) {
811      var q = Math.sin(m),
812          r = Math.cos(m),
813          s = Math.sqrt(h * q * h * q + (g * l - k * h * r) * (g * l - k * h * r));
814      if (0 == s) return 0;
815      var r = k * l + g * h * r,
816          t = Math.atan2(s, r),
817          u = Math.asin((g * h * q) / s),
818          v = Math.cos(u) * Math.cos(u),
819          q = r - (2 * k * l) / v,
820          w = (c / 16) * v * (4 + c * (4 - 3 * v)),
821          n = m,
822          m = f + (1 - w) * c * Math.sin(u) * (t + w * s * (q + w * r * (-1 + 2 * q * q)));
823  }
824  if (0 == p) return NaN;
825  d = (v * (d * d - e * e)) / (e * e);
826  c = (d / 1024) * (256 + d * (-128 + d * (74 - 47 * d)));
827  return (e * (1 + (d / 16384) * (4096 + d * (-768 + d * (320 - 175 * d)))) * (t - c * s * (q + (c / 4) * (r * (-1 + 2 * q * q) - (c / 6) * q * (-3 + 4 * s * s) * (-3 + 4 * q * q))))).toFixed(3) / 1e3;
828};
829OpenLayers.Util.destinationVincenty = function (a, b, c) {
830  var d = OpenLayers.Util,
831      e = d.VincentyConstants,
832      f = e.a,
833      g = e.b,
834      h = e.f,
835      e = a.lon;
836  a = a.lat;
837  var k = d.rad(b);
838  b = Math.sin(k);
839  k = Math.cos(k);
840  a = (1 - h) * Math.tan(d.rad(a));
841  var l = 1 / Math.sqrt(1 + a * a),
842      m = a * l,
843      n = Math.atan2(a, k);
844  a = l * b;
845  for (
846      var p = 1 - a * a, f = (p * (f * f - g * g)) / (g * g), q = 1 + (f / 16384) * (4096 + f * (-768 + f * (320 - 175 * f))), r = (f / 1024) * (256 + f * (-128 + f * (74 - 47 * f))), f = c / (g * q), s = 2 * Math.PI;
847      1e-12 < Math.abs(f - s);
848
849  )
850      var t = Math.cos(2 * n + f), u = Math.sin(f), v = Math.cos(f), w = r * u * (t + (r / 4) * (v * (-1 + 2 * t * t) - (r / 6) * t * (-3 + 4 * u * u) * (-3 + 4 * t * t))), s = f, f = c / (g * q) + w;
851  c = m * u - l * v * k;
852  g = Math.atan2(m * v + l * u * k, (1 - h) * Math.sqrt(a * a + c * c));
853  b = Math.atan2(u * b, l * v - m * u * k);
854  k = (h / 16) * p * (4 + h * (4 - 3 * p));
855  t = b - (1 - k) * h * a * (f + k * u * (t + k * v * (-1 + 2 * t * t)));
856  Math.atan2(a, -c);
857  return new OpenLayers.LonLat(e + d.deg(t), d.deg(g));
858};
859OpenLayers.Util.getParameters = function (a, b) {
860  b = b || {};
861  a = null === a || void 0 === a ? window.location.href : a;
862  var c = "";
863  if (OpenLayers.String.contains(a, "?"))
864      var d = a.indexOf("?") + 1,
865          c = OpenLayers.String.contains(a, "#") ? a.indexOf("#") : a.length,
866          c = a.substring(d, c);
867  for (var d = {}, c = c.split(/[&;]/), e = 0, f = c.length; e < f; ++e) {
868      var g = c[e].split("=");
869      if (g[0]) {
870          var h = g[0];
871          try {
872              h = decodeURIComponent(h);
873          } catch (k) {
874              h = unescape(h);
875          }
876          g = (g[1] || "").replace(/\+/g, " ");
877          try {
878              g = decodeURIComponent(g);
879          } catch (l) {
880              g = unescape(g);
881          }
882          !1 !== b.splitArgs && (g = g.split(","));
883          1 == g.length && (g = g[0]);
884          d[h] = g;
885      }
886  }
887  return d;
888};
889OpenLayers.Util.lastSeqID = 0;
890OpenLayers.Util.createUniqueID = function (a) {
891  a = null == a ? "id_" : a.replace(OpenLayers.Util.dotless, "_");
892  OpenLayers.Util.lastSeqID += 1;
893  return a + OpenLayers.Util.lastSeqID;
894};
895OpenLayers.INCHES_PER_UNIT = { inches: 1, ft: 12, mi: 63360, m: 39.37, km: 39370, dd: 4374754, yd: 36 };
896OpenLayers.INCHES_PER_UNIT["in"] = OpenLayers.INCHES_PER_UNIT.inches;
897OpenLayers.INCHES_PER_UNIT.degrees = OpenLayers.INCHES_PER_UNIT.dd;
898OpenLayers.INCHES_PER_UNIT.nmi = 1852 * OpenLayers.INCHES_PER_UNIT.m;
899OpenLayers.METERS_PER_INCH = 0.0254000508001016;
900OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, {
901  Inch: OpenLayers.INCHES_PER_UNIT.inches,
902  Meter: 1 / OpenLayers.METERS_PER_INCH,
903  Foot: 0.3048006096012192 / OpenLayers.METERS_PER_INCH,
904  IFoot: 0.3048 / OpenLayers.METERS_PER_INCH,
905  ClarkeFoot: 0.3047972651151 / OpenLayers.METERS_PER_INCH,
906  SearsFoot: 0.30479947153867626 / OpenLayers.METERS_PER_INCH,
907  GoldCoastFoot: 0.3047997101815088 / OpenLayers.METERS_PER_INCH,
908  IInch: 0.0254 / OpenLayers.METERS_PER_INCH,
909  MicroInch: 2.54e-5 / OpenLayers.METERS_PER_INCH,
910  Mil: 2.54e-8 / OpenLayers.METERS_PER_INCH,
911  Centimeter: 0.01 / OpenLayers.METERS_PER_INCH,
912  Kilometer: 1e3 / OpenLayers.METERS_PER_INCH,
913  Yard: 0.9144018288036576 / OpenLayers.METERS_PER_INCH,
914  SearsYard: 0.914398414616029 / OpenLayers.METERS_PER_INCH,
915  IndianYard: 0.9143985307444408 / OpenLayers.METERS_PER_INCH,
916  IndianYd37: 0.91439523 / OpenLayers.METERS_PER_INCH,
917  IndianYd62: 0.9143988 / OpenLayers.METERS_PER_INCH,
918  IndianYd75: 0.9143985 / OpenLayers.METERS_PER_INCH,
919  IndianFoot: 0.30479951 / OpenLayers.METERS_PER_INCH,
920  IndianFt37: 0.30479841 / OpenLayers.METERS_PER_INCH,
921  IndianFt62: 0.3047996 / OpenLayers.METERS_PER_INCH,
922  IndianFt75: 0.3047995 / OpenLayers.METERS_PER_INCH,
923  Mile: 1609.3472186944373 / OpenLayers.METERS_PER_INCH,
924  IYard: 0.9144 / OpenLayers.METERS_PER_INCH,
925  IMile: 1609.344 / OpenLayers.METERS_PER_INCH,
926  NautM: 1852 / OpenLayers.METERS_PER_INCH,
927  "Lat-66": 110943.31648893273 / OpenLayers.METERS_PER_INCH,
928  "Lat-83": 110946.25736872235 / OpenLayers.METERS_PER_INCH,
929  Decimeter: 0.1 / OpenLayers.METERS_PER_INCH,
930  Millimeter: 0.001 / OpenLayers.METERS_PER_INCH,
931  Dekameter: 10 / OpenLayers.METERS_PER_INCH,
932  Decameter: 10 / OpenLayers.METERS_PER_INCH,
933  Hectometer: 100 / OpenLayers.METERS_PER_INCH,
934  GermanMeter: 1.0000135965 / OpenLayers.METERS_PER_INCH,
935  CaGrid: 0.999738 / OpenLayers.METERS_PER_INCH,
936  ClarkeChain: 20.1166194976 / OpenLayers.METERS_PER_INCH,
937  GunterChain: 20.11684023368047 / OpenLayers.METERS_PER_INCH,
938  BenoitChain: 20.116782494375872 / OpenLayers.METERS_PER_INCH,
939  SearsChain: 20.11676512155 / OpenLayers.METERS_PER_INCH,
940  ClarkeLink: 0.201166194976 / OpenLayers.METERS_PER_INCH,
941  GunterLink: 0.2011684023368047 / OpenLayers.METERS_PER_INCH,
942  BenoitLink: 0.20116782494375873 / OpenLayers.METERS_PER_INCH,
943  SearsLink: 0.2011676512155 / OpenLayers.METERS_PER_INCH,
944  Rod: 5.02921005842012 / OpenLayers.METERS_PER_INCH,
945  IntnlChain: 20.1168 / OpenLayers.METERS_PER_INCH,
946  IntnlLink: 0.201168 / OpenLayers.METERS_PER_INCH,
947  Perch: 5.02921005842012 / OpenLayers.METERS_PER_INCH,
948  Pole: 5.02921005842012 / OpenLayers.METERS_PER_INCH,
949  Furlong: 201.1684023368046 / OpenLayers.METERS_PER_INCH,
950  Rood: 3.778266898 / OpenLayers.METERS_PER_INCH,
951  CapeFoot: 0.3047972615 / OpenLayers.METERS_PER_INCH,
952  Brealey: 375 / OpenLayers.METERS_PER_INCH,
953  ModAmFt: 0.304812252984506 / OpenLayers.METERS_PER_INCH,
954  Fathom: 1.8288 / OpenLayers.METERS_PER_INCH,
955  "NautM-UK": 1853.184 / OpenLayers.METERS_PER_INCH,
956  "50kilometers": 5e4 / OpenLayers.METERS_PER_INCH,
957  "150kilometers": 15e4 / OpenLayers.METERS_PER_INCH,
958});
959OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, {
960  mm: OpenLayers.INCHES_PER_UNIT.Meter / 1e3,
961  cm: OpenLayers.INCHES_PER_UNIT.Meter / 100,
962  dm: 100 * OpenLayers.INCHES_PER_UNIT.Meter,
963  km: 1e3 * OpenLayers.INCHES_PER_UNIT.Meter,
964  kmi: OpenLayers.INCHES_PER_UNIT.nmi,
965  fath: OpenLayers.INCHES_PER_UNIT.Fathom,
966  ch: OpenLayers.INCHES_PER_UNIT.IntnlChain,
967  link: OpenLayers.INCHES_PER_UNIT.IntnlLink,
968  "us-in": OpenLayers.INCHES_PER_UNIT.inches,
969  "us-ft": OpenLayers.INCHES_PER_UNIT.Foot,
970  "us-yd": OpenLayers.INCHES_PER_UNIT.Yard,
971  "us-ch": OpenLayers.INCHES_PER_UNIT.GunterChain,
972  "us-mi": OpenLayers.INCHES_PER_UNIT.Mile,
973  "ind-yd": OpenLayers.INCHES_PER_UNIT.IndianYd37,
974  "ind-ft": OpenLayers.INCHES_PER_UNIT.IndianFt37,
975  "ind-ch": 20.11669506 / OpenLayers.METERS_PER_INCH,
976});
977OpenLayers.DOTS_PER_INCH = 72;
978OpenLayers.Util.normalizeScale = function (a) {
979  return 1 < a ? 1 / a : a;
980};
981OpenLayers.Util.getResolutionFromScale = function (a, b) {
982  var c;
983  a && (null == b && (b = "degrees"), (c = 1 / (OpenLayers.Util.normalizeScale(a) * OpenLayers.INCHES_PER_UNIT[b] * OpenLayers.DOTS_PER_INCH)));
984  return c;
985};
986OpenLayers.Util.getScaleFromResolution = function (a, b) {
987  null == b && (b = "degrees");
988  return a * OpenLayers.INCHES_PER_UNIT[b] * OpenLayers.DOTS_PER_INCH;
989};
990OpenLayers.Util.pagePosition = function (a) {
991  var b = [0, 0],
992      c = OpenLayers.Util.getViewportElement();
993  if (!a || a == window || a == c) return b;
994  var d = OpenLayers.IS_GECKO && document.getBoxObjectFor && "absolute" == OpenLayers.Element.getStyle(a, "position") && ("" == a.style.top || "" == a.style.left),
995      e = null;
996  if (a.getBoundingClientRect) (a = a.getBoundingClientRect()), (e = window.pageYOffset || c.scrollTop), (b[0] = a.left + (window.pageXOffset || c.scrollLeft)), (b[1] = a.top + e);
997  else if (document.getBoxObjectFor && !d) (a = document.getBoxObjectFor(a)), (c = document.getBoxObjectFor(c)), (b[0] = a.screenX - c.screenX), (b[1] = a.screenY - c.screenY);
998  else {
999      b[0] = a.offsetLeft;
1000      b[1] = a.offsetTop;
1001      e = a.offsetParent;
1002      if (e != a) for (; e; ) (b[0] += e.offsetLeft), (b[1] += e.offsetTop), (e = e.offsetParent);
1003      c = OpenLayers.BROWSER_NAME;
1004      if ("opera" == c || ("safari" == c && "absolute" == OpenLayers.Element.getStyle(a, "position"))) b[1] -= document.body.offsetTop;
1005      for (e = a.offsetParent; e && e != document.body; ) {
1006          b[0] -= e.scrollLeft;
1007          if ("opera" != c || "TR" != e.tagName) b[1] -= e.scrollTop;
1008          e = e.offsetParent;
1009      }
1010  }
1011  return b;
1012};
1013OpenLayers.Util.getViewportElement = function () {
1014  var a = arguments.callee.viewportElement;
1015  void 0 == a && ((a = "msie" == OpenLayers.BROWSER_NAME && "CSS1Compat" != document.compatMode ? document.body : document.documentElement), (
1015arguments.callee.viewportElement = a));
1016  return a;
1017};
1018OpenLayers.Util.isEquivalentUrl = function (a, b, c) {
1019  c = c || {};
1020  OpenLayers.Util.applyDefaults(c, { ignoreCase: !0, ignorePort80: !0, ignoreHash: !0, splitArgs: !1 });
1021  a = OpenLayers.Util.createUrlObject(a, c);
1022  b = OpenLayers.Util.createUrlObject(b, c);
1023  for (var d in a) if ("args" !== d && a[d] != b[d]) return !1;
1024  for (d in a.args) {
1025      if (a.args[d] != b.args[d]) return !1;
1026      delete b.args[d];
1027  }
1028  for (d in b.args) return !1;
1029  return !0;
1030};
1031OpenLayers.Util.createUrlObject = function (a, b) {
1032  b = b || {};
1033  if (!/^\w+:\/\//.test(a)) {
1034      var c = window.location,
1035          d = c.port ? ":" + c.port : "",
1036          d = c.protocol + "//" + c.host.split(":").shift() + d;
1037      0 === a.indexOf("/") ? (a = d + a) : ((c = c.pathname.split("/")), c.pop(), (a = d + c.join("/") + "/" + a));
1038  }
1039  b.ignoreCase && (a = a.toLowerCase());
1040  c = document.createElement("a");
1041  c.href = a;
1042  d = {};
1043  d.host = c.host.split(":").shift();
1044  d.protocol = c.protocol;
1045  d.port = b.ignorePort80 ? ("80" == c.port || "0" == c.port ? "" : c.port) : "" == c.port || "0" == c.port ? "80" : c.port;
1046  d.hash = b.ignoreHash || "#" === c.hash ? "" : c.hash;
1047  var e = c.search;
1048  e || ((e = a.indexOf("?")), (e = -1 != e ? a.substr(e) : ""));
1049  d.args = OpenLayers.Util.getParameters(e, { splitArgs: b.splitArgs });
1050  d.pathname = "/" == c.pathname.charAt(0) ? c.pathname : "/" + c.pathname;
1051  return d;
1052};
1053OpenLayers.Util.removeTail = function (a) {
1054  var b = null,
1055      b = a.indexOf("?"),
1056      c = a.indexOf("#");
1057  return (b = -1 == b ? (-1 != c ? a.substr(0, c) : a) : -1 != c ? a.substr(0, Math.min(b, c)) : a.substr(0, b));
1058};
1059OpenLayers.IS_GECKO = (function () {
1060  var a = navigator.userAgent.toLowerCase();
1061  return -1 == a.indexOf("webkit") && -1 != a.indexOf("gecko");
1062})();
1063OpenLayers.CANVAS_SUPPORTED = (function () {
1064  var a = document.createElement("canvas");
1065  return !(!a.getContext || !a.getContext("2d"));
1066})();
1067OpenLayers.BROWSER_NAME = (function () {
1068  var a = "",
1069      b = navigator.userAgent.toLowerCase();
1070  -1 != b.indexOf("opera") ? (a = "opera") : -1 != b.indexOf("msie") ? (a = "msie") : -1 != b.indexOf("safari") ? (a = "safari") : -1 != b.indexOf("mozilla") && (a = -1 != b.indexOf("firefox") ? "firefox" : "mozilla");
1071  return a;
1072})();
1073OpenLayers.Util.getBrowserName = function () {
1074  return OpenLayers.BROWSER_NAME;
1075};
1076OpenLayers.Util.getRenderedDimensions = function (a, b, c) {
1077  var d,
1078      e,
1079      f = document.createElement("div");
1080  f.style.visibility = "hidden";
1081  for (var g = c && c.containerElement ? c.containerElement : document.body, h = !1, k = null, l = g; l && "body" != l.tagName.toLowerCase(); ) {
1082      var m = OpenLayers.Element.getStyle(l, "position");
1083      if ("absolute" == m) {
1084          h = !0;
1085          break;
1086      } else if (m && "static" != m) break;
1087      l = l.parentNode;
1088  }
1089  !h ||
1090      (0 !== g.clientHeight && 0 !== g.clientWidth) ||
1091      ((k = document.createElement("div")),
1092      (k.style.visibility = "hidden"),
1093      (k.style.position = "absolute"),
1094      (k.style.overflow = "visible"),
1095      (k.style.width = document.body.clientWidth + "px"),
1096      (k.style.height = document.body.clientHeight + "px"),
1097      k.appendChild(f));
1098  f.style.position = "absolute";
1099  b && (b.w ? ((d = b.w), (f.style.width = d + "px")) : b.h && ((e = b.h), (f.style.height = e + "px")));
1100  c && c.displayClass && (f.className = c.displayClass);
1101  b = document.createElement("div");
1102  b.innerHTML = a;
1103  b.style.overflow = "visible";
1104  if (b.childNodes) for (a = 0, c = b.childNodes.length; a < c; a++) b.childNodes[a].style && (b.childNodes[a].style.overflow = "visible");
1105  f.appendChild(b);
1106  k ? g.appendChild(k) : g.appendChild(f);
1107  d || ((d = parseInt(b.scrollWidth)), (f.style.width = d + "px"));
1108  e || (e = parseInt(b.scrollHeight));
1109  f.removeChild(b);
1110  k ? (k.removeChild(f), g.removeChild(k)) : g.removeChild(f);
1111  return new OpenLayers.Size(d, e);
1112};
1113OpenLayers.Util.getScrollbarWidth = function () {
1114  var a = OpenLayers.Util._scrollbarWidth;
1115  if (null == a) {
1116      var b = null,
1117          c = null,
1118          b = (a = 0),
1119          b = document.createElement("div");
1120      b.style.position = "absolute";
1121      b.style.top = "-1000px";
1122      b.style.left = "-1000px";
1123      b.style.width = "100px";
1124      b.style.height = "50px";
1125      b.style.overflow = "hidden";
1126      c = document.createElement("div");
1127      c.style.width = "100%";
1128      c.style.height = "200px";
1129      b.appendChild(c);
1130      document.body.appendChild(b);
1131      a = c.offsetWidth;
1132      b.style.overflow = "scroll";
1133      b = c.offsetWidth;
1134      document.body.removeChild(document.body.lastChild);
1135      OpenLayers.Util._scrollbarWidth = a - b;
1136      a = OpenLayers.Util._scrollbarWidth;
1137  }
1138  return a;
1139};
1140OpenLayers.Util.getFormattedLonLat = function (a, b, c) {
1141  c || (c = "dms");
1142  a = ((a + 540) % 360) - 180;
1143  var d = Math.abs(a),
1144      e = Math.floor(d),
1145      f = (d = (d - e) / (1 / 60)),
1146      d = Math.floor(d),
1147      f = Math.round(10 * ((f - d) / (1 / 60))),
1148      f = f / 10;
1149  60 <= f && ((f -= 60), (d += 1), 60 <= d && ((d -= 60), (e += 1)));
1150  10 > e && (e = "0" + e);
1151  e += "\u00b0";
1152  0 <= c.indexOf("dm") && (10 > d && (d = "0" + d), (e += d + "'"), 0 <= c.indexOf("dms") && (10 > f && (f = "0" + f), (e += f + '"')));
1153  return (e = "lon" == b ? e + (0 > a ? OpenLayers.i18n("W") : OpenLayers.i18n("E")) : e + (0 > a ? OpenLayers.i18n("S") : OpenLayers.i18n("N")));
1154};
1155OpenLayers.Format = OpenLayers.Class({
1156  options: null,
1157  externalProjection: null,
1158  internalProjection: null,
1159  data: null,
1160  keepData: !1,
1161  initialize: function (a) {
1162      OpenLayers.Util.extend(this, a);
1163      this.options = a;
1164  },
1165  destroy: function () {},
1166  read: function (a) {
1167      throw Error("Read not implemented.");
1168  },
1169  write: function (a) {
1170      throw Error("Write not implemented.");
1171  },
1172  CLASS_NAME: "OpenLayers.Format",
1173});
1174OpenLayers.Format.CSWGetRecords = function (a) {
1175  a = OpenLayers.Util.applyDefaults(a, OpenLayers.Format.CSWGetRecords.DEFAULTS);
1176  var b = OpenLayers.Format.CSWGetRecords["v" + a.version.replace(/\./g, "_")];
1177  if (!b) throw "Unsupported CSWGetRecords version: " + a.version;
1178  return new b(a);
1179};
1180OpenLayers.Format.CSWGetRecords.DEFAULTS = { version: "2.0.2" };
1181OpenLayers.Control = OpenLayers.Class({
1182  id: null,
1183  map: null,
1184  div: null,
1185  type: null,
1186  allowSelection: !1,
1187  displayClass: "",
1188  title: "",
1189  autoActivate: !1,
1190  active: null,
1191  handlerOptions: null,
1192  handler: null,
1193  eventListeners: null,
1194  events: null,
1195  initialize: function (a) {
1196      this.displayClass = this.CLASS_NAME.replace("OpenLayers.", "ol").replace(/\./g, "");
1197      OpenLayers.Util.extend(this, a);
1198      this.events = new OpenLayers.Events(this);
1199      if (this.eventListeners instanceof Object) this.events.on(this.eventListeners);
1200      null == this.id && (this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"));
1201  },
1202  destroy: function () {
1203      this.events && (this.eventListeners && this.events.un(this.eventListeners), this.events.destroy(), (this.events = null));
1204      this.eventListeners = null;
1205      this.handler && (this.handler.destroy(), (this.handler = null));
1206      if (this.handlers) {
1207          for (var a in this.handlers) this.handlers.hasOwnProperty(a) && "function" == typeof this.handlers[a].destroy && this.handlers[a].destroy();
1208          this.handlers = null;
1209      }
1210      this.map && (this.map.removeControl(this), (this.map = null));
1211      this.div = null;
1212  },
1213  setMap: function (a) {
1214      this.map = a;
1215      this.handler && this.handler.setMap(a);
1216  },
1217  draw: function (a) {
1218      null == this.div &&
1219          ((this.div = OpenLayers.Util.createDiv(this.id)),
1220          (this.div.className = this.displayClass),
1221          this.allowSelection || ((this.div.className += " olControlNoSelect"), this.div.setAttribute("unselectable", "on", 0), (this.div.onselectstart = OpenLayers.Function.False)),
1222          "" != this.title && (this.div.title = this.title));
1223      null != a && (this.position = a.clone());
1224      this.moveTo(this.position);
1225      return this.div;
1226  },
1227  moveTo: function (a) {
1228      null != a && null != this.div && ((this.div.style.left = a.x + "px"), (this.div.style.top = a.y + "px"));
1229  },
1230  activate: function () {
1231      if (this.active) return !1;
1232      this.handler && this.handler.activate();
1233      this.active = !0;
1234      this.map && OpenLayers.Element.addClass(this.map.viewPortDiv, this.displayClass.replace(/ /g, "") + "Active");
1235      this.events.triggerEvent("activate");
1236      return !0;
1237  },
1238  deactivate: function () {
1239      return this.active
1240          ? (this.handler && this.handler.deactivate(), (this.active = !1), this.map && OpenLayers.Element.removeClass(this.map.viewPortDiv, this.displayClass.replace(/ /g, "") + "Active"), this.events.triggerEvent("deactivate"), !0)
1241          : !1;
1242  },
1243  CLASS_NAME: "OpenLayers.Control",
1244});
1245OpenLayers.Control.TYPE_BUTTON = 1;
1246OpenLayers.Control.TYPE_TOGGLE = 2;
1247OpenLayers.Control.TYPE_TOOL = 3;
1248OpenLayers.Event = {
1249  observers: !1,
1250  KEY_SPACE: 32,
1251  KEY_BACKSPACE: 8,
1252  KEY_TAB: 9,
1253  KEY_RETURN: 13,
1254  KEY_ESC: 27,
1255  KEY_LEFT: 37,
1256  KEY_UP: 38,
1257  KEY_RIGHT: 39,
1258  KEY_DOWN: 40,
1259  KEY_DELETE: 46,
1260  element: function (a) {
1261      return a.target || a.srcElement;
1262  },
1263  isSingleTouch: function (a) {
1264      return a.touches && 1 == a.touches.length;
1265  },
1266  isMultiTouch: function (a) {
1267      return a.touches && 1 < a.touches.length;
1268  },
1269  isLeftClick: function (a) {
1270      return (a.which && 1 == a.which) || (a.button && 1 == a.button);
1271  },
1272  isRightClick: function (a) {
1273      return (a.which && 3 == a.which) || (a.button && 2 == a.button);
1274  },
1275  stop: function (a, b) {
1276      b || OpenLayers.Event.preventDefault(a);
1277      a.stopPropagation ? a.stopPropagation() : (a.cancelBubble = !0);
1278  },
1279  preventDefault: function (a) {
1280      a.preventDefault ? a.preventDefault() : (a.returnValue = !1);
1281  },
1282  findElement: function (a, b) {
1283      for (var c = OpenLayers.Event.element(a); c.parentNode && (!c.tagName || c.tagName.toUpperCase() != b.toUpperCase()); ) c = c.parentNode;
1284      return c;
1285  },
1286  observe: function (a, b, c, d) {
1287      a = OpenLayers.Util.getElement(a);
1288      d = d || !1;
1289      "keypress" == b && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || a.attachEvent) && (b = "keydown");
1290      this.observers || (this.observers = {});
1291      if (!a._eventCacheID) {
1292          var e = "eventCacheID_";
1293          a.id && (e = a.id + "_" + e);
1294          a._eventCacheID = OpenLayers.Util.createUniqueID(e);
1295      }
1296      e = a._eventCacheID;
1297      this.observers[e] || (this.observers[e] = []);
1298      this.observers[e].push({ element: a, name: b, observer: c, useCapture: d });
1299      a.addEventListener ? a.addEventListener(b, c, d) : a.attachEvent && a.attachEvent("on" + b, c);
1300  },
1301  stopObservingElement: function (a) {
1302      a = OpenLayers.Util.getElement(a)._eventCacheID;
1303      this._removeElementObservers(OpenLayers.Event.observers[a]);
1304  },
1305  _removeElementObservers: function (a) {
1306      if (a)
1307          for (var b = a.length - 1; 0 <= b; b--) {
1308              var c = a[b];
1309              OpenLayers.Event.stopObserving.apply(this, [c.element, c.name, c.observer, c.useCapture]);
1310          }
1311  },
1312  stopObserving: function (a, b, c, d) {
1313      d = d || !1;
1314      a = OpenLayers.Util.getElement(a);
1315      var e = a._eventCacheID;
1316      "keypress" == b && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || a.detachEvent) && (b = "keydown");
1317      var f = !1,
1318          g = OpenLayers.Event.observers[e];
1319      if (g)
1320          for (var h = 0; !f && h < g.length; ) {
1321              var k = g[h];
1322              if (k.name == b && k.observer == c && k.useCapture == d) {
1323                  g.splice(h, 1);
1324                  0 == g.length && delete OpenLayers.Event.observers[e];
1325                  f = !0;
1326                  break;
1327              }
1328              h++;
1329          }
1330      f && (a.removeEventListener ? a.removeEventListener(b, c, d) : a && a.detachEvent && a.detachEvent("on" + b, c));
1331      return f;
1332  },
1333  unloadCache: function () {
1334      if (OpenLayers.Event && OpenLayers.Event.observers) {
1335          for (var a in OpenLayers.Event.observers) OpenLayers.Event._removeElementObservers.apply(this, [OpenLayers.Event.observers[a]]);
1336          OpenLayers.Event.observers = !1;
1337      }
1338  },
1339  CLASS_NAME: "OpenLayers.Event",
1340};
1341OpenLayers.Event.observe(window, "unload", OpenLayers.Event.unloadCache, !1);
1342OpenLayers.Events = OpenLayers.Class({
1343  BROWSER_EVENTS: "mouseover mouseout mousedown mouseup mousemove click dblclick rightclick dblrightclick resize focus blur touchstart touchmove touchend keydown".split(" "),
1344  listeners: null,
1345  object: null,
1346  element: null,
1347  eventHandler: null,
1348  fallThrough: null,
1349  includeXY: !1,
1350  extensions: null,
1351  extensionCount: null,
1352  clearMouseListener: null,
1353  initialize: function (a, b, c, d, e) {
1354      OpenLayers.Util.extend(this, e);
1355      this.object = a;
1356      this.fallThrough = d;
1357      this.listeners = {};
1358      this.extensions = {};
1359      this.extensionCount = {};
1360      this._msTouches = [];
1361      null != b && this.attachToElement(b);
1362  },
1363  destroy: function () {
1364      for (var a in this.extensions) "boolean" !== typeof this.extensions[a] && this.extensions[a].destroy();
1365      this.extensions = null;
1366      this.element && (OpenLayers.Event.stopObservingElement(this.element), this.element.hasScrollEvent && OpenLayers.Event.stopObserving(window, "scroll", this.clearMouseListener));
1367      this.eventHandler = this.fallThrough = this.object = this.listeners = this.element = null;
1368  },
1369  addEventType: function (a) {},
1370  attachToElement: function (a) {
1371      this.element
1372          ? OpenLayers.Event.stopObservingElement(this.element)
1373          : ((this.eventHandler = OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent, this)), (this.clearMouseListener = OpenLayers.Function.bind(this.clearMouseCache, this)));
1374      this.element = a;
1375      for (var b = !!window.navigator.msMaxTouchPoints, c, d = 0, e = this.BROWSER_EVENTS.length; d < e; d++)
1376          (c = this.BROWSER_EVENTS[d]), OpenLayers.Event.observe(a, c, this.eventHandler), b && 0 === c.indexOf("touch") && this.addMsTouchListener(a, c, this.eventHandler);
1377      OpenLayers.Event.observe(a, "dragstart", OpenLayers.Event.stop);
1378  },
1379  on: function (a) {
1380      for (var b in a) "scope" != b && a.hasOwnProperty(b) && this.register(b, a.scope, a[b]);
1381  },
1382  register: function (a, b, c, d) {
1383      a in OpenLayers.Events && !this.extensions[a] && (this.extensions[a] = new OpenLayers.Events[a](this));
1384      if (null != c) {
1385          null == b && (b = this.object);
1386          var e = this.listeners[a];
1387          e || ((e = []), (this.listeners[a] = e), (this.extensionCount[a] = 0));
1388          b = { obj: b, func: c };
1389          d ? (e.splice(this.extensionCount[a], 0, b), "object" === typeof d && d.extension && this.extensionCount[a]++) : e.push(b);
1390      }
1391  },
1392  registerPriority: function (a, b, c) {
1393      this.register(a, b, c, !0);
1394  },
1395  un: function (a) {
1396      for (var b in a) "scope" != b && a.hasOwnProperty(b) && this.unregister(b, a.scope, a[b]);
1397  },
1398  unregister: function (a, b, c) {
1399      null == b && (b = this.object);
1400      a = this.listeners[a];
1401      if (null != a)
1402          for (var d = 0, e = a.length; d < e; d++)
1403              if (a[d].obj == b && a[d].func == c) {
1404                  a.splice(d, 1);
1405                  break;
1406              }
1407  },
1408  remove: function (a) {
1409      null != this.listeners[a] && (this.listeners[a] = []);
1410  },
1411  triggerEvent: function (a, b) {
1412      var c = this.listeners[a];
1413      if (c && 0 != c.length) {
1414          null == b && (b = {});
1415          b.object = this.object;
1416          b.element = this.element;
1417          b.type || (b.type = a);
1418          for (var c = c.slice(), d, e = 0, f = c.length; e < f && ((d = c[e]), (d = d.func.apply(d.obj, [b])), void 0 == d || !1 != d); e++);
1419          this.fallThrough || OpenLayers.Event.stop(b, !0);
1420          return d;
1421      }
1422  },
1423  handleBrowserEvent: function (a) {
1424      var b = a.type,
1425          c = this.listeners[b];
1426      if (c && 0 != c.length) {
1427          if ((c = a.touches) && c[0]) {
1428              for (var d = 0, e = 0, f = c.length, g, h = 0; h < f; ++h) (g = this.getTouchClientXY(c[h])), (d += g.clientX), (e += g.clientY);
1429              a.clientX = d / f;
1430              a.clientY = e / f;
1431          }
1432          this.includeXY && (a.xy = this.getMousePosition(a));
1433          this.triggerEvent(b, a);
1434      }
1435  },
1436  getTouchClientXY: function (a) {
1437      var b = window.olMockWin || window,
1438          c = b.pageXOffset,
1439          b = b.pageYOffset,
1440          d = a.clientX,
1441          e = a.clientY;
1442      if ((0 === a.pageY && Math.floor(e) > Math.floor(a.pageY)) || (0 === a.pageX && Math.floor(d) > Math.floor(a.pageX))) (d -= c), (e -= b);
1443      else if (e < a.pageY - b || d < a.pageX - c) (d = a.pageX - c), (e = a.pageY - b);
1444      a.olClientX = d;
1445      a.olClientY = e;
1446      return { clientX: d, clientY: e };
1447  },
1448  clearMouseCache: function () {
1449      this.element.scrolls = null;
1450      this.element.lefttop = null;
1451      this.element.offsets = null;
1452  },
1453  getMousePosition: function (a) {
1454      this.includeXY ? this.element.hasScrollEvent || (OpenLayers.Event.observe(window, "scroll", this.clearMouseListener), (this.element.hasScrollEvent = !0)) : this.clearMouseCache();
1455      if (!this.element.scrolls) {
1456          var b = OpenLayers.Util.getViewportElement();
1457          this.element.scrolls = [window.pageXOffset || b.scrollLeft, window.pageYOffset || b.scrollTop];
1458      }
1459      this.element.lefttop || (this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0]);
1460      this.element.offsets || (this.element.offsets = OpenLayers.Util.pagePosition(this.element));
1461      return new OpenLayers.Pixel(a.clientX + this.element.scrolls[0] - this.element.offsets[0] - this.element.lefttop[0], a.clientY + this.element.scrolls[1] - this.element.offsets[1] - this.element.lefttop[1]);
1462  },
1463  addMsTouchListener: function (a, b, c) {
1464      function d(a) {
1465          c(
1466              OpenLayers.Util.applyDefaults(
1467                  {
1468                      stopPropagation: function () {
1469                          for (var a = e.length - 1; 0 <= a; --a) e[a].stopPropagation();
1470                      },
1471                      preventDefault: function () {
1472                          for (var a = e.length - 1; 0 <= a; --a) e[a].preventDefault();
1473                      },
1474                      type: b,
1475                  },
1476                  a
1477              )
1478          );
1479      }
1480      var e = this._msTouches;
1481      switch (b) {
1482          case "touchstart":
1483              return this.addMsTouchListenerStart(a, b, d);
1484          case "touchend":
1485              return this.addMsTouchListenerEnd(a, b, d);
1486          case "touchmove":
1487              return this.addMsTouchListenerMove(a, b, d);
1488          default:
1489              throw "Unknown touch event type";
1490      }
1491  },
1492  addMsTouchListenerStart: function (a, b, c) {
1493      var d = this._msTouches;
1494      OpenLayers.Event.observe(a, "MSPointerDown", function (a) {
1495          for (var b = !1, g = 0, h = d.length; g < h; ++g)
1496              if (d[g].pointerId == a.pointerId) {
1497                  b = !0;
1498                  break;
1499              }
1500          b || d.push(a);
1501          a.touches = d.slice();
1502          c(a);
1503      });
1504      OpenLayers.Event.observe(a, "MSPointerUp", function (a) {
1505          for (var b = 0, c = d.length; b < c; ++b)
1506              if (d[b].pointerId == a.pointerId) {
1507                  d.splice(b, 1);
1508                  break;
1509              }
1510      });
1511  },
1512  addMsTouchListenerMove: function (a, b, c) {
1513      var d = this._msTouches;
1514      OpenLayers.Event.observe(a, "MSPointerMove", function (a) {
1515          if (a.pointerType != a.MSPOINTER_TYPE_MOUSE || 0 != a.buttons)
1516              if (1 != d.length || d[0].pageX != a.pageX || d[0].pageY != a.pageY) {
1517                  for (var b = 0, g = d.length; b < g; ++b)
1518                      if (d[b].pointerId == a.pointerId) {
1519                          d[b] = a;
1520                          break;
1521                      }
1522                  a.touches = d.slice();
1523                  c(a);
1524              }
1525      });
1526  },
1527  addMsTouchListenerEnd: function (a, b, c) {
1528      var d = this._msTouches;
1529      OpenLayers.Event.observe(a, "MSPointerUp", function (a) {
1530          for (var b = 0, g = d.length; b < g; ++b)
1531              if (d[b].pointerId == a.pointerId) {
1532                  d.splice(b, 1);
1533                  break;
1534              }
1535          a.touches = d.slice();
1536          c(a);
1537      });
1538  },
1539  CLASS_NAME: "OpenLayers.Events",
1540});
1541OpenLayers.Events.buttonclick = OpenLayers.Class({
1542  target: null,
1543  events: "mousedown mouseup click dblclick touchstart touchmove touchend keydown".split(" "),
1544  startRegEx: /^mousedown|touchstart$/,
1545  cancelRegEx: /^touchmove$/,
1546  completeRegEx: /^mouseup|touchend$/,
1547  initialize: function (a) {
1548      this.target = a;
1549      for (a = this.events.length - 1; 0 <= a; --a) this.target.register(this.events[a], this, this.buttonClick, { extension: !0 });
1550  },
1551  destroy: function () {
1552      for (var a = this.events.length - 1; 0 <= a; --a) this.target.unregister(this.events[a], this, this.buttonClick);
1553      delete this.target;
1554  },
1555  getPressedButton: function (a) {
1556      var b = 3,
1557          c;
1558      do {
1559          if (OpenLayers.Element.hasClass(a, "olButton")) {
1560              c = a;
1561              break;
1562          }
1563          a = a.parentNode;
1564      } while (0 < --b && a);
1565      return c;
1566  },
1567  ignore: function (a) {
1568      var b = 3,
1569          c = !1;
1570      do {
1571          if ("a" === a.nodeName.toLowerCase()) {
1572              c = !0;
1573              break;
1574          }
1575          a = a.parentNode;
1576      } while (0 < --b && a);
1577      return c;
1578  },
1579  buttonClick: function (a) {
1580      var b = !0,
1581          c = OpenLayers.Event.element(a);
1582      if (c && (OpenLayers.Event.isLeftClick(a) || !~a.type.indexOf("mou
1582se")))
1583          if ((c = this.getPressedButton(c))) {
1584              if ("keydown" === a.type)
1585                  switch (a.keyCode) {
1586                      case OpenLayers.Event.KEY_RETURN:
1587                      case OpenLayers.Event.KEY_SPACE:
1588                          this.target.triggerEvent("buttonclick", { buttonElement: c }), OpenLayers.Event.stop(a), (b = !1);
1589                  }
1590              else if (this.startEvt) {
1591                  if (this.completeRegEx.test(a.type)) {
1592                      var b = OpenLayers.Util.pagePosition(c),
1593                          d = OpenLayers.Util.getViewportElement(),
1594                          e = window.pageYOffset || d.scrollTop;
1595                      b[0] -= window.pageXOffset || d.scrollLeft;
1596                      b[1] -= e;
1597                      this.target.triggerEvent("buttonclick", { buttonElement: c, buttonXY: { x: this.startEvt.clientX - b[0], y: this.startEvt.clientY - b[1] } });
1598                  }
1599                  this.cancelRegEx.test(a.type) && delete this.startEvt;
1600                  OpenLayers.Event.stop(a);
1601                  b = !1;
1602              }
1603              this.startRegEx.test(a.type) && ((this.startEvt = a), OpenLayers.Event.stop(a), (b = !1));
1604          } else (b = !this.ignore(OpenLayers.Event.element(a))), delete this.startEvt;
1605      return b;
1606  },
1607});
1608OpenLayers.Util = OpenLayers.Util || {};
1609OpenLayers.Util.vendorPrefix = (function () {
1610  function a(a) {
1611      return a
1612          ? a
1613                .replace(/([A-Z])/g, function (a) {
1614                    return "-" + a.toLowerCase();
1615                })
1616                .replace(/^ms-/, "-ms-")
1617          : null;
1618  }
1619  function b(a, b) {
1620      if (void 0 === g[b]) {
1621          var c,
1622              e = 0,
1623              f = d.length,
1624              p = "undefined" !== typeof a.cssText;
1625          for (g[b] = null; e < f; e++)
1626              if (((c = d[e]) ? (p || (c = c.toLowerCase()), (c = c + b.charAt(0).toUpperCase() + b.slice(1))) : (c = b), void 0 !== a[c])) {
1627                  g[b] = c;
1628                  break;
1629              }
1630      }
1631      return g[b];
1632  }
1633  function c(a) {
1634      return b(e, a);
1635  }
1636  var d = ["", "O", "ms", "Moz", "Webkit"],
1637      e = document.createElement("div").style,
1638      f = {},
1639      g = {};
1640  return {
1641      css: function (b) {
1642          if (void 0 === f[b]) {
1643              var d = b.replace(/(-[\s\S])/g, function (a) {
1644                      return a.charAt(1).toUpperCase();
1645                  }),
1646                  d = c(d);
1647              f[b] = a(d);
1648          }
1649          return f[b];
1650      },
1651      js: b,
1652      style: c,
1653      cssCache: f,
1654      jsCache: g,
1655  };
1656})();
1657OpenLayers.Animation = (function (a) {
1658  var b = OpenLayers.Util.vendorPrefix.js(a, "requestAnimationFrame"),
1659      c = !!b,
1660      d = (function () {
1661          var c =
1662              a[b] ||
1663              function (b, c) {
1664                  a.setTimeout(b, 16);
1665              };
1666          return function (b, d) {
1667              c.apply(a, [b, d]);
1668          };
1669      })(),
1670      e = 0,
1671      f = {};
1672  return {
1673      isNative: c,
1674      requestFrame: d,
1675      start: function (a, b, c) {
1676          b = 0 < b ? b : Number.POSITIVE_INFINITY;
1677          var l = ++e,
1678              m = +new Date();
1679          f[l] = function () {
1680              f[l] && +new Date() - m <= b ? (a(), f[l] && d(f[l], c)) : delete f[l];
1681          };
1682          d(f[l], c);
1683          return l;
1684      },
1685      stop: function (a) {
1686          delete f[a];
1687      },
1688  };
1689})(window);
1690OpenLayers.Tween = OpenLayers.Class({
1691  easing: null,
1692  begin: null,
1693  finish: null,
1694  duration: null,
1695  callbacks: null,
1696  time: null,
1697  minFrameRate: null,
1698  startTime: null,
1699  animationId: null,
1700  playing: !1,
1701  initialize: function (a) {
1702      this.easing = a ? a : OpenLayers.Easing.Expo.easeOut;
1703  },
1704  start: function (a, b, c, d) {
1705      this.playing = !0;
1706      this.begin = a;
1707      this.finish = b;
1708      this.duration = c;
1709      this.callbacks = d.callbacks;
1710      this.minFrameRate = d.minFrameRate || 30;
1711      this.time = 0;
1712      this.startTime = new Date().getTime();
1713      OpenLayers.Animation.stop(this.animationId);
1714      this.animationId = null;
1715      this.callbacks && this.callbacks.start && this.callbacks.start.call(this, this.begin);
1716      this.animationId = OpenLayers.Animation.start(OpenLayers.Function.bind(this.play, this));
1717  },
1718  stop: function () {
1719      this.playing && (this.callbacks && this.callbacks.done && this.callbacks.done.call(this, this.finish), OpenLayers.Animation.stop(this.animationId), (this.animationId = null), (this.playing = !1));
1720  },
1721  play: function () {
1722      var a = {},
1723          b;
1724      for (b in this.begin) {
1725          var c = this.begin[b],
1726              d = this.finish[b];
1727          if (null == c || null == d || isNaN(c) || isNaN(d)) throw new TypeError("invalid value for Tween");
1728          a[b] = this.easing.apply(this, [this.time, c, d - c, this.duration]);
1729      }
1730      this.time++;
1731      this.callbacks && this.callbacks.eachStep && (new Date().getTime() - this.startTime) / this.time <= 1e3 / this.minFrameRate && this.callbacks.eachStep.call(this, a);
1732      this.time > this.duration && this.stop();
1733  },
1734  CLASS_NAME: "OpenLayers.Tween",
1735});
1736OpenLayers.Easing = { CLASS_NAME: "OpenLayers.Easing" };
1737OpenLayers.Easing.Linear = {
1738  easeIn: function (a, b, c, d) {
1739      return (c * a) / d + b;
1740  },
1741  easeOut: function (a, b, c, d) {
1742      return (c * a) / d + b;
1743  },
1744  easeInOut: function (a, b, c, d) {
1745      return (c * a) / d + b;
1746  },
1747  CLASS_NAME: "OpenLayers.Easing.Linear",
1748};
1749OpenLayers.Easing.Expo = {
1750  easeIn: function (a, b, c, d) {
1751      return 0 == a ? b : c * Math.pow(2, 10 * (a / d - 1)) + b;
1752  },
1753  easeOut: function (a, b, c, d) {
1754      return a == d ? b + c : c * (-Math.pow(2, (-10 * a) / d) + 1) + b;
1755  },
1756  easeInOut: function (a, b, c, d) {
1757      return 0 == a ? b : a == d ? b + c : 1 > (a /= d / 2) ? (c / 2) * Math.pow(2, 10 * (a - 1)) + b : (c / 2) * (-Math.pow(2, -10 * --a) + 2) + b;
1758  },
1759  CLASS_NAME: "OpenLayers.Easing.Expo",
1760};
1761OpenLayers.Easing.Quad = {
1762  easeIn: function (a, b, c, d) {
1763      return c * (a /= d) * a + b;
1764  },
1765  easeOut: function (a, b, c, d) {
1766      return -c * (a /= d) * (a - 2) + b;
1767  },
1768  easeInOut: function (a, b, c, d) {
1769      return 1 > (a /= d / 2) ? (c / 2) * a * a + b : (-c / 2) * (--a * (a - 2) - 1) + b;
1770  },
1771  CLASS_NAME: "OpenLayers.Easing.Quad",
1772};
1773OpenLayers.Projection = OpenLayers.Class({
1774  proj: null,
1775  projCode: null,
1776  titleRegEx: /\+title=[^\+]*/,
1777  initialize: function (a, b) {
1778      OpenLayers.Util.extend(this, b);
1779      this.projCode = a;
1780      "object" == typeof Proj4js && (this.proj = new Proj4js.Proj(a));
1781  },
1782  getCode: function () {
1783      return this.proj ? this.proj.srsCode : this.projCode;
1784  },
1785  getUnits: function () {
1786      return this.proj ? this.proj.units : null;
1787  },
1788  toString: function () {
1789      return this.getCode();
1790  },
1791  equals: function (a) {
1792      var b = !1;
1793      a &&
1794          (a instanceof OpenLayers.Projection || (a = new OpenLayers.Projection(a)),
1795          "object" == typeof Proj4js && this.proj.defData && a.proj.defData
1796              ? (b = this.proj.defData.replace(this.titleRegEx, "") == a.proj.defData.replace(this.titleRegEx, ""))
1797              : a.getCode && ((b = this.getCode()), (a = a.getCode()), (b = b == a || (!!OpenLayers.Projection.transforms[b] && OpenLayers.Projection.transforms[b][a] === OpenLayers.Projection.nullTransform))));
1798      return b;
1799  },
1800  destroy: function () {
1801      delete this.proj;
1802      delete this.projCode;
1803  },
1804  CLASS_NAME: "OpenLayers.Projection",
1805});
1806OpenLayers.Projection.transforms = {};
1807OpenLayers.Projection.defaults = {
1808  "EPSG:4326": { units: "degrees", maxExtent: [-180, -90, 180, 90], yx: !0 },
1809  "CRS:84": { units: "degrees", maxExtent: [-180, -90, 180, 90] },
1810  "EPSG:900913": { units: "m", maxExtent: [-2.003750834e7, -2.003750834e7, 2.003750834e7, 2.003750834e7] },
1811};
1812OpenLayers.Projection.addTransform = function (a, b, c) {
1813  if (c === OpenLayers.Projection.nullTransform) {
1814      var d = OpenLayers.Projection.defaults[a];
1815      d && !OpenLayers.Projection.defaults[b] && (OpenLayers.Projection.defaults[b] = d);
1816  }
1817  OpenLayers.Projection.transforms[a] || (OpenLayers.Projection.transforms[a] = {});
1818  OpenLayers.Projection.transforms[a][b] = c;
1819};
1820OpenLayers.Projection.transform = function (a, b, c) {
1821  if (b && c)
1822      if ((b instanceof OpenLayers.Projection || (b = new OpenLayers.Projection(b)), c instanceof OpenLayers.Projection || (c = new OpenLayers.Projection(c)), b.proj && c.proj)) a = Proj4js.transform(b.proj, c.proj, a);
1823      else {
1824          b = b.getCode();
1825          c = c.getCode();
1826          var d = OpenLayers.Projection.transforms;
1827          if (d[b] && d[b][c]) d[b][c](a);
1828      }
1829  return a;
1830};
1831OpenLayers.Projection.nullTransform = function (a) {
1832  return a;
1833};
1834(function () {
1835  function a(a) {
1836      a.x = (180 * a.x) / d;
1837      a.y = (180 / Math.PI) * (2 * Math.atan(Math.exp((a.y / d) * Math.PI)) - Math.PI / 2);
1838      return a;
1839  }
1840  function b(a) {
1841      a.x = (a.x * d) / 180;
1842      var b = (Math.log(Math.tan(((90 + a.y) * Math.PI) / 360)) / Math.PI) * d;
1843      a.y = Math.max(-2.003750834e7, Math.min(b, 2.003750834e7));
1844      return a;
1845  }
1846  function c(c, d) {
1847      var e = OpenLayers.Projection.addTransform,
1848          f = OpenLayers.Projection.nullTransform,
1849          g,
1850          p,
1851          q,
1852          r,
1853          s;
1854      g = 0;
1855      for (p = d.length; g < p; ++g) for (q = d[g], e(c, q, b), e(q, c, a), s = g + 1; s < p; ++s) (r = d[s]), e(q, r, f), e(r, q, f);
1856  }
1857  var d = 2.003750834e7,
1858      e = ["EPSG:900913", "EPSG:3857", "EPSG:102113", "EPSG:102100"],
1859      f = ["CRS:84", "urn:ogc:def:crs:EPSG:6.6:4326", "EPSG:4326"],
1860      g;
1861  for (g = e.length - 1; 0 <= g; --g) c(e[g], f);
1862  for (g = f.length - 1; 0 <= g; --g) c(f[g], e);
1863})();
1864OpenLayers.Map = OpenLayers.Class({
1865  Z_INDEX_BASE: { BaseLayer: 100, Overlay: 325, Feature: 725, Popup: 750, Control: 1e3 },
1866  id: null,
1867  fractionalZoom: !1,
1868  events: null,
1869  allOverlays: !1,
1870  div: null,
1871  dragging: !1,
1872  size: null,
1873  viewPortDiv: null,
1874  layerContainerOrigin: null,
1875  layerContainerDiv: null,
1876  layers: null,
1877  controls: null,
1878  popups: null,
1879  baseLayer: null,
1880  center: null,
1881  resolution: null,
1882  zoom: 0,
1883  panRatio: 1.5,
1884  options: null,
1885  tileSize: null,
1886  projection: "EPSG:4326",
1887  units: null,
1888  resolutions: null,
1889  maxResolution: null,
1890  minResolution: null,
1891  maxScale: null,
1892  minScale: null,
1893  maxExtent: null,
1894  minExtent: null,
1895  restrictedExtent: null,
1896  numZoomLevels: 16,
1897  theme: null,
1898  displayProjection: null,
1899  fallThrough: !1,
1900  autoUpdateSize: !0,
1901  eventListeners: null,
1902  panTween: null,
1903  panMethod: OpenLayers.Easing.Expo.easeOut,
1904  panDuration: 50,
1905  zoomTween: null,
1906  zoomMethod: OpenLayers.Easing.Quad.easeOut,
1907  zoomDuration: 20,
1908  paddingForPopups: null,
1909  layerContainerOriginPx: null,
1910  minPx: null,
1911  maxPx: null,
1912  initialize: function (a, b) {
1913      1 === arguments.length && "object" === typeof a && (a = (b = a) && b.div);
1914      this.tileSize = new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH, OpenLayers.Map.TILE_HEIGHT);
1915      this.paddingForPopups = new OpenLayers.Bounds(15, 15, 15, 15);
1916      this.theme = OpenLayers._getScriptLocation() + "theme/default/style.css";
1917      this.options = OpenLayers.Util.extend({}, b);
1918      OpenLayers.Util.extend(this, b);
1919      OpenLayers.Util.applyDefaults(this, OpenLayers.Projection.defaults[this.projection instanceof OpenLayers.Projection ? this.projection.projCode : this.projection]);
1920      !this.maxExtent || this.maxExtent instanceof OpenLayers.Bounds || (this.maxExtent = new OpenLayers.Bounds(this.maxExtent));
1921      !this.minExtent || this.minExtent instanceof OpenLayers.Bounds || (this.minExtent = new OpenLayers.Bounds(this.minExtent));
1922      !this.restrictedExtent || this.restrictedExtent instanceof OpenLayers.Bounds || (this.restrictedExtent = new OpenLayers.Bounds(this.restrictedExtent));
1923      !this.center || this.center instanceof OpenLayers.LonLat || (this.center = new OpenLayers.LonLat(this.center));
1924      this.layers = [];
1925      this.id = OpenLayers.Util.createUniqueID("OpenLayers.Map_");
1926      this.div = OpenLayers.Util.getElement(a);
1927      this.div || ((this.div = document.createElement("div")), (this.div.style.height = "1px"), (this.div.style.width = "1px"));
1928      OpenLayers.Element.addClass(this.div, "olMap");
1929      var c = this.id + "_OpenLayers_ViewPort";
1930      this.viewPortDiv = OpenLayers.Util.createDiv(c, null, null, null, "relative", null, "hidden");
1931      this.viewPortDiv.style.width = "100%";
1932      this.viewPortDiv.style.height = "100%";
1933      this.viewPortDiv.className = "olMapViewport";
1934      this.div.appendChild(this.viewPortDiv);
1935      this.events = new OpenLayers.Events(this, this.viewPortDiv, null, this.fallThrough, { includeXY: !0 });
1936      OpenLayers.TileManager && null !== this.tileManager && (this.tileManager instanceof OpenLayers.TileManager || (this.tileManager = new OpenLayers.TileManager(this.tileManager)), this.tileManager.addMap(this));
1937      c = this.id + "_OpenLayers_Container";
1938      this.layerContainerDiv = OpenLayers.Util.createDiv(c);
1939      this.layerContainerDiv.style.zIndex = this.Z_INDEX_BASE.Popup - 1;
1940      this.layerContainerOriginPx = { x: 0, y: 0 };
1941      this.applyTransform();
1942      this.viewPortDiv.appendChild(this.layerContainerDiv);
1943      this.updateSize();
1944      if (this.eventListeners instanceof Object) this.events.on(this.eventListeners);
1945      !0 === this.autoUpdateSize && ((this.updateSizeDestroy = OpenLayers.Function.bind(this.updateSize, this)), OpenLayers.Event.observe(window, "resize", this.updateSizeDestroy));
1946      if (this.theme) {
1947          for (var c = !0, d = document.getElementsByTagName("link"), e = 0, f = d.length; e < f; ++e)
1948              if (OpenLayers.Util.isEquivalentUrl(d.item(e).href, this.theme)) {
1949                  c = !1;
1950                  break;
1951              }
1952          c && ((c = document.createElement("link")), c.setAttribute("rel", "stylesheet"), c.setAttribute("type", "text/css"), c.setAttribute("href", this.theme), document.getElementsByTagName("head")[0].appendChild(c));
1953      }
1954      null == this.controls &&
1955          ((this.controls = []),
1956          null != OpenLayers.Control &&
1957              (OpenLayers.Control.Navigation ? this.controls.push(new OpenLayers.Control.Navigation()) : OpenLayers.Control.TouchNavigation && this.controls.push(new OpenLayers.Control.TouchNavigation()),
1958              OpenLayers.Control.Zoom ? this.controls.push(new OpenLayers.Control.Zoom()) : OpenLayers.Control.PanZoom && this.controls.push(new OpenLayers.Control.PanZoom()),
1959              OpenLayers.Control.ArgParser && this.controls.push(new OpenLayers.Control.ArgParser()),
1960              OpenLayers.Control.Attribution && this.controls.push(new OpenLayers.Control.Attribution())));
1961      e = 0;
1962      for (f = this.controls.length; e < f; e++) this.addControlToMap(this.controls[e]);
1963      this.popups = [];
1964      this.unloadDestroy = OpenLayers.Function.bind(this.destroy, this);
1965      OpenLayers.Event.observe(window, "unload", this.unloadDestroy);
1966      b && b.layers && (delete this.center, delete this.zoom, this.addLayers(b.layers), b.center && !this.getCenter() && this.setCenter(b.center, b.zoom));
1967      this.panMethod && (this.panTween = new OpenLayers.Tween(this.panMethod));
1968      this.zoomMethod && this.applyTransform.transform && (this.zoomTween = new OpenLayers.Tween(this.zoomMethod));
1969  },
1970  getViewport: function () {
1971      return this.viewPortDiv;
1972  },
1973  render: function (a) {
1974      this.div = OpenLayers.Util.getElement(a);
1975      OpenLayers.Element.addClass(this.div, "olMap");
1976      this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
1977      this.div.appendChild(this.viewPortDiv);
1978      this.updateSize();
1979  },
1980  unloadDestroy: null,
1981  updateSizeDestroy: null,
1982  destroy: function () {
1983      if (!this.unloadDestroy) return !1;
1984      this.panTween && (this.panTween.stop(), (this.panTween = null));
1985      this.zoomTween && (this.zoomTween.stop(), (this.zoomTween = null));
1986      OpenLayers.Event.stopObserving(window, "unload", this.unloadDestroy);
1987      this.unloadDestroy = null;
1988      this.updateSizeDestroy && OpenLayers.Event.stopObserving(window, "resize", this.updateSizeDestroy);
1989      this.paddingForPopups = null;
1990      if (null != this.controls) {
1991          for (var a = this.controls.length - 1; 0 <= a; --a) this.controls[a].destroy();
1992          this.controls = null;
1993      }
1994      if (null != this.layers) {
1995          for (a = this.layers.length - 1; 0 <= a; --a) this.layers[a].destroy(!1);
1996          this.layers = null;
1997      }
1998      this.viewPortDiv && this.viewPortDiv.parentNode && this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
1999      this.viewPortDiv = null;
2000      this.tileManager && (this.tileManager.removeMap(this), (this.tileManager = null));
2001      this.eventListeners && (this.events.un(this.eventListeners), (this.eventListeners = null));
2002      this.events.destroy();
2003      this.options = this.events = null;
2004  },
2005  setOptions: function (a) {
2006      var b = this.minPx && a.restrictedExtent != this.restrictedExtent;
2007      OpenLayers.Util.extend(this, a);
2008      b && this.moveTo(this.getCachedCenter(), this.zoom, { forceZoomChange: !0 });
2009  },
2010  getTileSize: function () {
2011      return this.tileSize;
2012  },
2013  getBy: function (a, b, c) {
2014      var d = "function" == typeof c.test;
2015      return OpenLayers.Array.filter(this[a], function (a) {
2016          return a[b] == c || (d && c.test(a[b]));
2017      });
2018  },
2019  getLayersBy: function (a, b) {
2020      return this.getBy("layers", a, b);
2021  },
2022  getLayersByName: function (a) {
2023      return this.getLayersBy("name", a);
2024  },
2025  getLayersByClass: function (a) {
2026      return this.getLayersBy("CLASS_NAME", a);
2027  },
2028  getControlsBy: function (a, b) {
2029      return this.getBy("controls", a, b);
2030  },
2031  getControlsByClass: function (a) {
2032      return this.getControlsBy("CLASS_NAME", a);
2033  },
2034  getLayer: function (a) {
2035      for (var b = null, c = 0, d = this.layers.length; c < d; c++) {
2036          var e = this.layers[c];
2037          if (e.id == a) {
2038              b = e;
2039              break;
2040          }
2041      }
2042      return b;
2043  },
2044  setLayerZIndex: function (a, b) {
2045      a.setZIndex(this.Z_INDEX_BASE[a.isBaseLayer ? "BaseLayer" : "Overlay"] + 5 * b);
2046  },
2047  resetLayersZIndex: function () {
2048      for (var a = 0, b = this.layers.length; a < b; a++) this.setLayerZIndex(this.layers[a], a);
2049  },
2050  addLayer: function (a) {
2051      for (var b = 0, c = this.layers.length; b < c; b++) if (this.layers[b] == a) return !1;
2052      if (!1 === this.events.triggerEvent("preaddlayer", { layer: a })) return !1;
2053      this.allOverlays && (a.isBaseLayer = !1);
2054      a.div.className = "olLayerDiv";
2055      a.div.style.overflow = "";
2056      this.setLayerZIndex(a, this.layers.length);
2057      a.isFixed ? this.viewPortDiv.appendChild(a.div) : this.layerContainerDiv.appendChild(a.div);
2058      this.layers.push(a);
2059      a.setMap(this);
2060      a.isBaseLayer || (this.allOverlays && !this.baseLayer) ? (null == this.baseLayer ? this.setBaseLayer(a) : a.setVisibility(!1)) : a.redraw();
2061      this.events.triggerEvent("addlayer", { layer: a });
2062      a.events.triggerEvent("added", { map: this, layer: a });
2063      a.afterAdd();
2064      return !0;
2065  },
2066  addLayers: function (a) {
2067      for (var b = 0, c = a.length; b < c; b++) this.addLayer(a[b]);
2068  },
2069  removeLayer: function (a, b) {
2070      if (!1 !== this.events.triggerEvent("preremovelayer", { layer: a })) {
2071          null == b && (b = !0);
2072          a.isFixed ? this.viewPortDiv.removeChild(a.div) : this.layerContainerDiv.removeChild(a.div);
2073          OpenLayers.Util.removeItem(this.layers, a);
2074          a.removeMap(this);
2075          a.map = null;
2076          if (this.baseLayer == a && ((this.baseLayer = null), b))
2077              for (var c = 0, d = this.layers.length; c < d; c++) {
2078                  var e = this.layers[c];
2079                  if (e.isBaseLayer || this.allOverlays) {
2080                      this.setBaseLayer(e);
2081                      break;
2082                  }
2083              }
2084          this.resetLayersZIndex();
2085          this.events.triggerEvent("removelayer", { layer: a });
2086          a.events.triggerEvent("removed", { map: this, layer: a });
2087      }
2088  },
2089  getNumLayers: function () {
2090      return this.layers.length;
2091  },
2092  getLayerIndex: function (a) {
2093      return OpenLayers.Util.indexOf(this.layers, a);
2094  },
2095  setLayerIndex: function (a, b) {
2096      var c = this.getLayerIndex(a);
2097      0 > b ? (b = 0) : b > this.layers.length && (b = this.layers.length);
2098      if (c != b) {
2099          this.layers.splice(c, 1);
2100          this.layers.splice(b, 0, a);
2101          for (var c = 0, d = this.layers.length; c < d; c++) this.setLayerZIndex(this.layers[c], c);
2102          this.events.triggerEvent("changelayer", { layer: a, property: "order" });
2103          this.allOverlays && (0 === b ? this.setBaseLayer(a) : this.baseLayer !== this.layers[0] && this.setBaseLayer(this.layers[0]));
2104      }
2105  },
2106  raiseLayer: function (a, b) {
2107      var c = this.getLayerIndex(a) + b;
2108      this.setLayerIndex(a, c);
2109  },
2110  setBaseLayer: function (a) {
2111      if (a != this.baseLayer && -1 != OpenLayers.Util.indexOf(this.layers, a)) {
2112          var b = this.getCachedCenter(),
2113              c = OpenLayers.Util.getResolutionFromScale(this.getScale(), a.units);
2114          null == this.baseLayer || this.allOverlays || this.baseLayer.setVisibility(!1);
2115          this.baseLayer = a;
2116          if (!this.allOverlays || this.baseLayer.visibility) this.baseLayer.setVisibility(!0), !1 === this.baseLayer.inRange && this.baseLayer.redraw();
2117          null != b && ((a = this.getZoomForResolution(c || this.resolution, !0)), this.setCenter(b, a, !1, !0));
2118          this.events.triggerEvent("changebaselayer", { layer: this.baseLayer });
2119      }
2120  },
2121  addControl: function (a, b) {
2122      this.controls.push(a);
2123      this.addControlToMap(a, b);
2124  },
2125  addControls: function (a, b) {
2126      for (var c = 1 === arguments.length ? [] : b, d = 0, e = a.length; d < e; d++) this.addControl(a[d], c[d] ? c[d] : null);
2127  },
2128  addControlToMap: function (a, b) {
2129      a.outsideViewport = null != a.div;
2130      this.displayProjection && !a.displayProjection && (a.displayProjection = this.displayProjection);
2131      a.setMap(this);
2132      var c = a.draw(b);
2133      c && !a.outsideViewport && ((c.style.zIndex = this.Z_INDEX_BASE.Control + this.controls.length), this.viewPortDiv.appendChild(c));
2134      a.autoActivate && a.activate();
2135  },
2136  getControl: function (a) {
2137      for (var b = null, c = 0, d = this.controls.length; c < d; c++) {
2138          var e = this.controls[c];
2139          if (e.id == a) {
2140              b = e;
2141              break;
2142          }
2143      }
2144      return b;
2145  },
2146  removeControl: function (a) {
2147      a && a == this.getControl(a.id) && (a.div && a.div.parentNode == this.viewPortDiv && this.viewPortDiv.removeChild(a.div), OpenLayers.Util.removeItem(this.controls, a));
2148  },
2149  addPopup: function (a, b) {
2150      if (b) for (var c = this.popups.length - 1; 0 <= c; --c) this.removePopup(this.popups[c]);
2151      a.map = this;
2152      this.popups.push(a);
2153      if ((c = a.draw())) (c.style.zIndex = this.Z_INDEX_BASE.Popup + this.popups.length), this.layerContainerDiv.appendChild(c);
2154  },
2155  removePopup: function (a) {
2156      OpenLayers.Util.removeItem(this.popups, a);
2157      if (a.div)
2158          try {
2159              this.layerContainerDiv.removeChild(a.div);
2160          } catch (b) {}
2161      a.map = null;
2162  },
2163  getSize: function () {
2164      var a = null;
2165      null != this.size && (a = this.size.clone());
2166      return a;
2167  },
2168  updateSize: function () {
2169      var a = this.getCurrentSize();
2170      if (a && !isNaN(a.h) && !isNaN(a.w)) {
2171          this.events.clearMouseCache();
2172          var b = this.getSize();
2173          null == b && (this.size = b = a);
2174          if (!a.equals(b)) {
2175              this.size = a;
2176              a = 0;
2177              for (b = this.layers.length; a < b; a++) this.layers[a].onMapResize();
2178              a = this.getCachedCenter();
2179              null != this.baseLayer && null != a && ((b = this.getZoom()), (this.zoom = null), this.setCenter(a, b));
2180          }
2181      }
2182      this.events.triggerEvent("updatesize");
2183  },
2184  getCurrentSize: function () {
2185      var a = new OpenLayers.Size(this.div.clientWidth, this.div.clientHeight);
2186      if ((0 == a.w && 0 == a.h) || (isNaN(a.w) && isNaN(a.h))) (a.w = this.div.offsetWidth), (a.h = this.div.offsetHeight);
2187      if ((0 == a.w && 0 == a.h) || (isNaN(a.w) && isNaN(a.h))) (a.w = parseInt(this.div.style.width)), (a.h = parseInt(this.div.style.height));
2188      return a;
2189  },
2190  calculateBounds: function (a, b) {
2191      var c = null;
2192      null == a && (a = this.getCachedCenter());
2193      null == b && (b = this.getResolution());
2194      if (null != a && null != b)
2195          var c = (this.size.w * b) / 2,
2196              d = (this.size.h * b) / 2,
2197              c = new OpenLayers.Bounds(a.lon - c, a.lat - d, a.lon + c, a.lat + d);
2198      return c;
2199  },
2200  getCenter: function () {
2201      var a = null,
2202          b = this.getCachedCenter();
2203      b && (a = b.clone());
2204      return a;
2205  },
2206  getCachedCenter: function () {
2207      !this.center && this.size && (this.center = this.getLonLatFromViewPortPx({ x: this.size.w / 2, y: this.size.h / 2 }));
2208      return this.center;
2209  },
2210  getZoom: function () {
2211      return this.zoom;
2212  },
2213  pan: function (a, b, c) {
2214      c = OpenLayers.Util.applyDefaults(c, { animate: !0, dragging: !1 });
2215      if (c.dragging) (0 == a && 0 == b) || this.moveByPx(a, b);
2216      else {
2217          var d = this.getViewPortPxFromLonLat(this.getCachedCenter());
2218          a = d.add(a, b);
2219          if (this.dragging || !a.equals(d)) (d = this.getLonLatFromViewPortPx(a)), c.animate ? this.panTo(d) : (this.moveTo(d), this.dragging && ((this.dragging = !1), this.events.triggerEvent("moveend")));
2220      }
2221  },
2222  panTo: function (a) {
2223      if (this.panTween && this.getExtent().scale(this.panRatio).containsLonLat(a)) {
2224          var b = this.getCachedCenter();
2225          if (!a.equals(b)) {
2226              var b = this.getPixelFromLonLat(b),
2227                  c = this.getPixelFromLonLat(a),
2228                  d = 0,
2229                  e = 0;
2230              this.panTween.start({ x: 0, y: 0 }, { x: c.x - b.x, y: c.y - b.y }, this.panDuration, {
2231                  callbacks: {
2232                      eachStep: OpenLayers.Function.bind(function (a) {
2233                          this.moveByPx(a.x - d, a.y - e);
2234                          d = Math.round(a.x);
2235                          e = Math.round(a.y);
2236                      }, this),
2237                      done: OpenLayers.Function.bind(function (b) {
2238                          this.moveTo(a);
2239                          this.dragging = !1;
2240                          this.events.triggerEvent("moveend");
2241                      }, this),
2242                  },
2243              });
2244          }
2245      } else this.setCenter(a);
2246  },
2247  setCenter: function (a, b, c, d) {
2248      this.panTween && this.panTween.stop();
2249      this.zoomTween && this.zoomTween.stop();
2250      this.moveTo(a, b, { dragging: c, forceZoomChange: d });
2251  },
2252  moveByPx: function (a, b) {
2253      var c = this.size.w / 2,
2254          d = this.size.h / 2,
2255          e = c + a,
2256          f = d + b,
2257          g = this.baseLayer.wrapDateLine,
2258          h = 0,
2259          k = 0;
2260      this.restrictedExtent && ((h = c), (k = d), (g = !1));
2261      a = g || (e <= this.maxPx.x - h && e >= this.minPx.x + h) ? Math.round(a) : 0;
2262      b = f <= this.maxPx.y - k && f >= this.minPx.y + k ? Math.round(b) : 0;
2263      if (a || b) {
2264          this.dragging || ((this.dragging = !0), this.events.triggerEvent("movestart"));
2265          this.center = null;
2266          a && ((this.layerContainerOriginPx.x -= a), (this.minPx.x -= a), (this.maxPx.x -= a));
2267          b && ((this.layerContainerOriginPx.y -= b), (this.minPx.y -= b), (this.maxPx.y -= b));
2268          this.applyTransform();
2269          d = 0;
2270          for (e = this.layers.length; d < e; ++d) (c = this.layers[d]), c.visibility && (c === this.baseLayer || c.inRange) && (c.moveByPx(a, b), c.events.triggerEvent("move"));
2271          this.events.triggerEvent("move");
2272      }
2273  },
2274  adjustZoom: function (a) {
2275      if (this.baseLayer && this.baseLayer.wrapDateLine) {
2276          var b = this.baseLayer.resolutions,
2277              c = this.getMaxExtent().getWidth() / this.size.w;
2278          if (this.getResolutionForZoom(a) > c)
2279              if (this.fractionalZoom) a = this.getZoomForResolution(c);
2280              else
2281                  for (var d = a | 0, e = b.length; d < e; ++d)
2282                      if (b[d] <= c) {
2283                          a = d;
2284                          break;
2285                      }
2286      }
2287      return a;
2288  },
2289  getMinZoom: function () {
2290      return this.adjustZoom(0);
2291  },
2292  moveTo: function (a, b, c) {
2293      null == a || a instanceof OpenLayers.LonLat || (a = new OpenLayers.LonLat(a));
2294      c || (c = {});
2295      null != b && ((b = parseFloat(b)), this.fractionalZoom || (b = Math.round(b)));
2296      var d = b;
2297      b = this.adjustZoom(b);
2298      b !== d && (a = this.getCenter());
2299      var d = c.dragging || this.dragging,
2300          e = c.forceZoomChange;
2301      this.getCachedCenter() || this.isValidLonLat(a) || ((a = this.maxExtent.getCenterLonLat()), (this.center = a.
2301clone()));
2302      if (null != this.restrictedExtent) {
2303          null == a && (a = this.center);
2304          null == b && (b = this.getZoom());
2305          var f = this.getResolutionForZoom(b),
2306              f = this.calculateBounds(a, f);
2307          if (!this.restrictedExtent.containsBounds(f)) {
2308              var g = this.restrictedExtent.getCenterLonLat();
2309              f.getWidth() > this.restrictedExtent.getWidth()
2310                  ? (a = new OpenLayers.LonLat(g.lon, a.lat))
2311                  : f.left < this.restrictedExtent.left
2312                  ? (a = a.add(this.restrictedExtent.left - f.left, 0))
2313                  : f.right > this.restrictedExtent.right && (a = a.add(this.restrictedExtent.right - f.right, 0));
2314              f.getHeight() > this.restrictedExtent.getHeight()
2315                  ? (a = new OpenLayers.LonLat(a.lon, g.lat))
2316                  : f.bottom < this.restrictedExtent.bottom
2317                  ? (a = a.add(0, this.restrictedExtent.bottom - f.bottom))
2318                  : f.top > this.restrictedExtent.top && (a = a.add(0, this.restrictedExtent.top - f.top));
2319          }
2320      }
2321      e = e || (this.isValidZoomLevel(b) && b != this.getZoom());
2322      f = this.isValidLonLat(a) && !a.equals(this.center);
2323      if (e || f || d) {
2324          d || this.events.triggerEvent("movestart", { zoomChanged: e });
2325          f && (!e && this.center && this.centerLayerContainer(a), (this.center = a.clone()));
2326          a = e ? this.getResolutionForZoom(b) : this.getResolution();
2327          if (e || null == this.layerContainerOrigin) {
2328              this.layerContainerOrigin = this.getCachedCenter();
2329              this.layerContainerOriginPx.x = 0;
2330              this.layerContainerOriginPx.y = 0;
2331              this.applyTransform();
2332              var f = this.getMaxExtent({ restricted: !0 }),
2333                  h = f.getCenterLonLat(),
2334                  g = this.center.lon - h.lon,
2335                  h = h.lat - this.center.lat,
2336                  k = Math.round(f.getWidth() / a),
2337                  l = Math.round(f.getHeight() / a);
2338              this.minPx = { x: (this.size.w - k) / 2 - g / a, y: (this.size.h - l) / 2 - h / a };
2339              this.maxPx = { x: this.minPx.x + Math.round(f.getWidth() / a), y: this.minPx.y + Math.round(f.getHeight() / a) };
2340          }
2341          e && ((this.zoom = b), (this.resolution = a));
2342          a = this.getExtent();
2343          this.baseLayer.visibility && (this.baseLayer.moveTo(a, e, c.dragging), c.dragging || this.baseLayer.events.triggerEvent("moveend", { zoomChanged: e }));
2344          a = this.baseLayer.getExtent();
2345          for (b = this.layers.length - 1; 0 <= b; --b)
2346              (f = this.layers[b]),
2347                  f === this.baseLayer ||
2348                      f.isBaseLayer ||
2349                      ((g = f.calculateInRange()),
2350                      f.inRange != g && ((f.inRange = g) || f.display(!1), this.events.triggerEvent("changelayer", { layer: f, property: "visibility" })),
2351                      g && f.visibility && (f.moveTo(a, e, c.dragging), c.dragging || f.events.triggerEvent("moveend", { zoomChanged: e })));
2352          this.events.triggerEvent("move");
2353          d || this.events.triggerEvent("moveend");
2354          if (e) {
2355              b = 0;
2356              for (c = this.popups.length; b < c; b++) this.popups[b].updatePosition();
2357              this.events.triggerEvent("zoomend");
2358          }
2359      }
2360  },
2361  centerLayerContainer: function (a) {
2362      var b = this.getViewPortPxFromLonLat(this.layerContainerOrigin),
2363          c = this.getViewPortPxFromLonLat(a);
2364      if (null != b && null != c) {
2365          var d = this.layerContainerOriginPx.x;
2366          a = this.layerContainerOriginPx.y;
2367          var e = Math.round(b.x - c.x),
2368              b = Math.round(b.y - c.y);
2369          this.applyTransform((this.layerContainerOriginPx.x = e), (this.layerContainerOriginPx.y = b));
2370          d -= e;
2371          a -= b;
2372          this.minPx.x -= d;
2373          this.maxPx.x -= d;
2374          this.minPx.y -= a;
2375          this.maxPx.y -= a;
2376      }
2377  },
2378  isValidZoomLevel: function (a) {
2379      return null != a && 0 <= a && a < this.getNumZoomLevels();
2380  },
2381  isValidLonLat: function (a) {
2382      var b = !1;
2383      null != a && ((b = this.getMaxExtent()), (b = b.containsLonLat(a, { worldBounds: this.baseLayer.wrapDateLine && b })));
2384      return b;
2385  },
2386  getProjection: function () {
2387      var a = this.getProjectionObject();
2388      return a ? a.getCode() : null;
2389  },
2390  getProjectionObject: function () {
2391      var a = null;
2392      null != this.baseLayer && (a = this.baseLayer.projection);
2393      return a;
2394  },
2395  getMaxResolution: function () {
2396      var a = null;
2397      null != this.baseLayer && (a = this.baseLayer.maxResolution);
2398      return a;
2399  },
2400  getMaxExtent: function (a) {
2401      var b = null;
2402      a && a.restricted && this.restrictedExtent ? (b = this.restrictedExtent) : null != this.baseLayer && (b = this.baseLayer.maxExtent);
2403      return b;
2404  },
2405  getNumZoomLevels: function () {
2406      var a = null;
2407      null != this.baseLayer && (a = this.baseLayer.numZoomLevels);
2408      return a;
2409  },
2410  getExtent: function () {
2411      var a = null;
2412      null != this.baseLayer && (a = this.baseLayer.getExtent());
2413      return a;
2414  },
2415  getResolution: function () {
2416      var a = null;
2417      null != this.baseLayer ? (a = this.baseLayer.getResolution()) : !0 === this.allOverlays && 0 < this.layers.length && (a = this.layers[0].getResolution());
2418      return a;
2419  },
2420  getUnits: function () {
2421      var a = null;
2422      null != this.baseLayer && (a = this.baseLayer.units);
2423      return a;
2424  },
2425  getScale: function () {
2426      var a = null;
2427      null != this.baseLayer && ((a = this.getResolution()), (a = OpenLayers.Util.getScaleFromResolution(a, this.baseLayer.units)));
2428      return a;
2429  },
2430  getZoomForExtent: function (a, b) {
2431      var c = null;
2432      null != this.baseLayer && (c = this.baseLayer.getZoomForExtent(a, b));
2433      return c;
2434  },
2435  getResolutionForZoom: function (a) {
2436      var b = null;
2437      this.baseLayer && (b = this.baseLayer.getResolutionForZoom(a));
2438      return b;
2439  },
2440  getZoomForResolution: function (a, b) {
2441      var c = null;
2442      null != this.baseLayer && (c = this.baseLayer.getZoomForResolution(a, b));
2443      return c;
2444  },
2445  zoomTo: function (a, b) {
2446      var c = this;
2447      if (c.isValidZoomLevel(a))
2448          if ((c.baseLayer.wrapDateLine && (a = c.adjustZoom(a)), c.zoomTween)) {
2449              var d = c.getResolution(),
2450                  e = c.getResolutionForZoom(a),
2451                  f = { scale: 1 },
2452                  d = { scale: d / e };
2453              c.zoomTween.playing && c.zoomTween.duration < 3 * c.zoomDuration
2454                  ? (c.zoomTween.finish = { scale: c.zoomTween.finish.scale * d.scale })
2455                  : (b || ((e = c.getSize()), (b = { x: e.w / 2, y: e.h / 2 })),
2456                    c.zoomTween.start(f, d, c.zoomDuration, {
2457                        minFrameRate: 50,
2458                        callbacks: {
2459                            eachStep: function (a) {
2460                                var d = c.layerContainerOriginPx;
2461                                a = a.scale;
2462                                c.applyTransform(d.x + (((a - 1) * (d.x - b.x)) | 0), d.y + (((a - 1) * (d.y - b.y)) | 0), a);
2463                            },
2464                            done: function (a) {
2465                                c.applyTransform();
2466                                a = c.getResolution() / a.scale;
2467                                var d = c.getZoomForResolution(a, !0);
2468                                c.moveTo(c.getZoomTargetCenter(b, a), d, !0);
2469                            },
2470                        },
2471                    }));
2472          } else (f = b ? c.getZoomTargetCenter(b, c.getResolutionForZoom(a)) : null), c.setCenter(f, a);
2473  },
2474  zoomIn: function () {
2475      this.zoomTo(this.getZoom() + 1);
2476  },
2477  zoomOut: function () {
2478      this.zoomTo(this.getZoom() - 1);
2479  },
2480  zoomToExtent: function (a, b) {
2481      a instanceof OpenLayers.Bounds || (a = new OpenLayers.Bounds(a));
2482      var c = a.getCenterLonLat();
2483      if (this.baseLayer.wrapDateLine) {
2484          c = this.getMaxExtent();
2485          for (a = a.clone(); a.right < a.left; ) a.right += c.getWidth();
2486          c = a.getCenterLonLat().wrapDateLine(c);
2487      }
2488      this.setCenter(c, this.getZoomForExtent(a, b));
2489  },
2490  zoomToMaxExtent: function (a) {
2491      a = this.getMaxExtent({ restricted: a ? a.restricted : !0 });
2492      this.zoomToExtent(a);
2493  },
2494  zoomToScale: function (a, b) {
2495      var c = OpenLayers.Util.getResolutionFromScale(a, this.baseLayer.units),
2496          d = (this.size.w * c) / 2,
2497          c = (this.size.h * c) / 2,
2498          e = this.getCachedCenter(),
2499          d = new OpenLayers.Bounds(e.lon - d, e.lat - c, e.lon + d, e.lat + c);
2500      this.zoomToExtent(d, b);
2501  },
2502  getLonLatFromViewPortPx: function (a) {
2503      var b = null;
2504      null != this.baseLayer && (b = this.baseLayer.getLonLatFromViewPortPx(a));
2505      return b;
2506  },
2507  getViewPortPxFromLonLat: function (a) {
2508      var b = null;
2509      null != this.baseLayer && (b = this.baseLayer.getViewPortPxFromLonLat(a));
2510      return b;
2511  },
2512  getZoomTargetCenter: function (a, b) {
2513      var c = null,
2514          d = this.getSize(),
2515          e = d.w / 2 - a.x,
2516          d = a.y - d.h / 2,
2517          f = this.getLonLatFromPixel(a);
2518      f && (c = new OpenLayers.LonLat(f.lon + e * b, f.lat + d * b));
2519      return c;
2520  },
2521  getLonLatFromPixel: function (a) {
2522      return this.getLonLatFromViewPortPx(a);
2523  },
2524  getPixelFromLonLat: function (a) {
2525      a = this.getViewPortPxFromLonLat(a);
2526      a.x = Math.round(a.x);
2527      a.y = Math.round(a.y);
2528      return a;
2529  },
2530  getGeodesicPixelSize: function (a) {
2531      var b = a ? this.getLonLatFromPixel(a) : this.getCachedCenter() || new OpenLayers.LonLat(0, 0),
2532          c = this.getResolution();
2533      a = b.add(-c / 2, 0);
2534      var d = b.add(c / 2, 0),
2535          e = b.add(0, -c / 2),
2536          b = b.add(0, c / 2),
2537          c = new OpenLayers.Projection("EPSG:4326"),
2538          f = this.getProjectionObject() || c;
2539      f.equals(c) || (a.transform(f, c), d.transform(f, c), e.transform(f, c), b.transform(f, c));
2540      return new OpenLayers.Size(OpenLayers.Util.distVincenty(a, d), OpenLayers.Util.distVincenty(e, b));
2541  },
2542  getViewPortPxFromLayerPx: function (a) {
2543      var b = null;
2544      null != a && (b = a.add(this.layerContainerOriginPx.x, this.layerContainerOriginPx.y));
2545      return b;
2546  },
2547  getLayerPxFromViewPortPx: function (a) {
2548      var b = null;
2549      null != a && ((b = a.add(-this.layerContainerOriginPx.x, -this.layerContainerOriginPx.y)), isNaN(b.x) || isNaN(b.y)) && (b = null);
2550      return b;
2551  },
2552  getLonLatFromLayerPx: function (a) {
2553      a = this.getViewPortPxFromLayerPx(a);
2554      return this.getLonLatFromViewPortPx(a);
2555  },
2556  getLayerPxFromLonLat: function (a) {
2557      a = this.getPixelFromLonLat(a);
2558      return this.getLayerPxFromViewPortPx(a);
2559  },
2560  applyTransform: function (a, b, c) {
2561      c = c || 1;
2562      var d = this.layerContainerOriginPx,
2563          e = 1 !== c;
2564      a = a || d.x;
2565      b = b || d.y;
2566      var f = this.layerContainerDiv.style,
2567          g = this.applyTransform.transform,
2568          h = this.applyTransform.template;
2569      if (void 0 === g && ((g = OpenLayers.Util.vendorPrefix.style("transform")), (this.applyTransform.transform = g))) {
2570          var k = OpenLayers.Element.getStyle(this.viewPortDiv, OpenLayers.Util.vendorPrefix.css("transform"));
2571          (k && "none" === k) || ((h = ["translate3d(", ",0) ", "scale3d(", ",1)"]), (f[g] = [h[0], "0,0", h[1]].join("")));
2572          (h && ~f[g].indexOf(h[0])) || (h = ["translate(", ") ", "scale(", ")"]);
2573          this.applyTransform.template = h;
2574      }
2575      null === g || ("translate3d(" !== h[0] && !0 !== e)
2576          ? ((f.left = a + "px"), (f.top = b + "px"), null !== g && (f[g] = ""))
2577          : (!0 === e && "translate(" === h[0] && ((a -= d.x), (b -= d.y), (f.left = d.x + "px"), (f.top = d.y + "px")), (f[g] = [h[0], a, "px,", b, "px", h[1], h[2], c, ",", c, h[3]].join("")));
2578  },
2579  CLASS_NAME: "OpenLayers.Map",
2580});
2581OpenLayers.Map.TILE_WIDTH = 256;
2582OpenLayers.Map.TILE_HEIGHT = 256;
2583OpenLayers.Handler = OpenLayers.Class({
2584  id: null,
2585  control: null,
2586  map: null,
2587  keyMask: null,
2588  active: !1,
2589  evt: null,
2590  touch: !1,
2591  initialize: function (a, b, c) {
2592      OpenLayers.Util.extend(this, c);
2593      this.control = a;
2594      this.callbacks = b;
2595      (a = this.map || a.map) && this.setMap(a);
2596      this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
2597  },
2598  setMap: function (a) {
2599      this.map = a;
2600  },
2601  checkModifiers: function (a) {
2602      return null == this.keyMask
2603          ? !0
2604          : ((a.shiftKey ? OpenLayers.Handler.MOD_SHIFT : 0) | (a.ctrlKey ? OpenLayers.Handler.MOD_CTRL : 0) | (a.altKey ? OpenLayers.Handler.MOD_ALT : 0) | (a.metaKey ? OpenLayers.Handler.MOD_META : 0)) == this.keyMask;
2605  },
2606  activate: function () {
2607      if (this.active) return !1;
2608      for (var a = OpenLayers.Events.prototype.BROWSER_EVENTS, b = 0, c = a.length; b < c; b++) this[a[b]] && this.register(a[b], this[a[b]]);
2609      return (this.active = !0);
2610  },
2611  deactivate: function () {
2612      if (!this.active) return !1;
2613      for (var a = OpenLayers.Events.prototype.BROWSER_EVENTS, b = 0, c = a.length; b < c; b++) this[a[b]] && this.unregister(a[b], this[a[b]]);
2614      this.active = this.touch = !1;
2615      return !0;
2616  },
2617  startTouch: function () {
2618      if (!this.touch) {
2619          this.touch = !0;
2620          for (var a = "mousedown mouseup mousemove click dblclick mouseout".split(" "), b = 0, c = a.length; b < c; b++) this[a[b]] && this.unregister(a[b], this[a[b]]);
2621      }
2622  },
2623  callback: function (a, b) {
2624      a && this.callbacks[a] && this.callbacks[a].apply(this.control, b);
2625  },
2626  register: function (a, b) {
2627      this.map.events.registerPriority(a, this, b);
2628      this.map.events.registerPriority(a, this, this.setEvent);
2629  },
2630  unregister: function (a, b) {
2631      this.map.events.unregister(a, this, b);
2632      this.map.events.unregister(a, this, this.setEvent);
2633  },
2634  setEvent: function (a) {
2635      this.evt = a;
2636      return !0;
2637  },
2638  destroy: function () {
2639      this.deactivate();
2640      this.control = this.map = null;
2641  },
2642  CLASS_NAME: "OpenLayers.Handler",
2643});
2644OpenLayers.Handler.MOD_NONE = 0;
2645OpenLayers.Handler.MOD_SHIFT = 1;
2646OpenLayers.Handler.MOD_CTRL = 2;
2647OpenLayers.Handler.MOD_ALT = 4;
2648OpenLayers.Handler.MOD_META = 8;
2649OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
2650  delay: 300,
2651  single: !0,
2652  double: !1,
2653  pixelTolerance: 0,
2654  dblclickTolerance: 13,
2655  stopSingle: !1,
2656  stopDouble: !1,
2657  timerId: null,
2658  down: null,
2659  last: null,
2660  first: null,
2661  rightclickTimerId: null,
2662  touchstart: function (a) {
2663      this.startTouch();
2664      this.down = this.getEventInfo(a);
2665      this.last = this.getEventInfo(a);
2666      return !0;
2667  },
2668  touchmove: function (a) {
2669      this.last = this.getEventInfo(a);
2670      return !0;
2671  },
2672  touchend: function (a) {
2673      this.down && ((a.xy = this.last.xy), (a.lastTouches = this.last.touches), this.handleSingle(a), (this.down = null));
2674      return !0;
2675  },
2676  mousedown: function (a) {
2677      this.down = this.getEventInfo(a);
2678      this.last = this.getEventInfo(a);
2679      return !0;
2680  },
2681  mouseup: function (a) {
2682      var b = !0;
2683      this.checkModifiers(a) && this.control.handleRightClicks && OpenLayers.Event.isRightClick(a) && (b = this.rightclick(a));
2684      return b;
2685  },
2686  rightclick: function (a) {
2687      if (this.passesTolerance(a)) {
2688          if (null != this.rightclickTimerId) return this.clearTimer(), this.callback("dblrightclick", [a]), !this.stopDouble;
2689          a = this["double"] ? OpenLayers.Util.extend({}, a) : this.callback("rightclick", [a]);
2690          a = OpenLayers.Function.bind(this.delayedRightCall, this, a);
2691          this.rightclickTimerId = window.setTimeout(a, this.delay);
2692      }
2693      return !this.stopSingle;
2694  },
2695  delayedRightCall: function (a) {
2696      this.rightclickTimerId = null;
2697      a && this.callback("rightclick", [a]);
2698  },
2699  click: function (a) {
2700      this.last || (this.last = this.getEventInfo(a));
2701      this.handleSingle(a);
2702      return !this.stopSingle;
2703  },
2704  dblclick: function (a) {
2705      this.handleDouble(a);
2706      return !this.stopDouble;
2707  },
2708  handleDouble: function (a) {
2709      this.passesDblclickTolerance(a) && (this["double"] && this.callback("dblclick", [a]), this.clearTimer());
2710  },
2711  handleSingle: function (a) {
2712      this.passesTolerance(a) &&
2713          (null != this.timerId
2714              ? (this.last.touches && 1 === this.last.touches.length && (this["double"] && OpenLayers.Event.preventDefault(a), this.handleDouble(a)), (this.last.touches && 2 === this.last.touches.length) || this.clearTimer())
2715              : ((this.first = this.getEventInfo(a)), (a = this.single ? OpenLayers.Util.extend({}, a) : null), this.queuePotentialClick(a)));
2716  },
2717  queuePotentialClick: function (a) {
2718      this.timerId = window.setTimeout(OpenLayers.Function.bind(this.delayedCall, this, a), this.delay);
2719  },
2720  passesTolerance: function (a) {
2721      var b = !0;
2722      if (null != this.pixelTolerance && this.down && this.down.xy && (b = this.pixelTolerance >= this.down.xy.distanceTo(a.xy)) && this.touch && this.down.touches.length === this.last.touches.length) {
2723          a = 0;
2724          for (var c = this.down.touches.length; a < c; ++a)
2725              if (this.getTouchDistance(this.down.touches[a], this.last.touches[a]) > this.pixelTolerance) {
2726                  b = !1;
2727                  break;
2728              }
2729      }
2730      return b;
2731  },
2732  getTouchDistance: function (a, b) {
2733      return Math.sqrt(Math.pow(a.clientX - b.clientX, 2) + Math.pow(a.clientY - b.clientY, 2));
2734  },
2735  passesDblclickTolerance: function (a) {
2736      a = !0;
2737      this.down && this.first && (a = this.down.xy.distanceTo(this.first.xy) <= this.dblclickTolerance);
2738      return a;
2739  },
2740  clearTimer: function () {
2741      null != this.timerId && (window.clearTimeout(this.timerId), (this.timerId = null));
2742      null != this.rightclickTimerId && (window.clearTimeout(this.rightclickTimerId), (this.rightclickTimerId = null));
2743  },
2744  delayedCall: function (a) {
2745      this.timerId = null;
2746      a && this.callback("click", [a]);
2747  },
2748  getEventInfo: function (a) {
2749      var b;
2750      if (a.touches) {
2751          var c = a.touches.length;
2752          b = Array(c);
2753          for (var d, e = 0; e < c; e++) (d = a.touches[e]), (b[e] = { clientX: d.olClientX, clientY: d.olClientY });
2754      }
2755      return { xy: a.xy, touches: b };
2756  },
2757  deactivate: function () {
2758      var a = !1;
2759      OpenLayers.Handler.prototype.deactivate.apply(this, arguments) && (this.clearTimer(), (this.last = this.first = this.down = null), (a = !0));
2760      return a;
2761  },
2762  CLASS_NAME: "OpenLayers.Handler.Click",
2763});
2764OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
2765  started: !1,
2766  stopDown: !0,
2767  dragging: !1,
2768  last: null,
2769  start: null,
2770  lastMoveEvt: null,
2771  oldOnselectstart: null,
2772  interval: 0,
2773  timeoutId: null,
2774  documentDrag: !1,
2775  documentEvents: null,
2776  initialize: function (a, b, c) {
2777      OpenLayers.Handler.prototype.initialize.apply(this, arguments);
2778      if (!0 === this.documentDrag) {
2779          var d = this;
2780          this._docMove = function (a) {
2781              d.mousemove({ xy: { x: a.clientX, y: a.clientY }, element: document });
2782          };
2783          this._docUp = function (a) {
2784              d.mouseup({ xy: { x: a.clientX, y: a.clientY } });
2785          };
2786      }
2787  },
2788  dragstart: function (a) {
2789      var b = !0;
2790      this.dragging = !1;
2791      this.checkModifiers(a) && (OpenLayers.Event.isLeftClick(a) || OpenLayers.Event.isSingleTouch(a))
2792          ? ((this.started = !0),
2793            (this.last = this.start = a.xy),
2794            OpenLayers.Element.addClass(this.map.viewPortDiv, "olDragDown"),
2795            this.down(a),
2796            this.callback("down", [a.xy]),
2797            OpenLayers.Event.preventDefault(a),
2798            this.oldOnselectstart || (this.oldOnselectstart = document.onselectstart ? document.onselectstart : OpenLayers.Function.True),
2799            (document.onselectstart = OpenLayers.Function.False),
2800            (b = !this.stopDown))
2801          : ((this.started = !1), (this.last = this.start = null));
2802      return b;
2803  },
2804  dragmove: function (a) {
2805      this.lastMoveEvt = a;
2806      !this.started ||
2807          this.timeoutId ||
2808          (a.xy.x == this.last.x && a.xy.y == this.last.y) ||
2809          (!0 === this.documentDrag && this.documentEvents && (a.element === document ? (this.adjustXY(a), this.setEvent(a)) : this.removeDocumentEvents()),
2810          0 < this.interval && (this.timeoutId = setTimeout(OpenLayers.Function.bind(this.removeTimeout, this), this.interval)),
2811          (this.dragging = !0),
2812          this.move(a),
2813          this.callback("move", [a.xy]),
2814          this.oldOnselectstart || ((this.oldOnselectstart = document.onselectstart), (document.onselectstart = OpenLayers.Function.False)),
2815          (this.last = a.xy));
2816      return !0;
2817  },
2818  dragend: function (a) {
2819      if (this.started) {
2820          !0 === this.documentDrag && this.documentEvents && (this.adjustXY(a), this.removeDocumentEvents());
2821          var b = this.start != this.last;
2822          this.dragging = this.started = !1;
2823          OpenLayers.Element.removeClass(this.map.viewPortDiv, "olDragDown");
2824          this.up(a);
2825          this.callback("up", [a.xy]);
2826          b && this.callback("done", [a.xy]);
2827          document.onselectstart = this.oldOnselectstart;
2828      }
2829      return !0;
2830  },
2831  down: function (a) {},
2832  move: function (a) {},
2833  up: function (a) {},
2834  out: function (a) {},
2835  mousedown: function (a) {
2836      return this.dragstart(a);
2837  },
2838  touchstart: function (a) {
2839      this.startTouch();
2840      return this.dragstart(a);
2841  },
2842  mousemove: function (a) {
2843      return this.dragmove(a);
2844  },
2845  touchmove: function (a) {
2846      return this.dragmove(a);
2847  },
2848  removeTimeout: function () {
2849      this.timeoutId = null;
2850      this.dragging && this.mousemove(this.lastMoveEvt);
2851  },
2852  mouseup: function (a) {
2853      return this.dragend(a);
2854  },
2855  touchend: function (a) {
2856      a.xy = this.last;
2857      return this.dragend(a);
2858  },
2859  mouseout: function (a) {
2860      if (this.started && OpenLayers.Util.mouseLeft(a, this.map.viewPortDiv))
2861          if (!0 === this.documentDrag) this.addDocumentEvents();
2862          else {
2863              var b = this.start != this.last;
2864              this.dragging = this.started = !1;
2865              OpenLayers.Element.removeClass(this.map.viewPortDiv, "olDragDown");
2866              this.out(a);
2867              this.callback("out", []);
2868              b && this.callback("done", [a.xy]);
2869              document.onselectstart && (document.onselectstart = this.oldOnselectstart);
2870          }
2871      return !0;
2872  },
2873  click: function (a) {
2874      return this.start == this.last;
2875  },
2876  activate: function () {
2877      var a = !1;
2878      OpenLayers.Handler.prototype.activate.apply(this, arguments) && ((this.dragging = !1), (a = !0));
2879      return a;
2880  },
2881  deactivate: function () {
2882      var a = !1;
2883      OpenLayers.Handler.prototype.deactivate.apply(this, arguments) && ((this.dragging = this.started = !1), (this.last = this.start = null), (a = !0), OpenLayers.Element.removeClass(this.map.viewPortDiv, "olDragDown"));
2884      return a;
2885  },
2886  adjustXY: function (a) {
2887      var b = OpenLayers.Util.pagePosition(this.map.viewPortDiv);
2888      a.xy.x -= b[0];
2889      a.xy.y -= b[1];
2890  },
2891  addDocumentEvents: function () {
2892      OpenLayers.Element.addClass(document.body, "olDragDown");
2893      this.documentEvents = !0;
2894      OpenLayers.Event.observe(document, "mousemove", this._docMove);
2895      OpenLayers.Event.observe(document, "mouseup", this._docUp);
2896  },
2897  removeDocumentEvents: function () {
2898      OpenLayers.Element.removeClass(document.body, "olDragDown");
2899      this.documentEvents = !1;
2900      OpenLayers.Event.stopObserving(document, "mousemove", this._docMove);
2901      OpenLayers.Event.stopObserving(document, "mouseup", this._docUp);
2902  },
2903  CLASS_NAME: "OpenLayers.Handler.Drag",
2904});
2905OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
2906  element: null,
2907  ovmap: null,
2908  size: { w: 180, h: 90 },
2909  layers: null,
2910  minRectSize: 15,
2911  minRectDisplayClass: "RectReplacement",
2912  minRatio: 8,
2913  maxRatio: 32,
2914  mapOptions: null,
2915  autoPan: !1,
2916  handlers: null,
2917  resolutionFactor: 1,
2918  maximized: !1,
2919  maximizeTitle: "",
2920  minimizeTitle: "",
2921  initialize: function (a) {
2922      this.layers = [];
2923      this.handlers = {};
2924      OpenLayers.Control.prototype.initialize.apply(this, [a]);
2925  },
2926  destroy: function () {
2927      this.mapDiv &&
2928          (this.handlers.click && this.handlers.click.destroy(),
2929          this.handlers.drag && this.handlers.drag.destroy(),
2930          this.ovmap && this.ovmap.viewPortDiv.removeChild(this.extentRectangle),
2931          (this.extentRectangle = null),
2932          this.rectEvents && (this.rectEvents.destroy(), (this.rectEvents = null)),
2933          this.ovmap && (this.ovmap.destroy(), (this.ovmap = null)),
2934          this.element.removeChild(this.mapDiv),
2935          (this.mapDiv = null),
2936          this.div.removeChild(this.element),
2937          (this.element = null),
2938          this.maximizeDiv && (this.div.removeChild(this.maximizeDiv), (this.maximizeDiv = null)),
2939          this.minimizeDiv && (this.div.removeChild(this.minimizeDiv), (this.minimizeDiv = null)),
2940          this.map.events.un({ buttonclick: this.onButtonClick, moveend: this.update, changebaselayer: this.baseLayerDraw, scope: this }),
2941          OpenLayers.Control.prototype.destroy.apply(this, arguments));
2942  },
2943  draw: function () {
2944      OpenLayers.Control.prototype.draw.apply(this, arguments);
2945      if (0 === this.layers.length)
2946          if (this.map.baseLayer) this.layers = [this.map.baseLayer.clone()];
2947          else return this.map.events.register("changebaselayer", this, this.baseLayerDraw), this.div;
2948      this.element = document.createElement("div");
2949      this.element.className = this.displayClass + "Element";
2950      this.element.style.display = "none";
2951      this.mapDiv = document.createElement("div");
2952      this.mapDiv.style.width = this.size.w + "px";
2953      this.mapDiv.style.height = this.size.h + "px";
2954      this.mapDiv.style.position = "relative";
2955      this.mapDiv.style.overflow = "hidden";
2956      this.mapDiv.id = OpenLayers.Util.createUniqueID("overviewMap");
2957      this.extentRectangle = document.createElement("div");
2958      this.extentRectangle.style.position = "absolute";
2959      this.extentRectangle.style.zIndex = 1e3;
2960      this.extentRectangle.className = this.displayClass + "ExtentRectangle";
2961      this.element.appendChild(this.mapDiv);
2962      this.div.appendChild(this.element);
2963      if (this.outsideViewport) this.element.style.display = "";
2964      else {
2965          this.div.className += " " + this.displayClass + "Container";
2966          var a = OpenLayers.Util.getImageLocation("layer-switcher-maximize.png");
2967          this.maximizeDiv = OpenLayers.Util.createAlphaImageDiv(this.displayClass + "MaximizeButton", null, null, a, "absolute");
2968          this.maximizeDiv.style.display = "none";
2969          this.maximizeDiv.className = this.displayClass + "MaximizeButton olButton";
2970          this.maximizeTitle && (this.maximizeDiv.title = this.maximizeTitle);
2971          this.div.appendChild(this.maximizeDiv);
2972          a = OpenLayers.Util.getImageLocation("layer-switcher-minimize.png");
2973          this.minimizeDiv = OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv", null, null, a, "absolute");
2974          this.minimizeDiv.style.display = "none";
2975          this.minimizeDiv.className = this.displayClass + "MinimizeButton olButton";
2976          this.minimizeTitle && (this.minimizeDiv.title = this.minimizeTitle);
2977          this.div.appendChild(this.minimizeDiv);
2978          this.minimizeControl();
2979      }
2980      this.map.getExtent() && this.update();
2981      this.map.events.on({ buttonclick: this.onButtonClick, moveend: this.update, scope: this });
2982      this.maximized && this.maximizeControl();
2983      return this.div;
2984  },
2985  baseLayerDraw: function () {
2986      this.draw();
2987      this.map.events.unregister("changebaselayer", this, this.baseLayerDraw);
2988  },
2989  rectDrag: function (a) {
2990      var b = this.handlers.drag.last.x - a.x,
2991          c = this.handlers.drag.last.y - a.y;
2992      if (0 != b || 0 != c) {
2993          var d = this.rectPxBounds.top,
2994              e = this.rectPxBounds.left;
2995          a = Math.abs(this.rectPxBounds.getHeight());
2996          var f = this.rectPxBounds.getWidth(),
2997              c = Math.max(0, d - c),
2998              c = Math.min(c, this.ovmap.size.h - this.hComp - a),
2999              b = Math.max(0, e - b),
3000              b = Math.min(b, this.ovmap.size.w - this.wComp - f);
3001          this.setRectPxBounds(new OpenLayers.Bounds(b, c + a, b + f, c));
3002      }
3003  },
3004  mapDivClick: function (a) {
3005      var b = this.rectPxBounds.getCenterPixel(),
3006          c = a.xy.x - b.x,
3007          d = a.xy.y - b.y,
3008          e = this.rectPxBounds.top,
3009          f = this.rectPxBounds.left;
3010      a = Math.abs(this.rectPxBounds.getHeight());
3011      b = this.rectPxBounds.getWidth();
3012      d = Math.max(0, e + d);
3013      d = Math.min(d, this.ovmap.size.h - a);
3014      c = Math.max(0, f + c);
3015      c = Math.min(c, this.ovmap.size.w - b);
3016      this.setRectPxBounds(new OpenLayers.Bounds(c, d + a, c + b, d));
3017      this.updateMapToRect();
3018  },
3019  onButtonClick: function (a) {
3020      a.buttonElement === this.minimizeDiv ? this.minimizeControl() : a.buttonElement === this.maximizeDiv && this.maximizeControl();
3021  },
3022  maximizeControl: function (a) {
3023      this.element.style.display = "";
3024      this.showToggle(!1);
3025      null != a && OpenLayers.Event.stop(a);
3026  },
3027  minimizeControl: function (a) {
3028      this.element.style.display = "none";
3029      this.showToggle(!0);
3030      null != a && OpenLayers.Event.stop(a);
3031  },
3032  showToggle: function (a) {
3033      this.maximizeDiv && (this.maximizeDiv.style.display = a ? "" : "none");
3034      this.minimizeDiv && (this.minimizeDiv.style.display = a ? "none" : "");
3035  },
3036  update: function () {
3037      null == this.ovmap && this.createMap();
3038      (!this.autoPan && this.isSuitableOverview()) || this.updateOverview();
3039      this.updateRectToMap();
3040  },
3041  isSuitableOverview: function () {
3042      var a = this.map.getExtent(),
3043          b = this.map.getMaxExtent(),
3044          a = new OpenLayers.Bounds(Math.max(a.left, b.left), Math.max(a.bottom, b.bottom), Math.min(a.right, b.right), Math.min(a.top, b.top));
3045      this.ovmap.getProjection() != this.map.getProjection() && (a = a.transform(this.map.getProjectionObject(), this.ovmap.getProjectionObject()));
3046      b = this.ovmap.getResolution() / this.map.getResolution();
3047      return b > this.minRatio && b <= this.maxRatio && this.ovmap.getExtent().containsBounds(a);
3048  },
3049  updateOverview: function () {
3050      var a = this.map.getResolution(),
3051          b = this.ovmap.getResolution(),
3052          c = b / a;
3053      c > this.maxRatio ? (b = this.minRatio * a) : c <= this.minRatio && (b = this.maxRatio * a);
3054      this.ovmap.getProjection() != this.map.getProjection() ? ((a = this.map.center.clone()), a.transform(this.map.getProjectionObject(), this.ovmap.getProjectionObject())) : (a = this.map.center);
3055      this.ovmap.setCenter(a, this.ovmap.getZoomForResolution(b * this.resolutionFactor));
3056      this.updateRectToMap();
3057  },
3058  createMap: function () {
3059      var a = OpenLayers.Util.extend({ controls: [], maxResolution: "auto", fallThrough: !1 }, this.mapOptions);
3060      this.ovmap = new OpenLayers.Map(this.mapDiv, a);
3061      this.ovmap.viewPortDiv.appendChild(this.extentRectangle);
3062      OpenLayers.Event.stopObserving(window, "unload", this.ovmap.unloadDestroy);
3063      this.ovmap.addLayers(this.layers);
3064      this.ovmap.zoomToMaxExtent();
3065      this.wComp = (this.wComp = parseInt(OpenLayers.Element.getStyle(this.extentRectangle, "border-left-width")) + parseInt(OpenLayers.Element.getStyle(this.extentRectangle, "border-right-width"))) ? this.wComp : 2;
3066      this.hComp = (this.hComp = parseInt(OpenLayers.Element.getStyle(this.extentRectangle, "border-top-width")) + parseInt(OpenLayers.Element.getStyle(this.extentRectangle, "border-bottom-width"))) ? this.hComp : 2;
3067      this.handlers.drag = new OpenLayers.Handler.Drag(this, { move: this.rectDrag, done: this.updateMapToRect }, { map: this.ovmap });
3068      this.handlers.click = new OpenLayers.Handler.Click(this, { click: this.mapDivClick }, { single: !0, double: !1, stopSingle: !0, stopDouble: !0, pixelTolerance: 1, map: this.ovmap });
3069      this.handlers.click.activate();
3070      this.rectEvents = new OpenLayers.Events(this, this.extentRectangle, null, !0);
3071      this.rectEvents.register("mouseover", this, function (a) {
3072          this.handlers.drag.active || this.map.dragging || this.handlers.drag.activate();
3073      });
3074      this.rectEvents.register("mouseout", this, function (a) {
3075          this.handlers.drag.dragging || this.handlers.drag.deactivate();
3076      });
3077      if (this.ovmap.getProjection() != this.map.getProjection()) {
3078          var a = this.map.getProjectionObject().getUnits() || this.map.units || this.map.baseLayer.units,
3079              b = this.ovmap.getProjectionObject().getUnits() || this.ovmap.units || this.ovmap.baseLayer.units;
3080          this.resolutionFactor = a && b ? OpenLayers.INCHES_PER_UNIT[a] / OpenLayers.INCHES_PER_UNIT[b] : 1;
3081      }
3082  },
3083  updateRectToMap: function () {
3084      var a;
3085      a = this.ovmap.getProjection() != this.map.getProjection() ? this.map.getExtent().transform(this.map.getProjectionObject(), this.ovmap.getProjectionObject()) : this.map.getExtent();
3086      (a = this.getRectBoundsFromMapBounds(a)) && this.setRectPxBounds(a);
3087  },
3088  updateMapToRect: function () {
3089      var a = this.getMapBoundsFromRectBounds(this.rectPxBounds);
3090      this.ovmap.getProjection() != this.map.getProjection() && (a = a.transform(this.ovmap.getProjectionObject(), this.map.getProjectionObject()));
3091      this.map.panTo(a.getCenterLonLat());
3092  },
3093  setRectPxBounds: function (a) {
3094      var b = Math.max(a.top, 0),
3095          c = Math.max(a.left, 0),
3096          d = Math.min(a.top + Math.abs(a.getHeight()), this.ovmap.size.h - this.hComp);
3097      a = Math.min(a.left + a.getWidth(), this.ovmap.size.w - this.wComp);
3098      var e = Math.max(a - c, 0),
3099          f = Math.max(d - b, 0);
3100      e < this.minRectSize || f < this.minRectSize
3101          ? ((this.extentRectangle.className = this.displayClass + this.minRectDisplayClass),
3102            (e = c + e / 2 - this.minRectSize / 2),
3103            (this.extentRectangle.style.top = Math.round(b + f / 2 - this.minRectSize / 2) + "px"),
3104            (this.extentRectangle.style.left = Math.round(e) + "px"),
3105            (this.extentRectangle.style.height = this.minRectSize + "px"),
3106            (this.extentRectangle.style.width = this.minRectSize + "px"))
3107          : ((this.extentRectangle.className = this.displayClass + "ExtentRectangle"),
3108            (this.extentRectangle.style.top = Math.round(b) + "px"),
3109            (this.extentRectangle.style.left = Math.round(c) + "px"),
3110            (this.extentRectangle.style.height = Math.round(f) + "px"),
3111            (this.extentRectangle.style.width = Math.round(e) + "px"));
3112      this.rectPxBounds = new OpenLayers.Bounds(Math.round(c), Math.round(d), Math.round(a), Math.round(b));
3113  },
3114  getRectBoundsFromMapBounds: function (a) {
3115      var b = this.getOverviewPxFromLonLat({ lon: a.left, lat: a.bottom });
3116      a = this.getOverviewPxFromLonLat({ lon: a.right, lat: a.top });
3117      var c = null;
3118      b && a && (c = new OpenLayers.Bounds(b.x, b.y, a.x, a.y));
3119      return c;
3120  },
3121  getMapBoundsFromRectBounds: function (a) {
3122      var b = this.getLonLatFromOverviewPx({ x: a.left, y: a.bottom });
3123      a = this.getLonLatFromOverviewPx({ x: a.right, y: a.top });
3124      return new OpenLayers.Bounds(b.lon, b.lat, a.lon, a.lat);
3125  },
3126  getLonLatFromOverviewPx: function (a) {
3127      var b = this.ovmap.size,
3128          c = this.ovmap.getResolution(),
3129          d = this.ovmap.getExtent().getCenterLonLat();
3130      return { lon: d.lon + (a.x - b.w / 2) * c, lat: d.lat - (a.y - b.h / 2) * c };
3131  },
3132  getOverviewPxFromLonLat: function (a) {
3133      var b = this.ovmap.getResolution(),
3134          c = this.ovmap.getExtent();
3135      if (c) return { x: Math.round((1 / b) * (a.lon - c.left)), y: Math.round((1 / b) * (c.top - a.lat)) };
3136  },
3137  CLASS_NAME: "OpenLayers.Control.OverviewMap",
3138});
3139OpenLayers.Layer = OpenLayers.Class({
3140  id: null,
3141  name: null,
3142  div: null,
3143  opacity: 1,
3144  alwaysInRange: null,
3145  RESOLUTION_PROPERTIES: "scales resolutions maxScale minScale maxResolution minResolution numZoomLevels maxZoomLevel".split(" "),
3146  events: null,
3147  map: null,
3148  isBaseLayer: !1,
3149  alpha: !1,
3150  displayInLayerSwitcher: !0,
3151  visibility: !0,
3152  attribution: null,
3153  inRange: !1,
3154  imageSize: null,
3155  options: null,
3156  eventListeners: null,
3157  gutter: 0,
3158  projection: null,
3159  units: null,
3160  scales: null,
3161  resolutions: null,
3162  maxExtent: null,
3163  minExtent: null,
3164  maxResolution: null,
3165  minResolution: null,
3166  numZoomLevels: null,
3167  minScale: null,
3168  maxScale: null,
3169  displayOutsideMaxExtent: !1,
3170  wrapDateLine: !1,
3171  metadata: null,
3172  initialize: function (a, b) {
3173      this.metadata = {};
3174      b = OpenLayers.Util.extend({}, b);
3175      null != this.alwaysInRange && (b.alwaysInRange = this.alwaysInRange);
3176      this.addOptions(b);
3177      this.name = a;
3178      if (
3179          null == this.id &&
3180          ((this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_")),
3181          (this.div = OpenLayers.Util.createDiv(this.id)),
3182          (this.div.style.width = "100%"),
3183          (this.div.style.height = "100%"),
3184          (this.div.dir = "ltr"),
3185          (this.events = new OpenLayers.Events(this, this.div)),
3186          this.eventListeners instanceof Object)
3187      )
3188          this.events.on(this.eventListeners);
3189  },
3190  destroy: function (a) {
3191      null == a && (a = !0);
3192      null != this.map && this.map.removeLayer(this, a);
3193      this.options = this.div = this.name = this.map = this.projection = null;
3194      this.events && (this.eventListeners && this.events.un(this.eventListeners), this.events.destroy());
3195      this.events = this.eventListeners = null;
3196  },
3197  clone: function (a) {
3198      null == a && (a = new OpenLayers.Layer(this.name, this.getOptions()));
3199      OpenLayers.Util.applyDefaults(a, this);
3200      a.map = null;
3201      return a;
3202  },
3203  getOptions: function () {
3204      var a = {},
3205          b;
3206      for (b in this.options) a[b] = this[b];
3207      return a;
3208  },
3209  setName: function (a) {
3210      a != this.name && ((this.name = a), null != this.map && this.map.events.triggerEvent("changelayer", { layer: this, property: "name" }));
3211  },
3212  addOptions: function (a, b) {
3213      null == this.options && (this.options = {});
3214      a &&
3215          ("string" == typeof a.projection && (a.projection = new OpenLayers.Projection(a.projection)),
3216          a.projection && OpenLayers.Util.applyDefaults(a, OpenLayers.Projection.defaults[a.projection.getCode()]),
3217          !a.maxExtent || a.maxExtent instanceof OpenLayers.Bounds || (a.maxExtent = new OpenLayers.Bounds(a.maxExtent)),
3218          !a.minExtent || a.minExtent instanceof OpenLayers.Bounds || (a.minExtent = new OpenLayers.Bounds(a.minExtent)));
3219      OpenLayers.Util.extend(this.options, a);
3220      OpenLayers.Util.extend(this, a);
3221      this.projection && this.projection.getUnits() && (this.units = this.projection.getUnits());
3222      if (this.map) {
3223          var c = this.map.getResolution(),
3224              d = this.RESOLUTION_PROPERTIES.concat(["projection", "units", "minExtent", "maxExtent"]),
3225              e;
3226          for (e in a)
3227              if (a.hasOwnProperty(e) && 0 <= OpenLayers.Util.indexOf(d, e)) {
3228                  this.initResolutions();
3229                  b && this.map.baseLayer === this && (this.map.setCenter(this.map.getCenter(), this.map.getZoomForResolution(c), !1, !0), this.map.events.triggerEvent("changebaselayer", { layer: this }));
3230                  break;
3231              }
3232      }
3233  },
3234  onMapResize: function () {},
3235  redraw: function () {
3236      var a = !1;
3237      if (this.map) {
3238          this.inRange = this.calculateInRange();
3239          var b = this.getExtent();
3240          b && this.inRange && this.visibility && (this.moveTo(b, !0, !1), this.events.triggerEvent("moveend", { zoomChanged: !0 }), (a = !0));
3241      }
3242      return a;
3243  },
3244  moveTo: function (a, b, c) {
3245      a = this.visibility;
3246      this.isBaseLayer || (a = a && this.inRange);
3247      this.display(a);
3248  },
3249  moveByPx: function (a, b) {},
3250  setMap: function (a) {
3251      null == this.map &&
3252          ((this.map = a),
3253          (this.maxExtent = this.maxExtent || this.map.maxExtent),
3254          (this.minExtent = this.minExtent || this.map.minExtent),
3255          (this.projection = this.projection || this.map.projection),
3256          "string" == typeof this.projection && (this.projection = new OpenLayers.Projection(this.projection)),
3257          (this.units = this.projection.getUnits() || this.units || this.map.units),
3258          this.initResolutions(),
3259          this.isBaseLayer || ((this.inRange = this.calculateInRange()), (this.div.style.display = this.visibility && this.inRange ? "" : "none")),
3260          this.setTileSize());
3261  },
3262  afterAdd: function () {},
3263  removeMap: function (a) {},
3264  getImageSize: function (a) {
3265      return this.imageSize || this.tileSize;
3266  },
3267  setTileSize: function (a) {
3268      this.tileSize = a = a ? a : this.tileSize ? this.tileSize : this.map.getTileSize();
3269      this.gutter && (this.imageSize = new OpenLayers.Size(a.w + 2 * this.gutter, a.h + 2 * this.gutter));
3270  },
3271  getVisibility: function () {
3272      return this.visibility;
3273  },
3274  setVisibility: function (a) {
3275      a != this.visibility &&
3276          ((this.visibility = a), this.display(a), this.redraw(), null != this.map && this.map.events.triggerEvent("changelayer", { layer: this, property: "visibility" }), this.events.triggerEvent("visibilitychanged"));
3277  },
3278  display: function (a) {
3279      a != ("none" != this.div.style.display) && (this.div.style.display = a && this.calculateInRange() ? "block" : "none");
3280  },
3281  calculateInRange: function () {
3282      var a = !1;
3283      this.alwaysInRange ? (a = !0) : this.map && ((a = this.map.getResolution()), (a = a >= this.minResolution && a <= this.maxResolution));
3284      return a;
3285  },
3286  setIsBaseLayer: function (a) {
3287      a != this.isBaseLayer && ((this.isBaseLayer = a), null != this.map && this.map.events.triggerEvent("changebaselayer", { layer: this }));
3288  },
3289  initResolutions: function () {
3290      var a,
3291          b,
3292          c,
3293          d = {},
3294          e = !0;
3295      a = 0;
3296      for (b = this.RESOLUTION_PROPERTIES.length; a < b; a++) (c = this.RESOLUTION_PROPERTIES[a]), (d[c] = this.options[c]), e && this.options[c] && (e = !1);
3297      null == this.options.alwaysInRange && (this.alwaysInRange = e);
3298      null == d.resolutions && (d.resolutions = this.resolutionsFromScales(d.scales));
3299      null == d.resolutions && (d.resolutions = this.calculateResolutions(d));
3300      if (null == d.resolutions) {
3301          a = 0;
3302          for (b = this.RESOLUTION_PROPERTIES.length; a < b; a++) (c = this.RESOLUTION_PROPERTIES[a]), (d[c] = null != this.options[c] ? this.options[c] : this.map[c]);
3303          null == d.resolutions && (d.resolutions = this.resolutionsFromScales(d.scales));
3304          null == d.resolutions && (d.resolutions = this.calculateResolutions(d));
3305      }
3306      var f;
3307      this.options.maxResolution && "auto" !== this.options.maxResolution && (f = this.options.maxResolution);
3308      this.options.minScale && (f = OpenLayers.Util.getResolutionFromScale(this.options.minScale, this.units));
3309      var g;
3310      this.options.minResolution && "auto" !== this.options.minResolution && (g = this.options.minResolution);
3311      this.options.maxScale && (g = OpenLayers.Util.getResolutionFromScale(this.options.maxScale, this.units));
3312      d.resolutions &&
3313          (d.resolutions.sort(function (a, b) {
3314              return b - a;
3315          }),
3316          f || (f = d.resolutions[0]),
3317          g || (g = d.resolutions[d.resolutions.length - 1]));
3318      if ((this.resolutions = d.resolutions)) {
3319          b = this.resolutions.length;
3320          this.scales = Array(b);
3321          for (a = 0; a < b; a++) this.scales[a] = OpenLayers.Util.getScaleFromResolution(this.resolutions[a], this.units);
3322          this.numZoomLevels = b;
3323      }
3324      if ((this.minResolution = g)) this.maxScale = OpenLayers.Util.getScaleFromResolution(g, this.units);
3325      if ((this.maxResolution = f)) this.minScale = OpenLayers.Util.getScaleFromResolution(f, this.units);
3326  },
3327  resolutionsFromScales: function (a) {
3328      if (null != a) {
3329          var b, c, d;
3330          d = a.length;
3331          b = Array(d);
3332          for (c = 0; c < d; c++) b[c] = OpenLayers.Util.getResolutionFromScale(a[c], this.units);
3333          return b;
3334      }
3335  },
3336  calculateResolutions: function (a) {
3337      var b,
3338          c,
3339          d = a.maxResolution;
3340      null != a.minScale
3341          ? (d = OpenLayers.Util.getResolutionFromScale(a.minScale, this.units))
3342          : "auto" == d && null != this.maxExtent && ((b = this.map.getSize()), (c = this.maxExtent.getWidth() / b.w), (b = this.maxExtent.getHeight() / b.h), (d = Math.max(c, b)));
3343      c = a.minResolution;
3344      null != a.maxScale
3345          ? (c = OpenLayers.Util.getResolutionFromScale(a.maxScale, this.units))
3346          : "auto" == a.minResolution && null != this.minExtent && ((b = this.map.getSize()), (c = this.minExtent.getWidth() / b.w), (b = this.minExtent.getHeight() / b.h), (c = Math.max(c, b)));
3347      "number" !== typeof d && "number" !== typeof c && null != this.maxExtent && ((d = this.map.getTileSize()), (d = Math.max(this.maxExtent.getWidth() / d.w, this.maxExtent.getHeight() / d.h)));
3348      b = a.maxZoomLevel;
3349      a = a.numZoomLevels;
3350      "number" === typeof c && "number" === typeof d && void 0 === a ? (a = Math.floor(Math.log(d / c) / Math.log(2)) + 1) : void 0 === a && null != b && (a = b + 1);
3351      if (!("number" !== typeof a || 0 >= a || ("number" !== typeof d && "number" !== typeof c))) {
3352          b = Array(a);
3353          var e = 2;
3354          "number" == typeof c && "number" == typeof d && (e = Math.pow(d / c, 1 / (a - 1)));
3355          var f;
3356          if ("number" === typeof d) for (f = 0; f < a; f++) b[f] = d / Math.pow(e, f);
3357          else for (f = 0; f < a; f++) b[a - 1 - f] = c * Math.pow(e, f);
3358          return b;
3359      }
3360  },
3361  getResolution: function () {
3362      var a = this.map.getZoom();
3363      return this.getResolutionForZoom(a);
3364  },
3365  getExtent: function () {
3366      return this.map.calculateBounds();
3367  },
3368  getZoomForExtent: function (a, b) {
3369      var c = this.map.getSize(),
3370          c = Math.max(a.getWidth() / c.w, a.getHeight() / c.h);
3371      return this.getZoomForResolution(c, b);
3372  },
3373  getDataExtent: function () {},
3374  getResolutionForZoom: function (a) {
3375      a = Math.max(0, Math.min(a, this.resolutions.length - 1));
3376      if (this.map.fractionalZoom) {
3377          var b = Math.floor(a),
3378              c = Math.ceil(a);
3379          a = this.resolutions[b] - (a - b) * (this.resolutions[b] - this.resolutions[c]);
3380      } else a = this.resolutions[Math.round(a)];
3381      return a;
3382  },
3383  getZoomForResolution: function (a, b) {
3384      var c, d;
3385      if (this.map.fractionalZoom) {
3386          var e = 0,
3387              f = this.resolutions[e],
3388              g = this.resolutions[this.resolutions.length - 1],
3389              h;
3390          c = 0;
3391          for (d = this.resolutions.length; c < d; ++c)
3392              if (((h = this.resolutions[c]), h >= a && ((f = h), (e = c)), h <= a)) {
3393                  g = h;
3394                  break;
3395              }
3396          c = f - g;
3397          c = 0 < c ? e + (f - a) / c : e;
3398      } else {
3399          f = Number.POSITIVE_INFINITY;
3400          c = 0;
3401          for (d = this.resolutions.length; c < d; c++)
3402              if (b) {
3403                  e = Math.abs(this.resolutions[c] - a);
3404                  if (e > f) break;
3405                  f = e;
3406              } else if (this.resolutions[c] < a) break;
3407          c = Math.max(0, c - 1);
3408      }
3409      return c;
3410  },
3411  getLonLatFromViewPortPx: function (a) {
3412      var b = null,
3413          c = this.map;
3414      if (null != a && c.minPx) {
3415          var b = c.getResolution(),
3416              d = c.getMaxExtent({ restricted: !0 }),
3417              b = new OpenLayers.LonLat((a.x - c.minPx.x) * b + d.left, (c.minPx.y - a.y) * b + d.top);
3418          this.wrapDateLine && (b = b.wrapDateLine(this.maxExtent));
3419      }
3420      return b;
3421  },
3422  getViewPortPxFromLonLat: function (a, b) {
3423      var c = null;
3424      null != a && ((b = b || this.map.getResolution()), (c = this.map.calculateBounds(null, b)), (c = new OpenLayers.Pixel((1 / b) * (a.lon - c.left), (1 / b) * (c.top - a.lat))));
3425      return c;
3426  },
3427  setOpacity: function (a) {
3428      if (a != this.opacity) {
3429          this.opacity = a;
3430          for (var b = this.div.childNodes, c = 0, d = b.length; c < d; ++c) {
3431              var e = b[c].firstChild || b[c],
3432                  f = b[c].lastChild;
3433              f && "iframe" === f.nodeName.toLowerCase() && (e = f.parentNode);
3434              OpenLayers.Util.modifyDOMElement(e, null, null, null, null, null, null, a);
3435          }
3436          null != this.map && this.map.events.triggerEvent("changelayer", { layer: this, property: "opacity" });
3437      }
3438  },
3439  getZIndex: function () {
3440      return this.div.style.zIndex;
3441  },
3442  setZIndex: function (a) {
3443      this.div.style.zIndex = a;
3444  },
3445  adjustBounds: function (a) {
3446      if (this.gutter) {
3447          var b = this.gutter * this.map.getResolution();
3448          a = new OpenLayers.Bounds(a.left - b, a.bottom - b, a.right + b, a.top + b);
3449      }
3450      this.wrapDateLine && ((b = { rightTolerance: this.getResolution(), leftTolerance: this.getResolution() }), (a = a.wrapDateLine(this.maxExtent, b)));
3451      return a;
3452  },
3453  CLASS_NAME: "OpenLayers.Layer",
3454});
3455OpenLayers.Layer.SphericalMercator = {
3456  getExtent: function () {
3457      var a = null;
3458      return (a = this.sphericalMercator ? this.map.calculateBounds() : OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this));
3459  },
3460  getLonLatFromViewPortPx: function (a) {
3461      return OpenLayers.Layer.prototype.getLonLatFromViewPortPx.apply(this, arguments);
3462  },
3463  getViewPortPxFromLonLat: function (a) {
3464      return OpenLayers.Layer.prototype.getViewPortPxFromLonLat.apply(this, arguments);
3465  },
3466  initMercatorParameters: function () {
3467      this.RESOLUTIONS = [];
3468      for (var a = 0; a <= this.MAX_ZOOM_LEVEL; ++a) this.RESOLUTIONS[a] = 156543.03390625 / Math.pow(2, a);
3469      this.units = "m";
3470      this.projection = this.projection || "EPSG:900913";
3471  },
3472  forwardMercator: (function () {
3473      var a = new OpenLayers.Projection("EPSG:4326"),
3474          b = new OpenLayers.Projection("EPSG:900913");
3475      return function (c, d) {
3476          var e = OpenLayers.Projection.transform({ x: c, y: d }, a, b);
3477          return new OpenLayers.LonLat(e.x, e.y);
3478      };
3479  })(),
3480  inverseMercator: (function () {
3481      var a = new OpenLayers.Projection("EPSG:4326"),
3482          b = new OpenLayers.Projection("EPSG:900913");
3483      return function (c, d) {
3484          var e = OpenLayers.Projection.transform({ x: c, y: d }, b, a);
3485          return new OpenLayers.LonLat(e.x, e.y);
3486      };
3487  })(),
3488};
3489OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, {
3490  smoothDragPan: !0,
3491  isBaseLayer: !0,
3492  isFixed: !0,
3493  pane: null,
3494  mapObject: null,
3495  initialize: function (a, b) {
3496      OpenLayers.Layer.prototype.initialize.apply(this, arguments);
3497      null == this.pane && (this.pane = OpenLayers.Util.createDiv(this.div.id + "_EventPane"));
3498  },
3499  destroy: function () {
3500      this.pane = this.mapObject = null;
3501      OpenLayers.Layer.prototype.destroy.apply(this, arguments);
3502  },
3503  setMap: function (a) {
3504      OpenLayers.Layer.prototype.setMap.apply(this, arguments);
3505      this.pane.style.zIndex = parseInt(this.div.style.zIndex) + 1;
3506      this.pane.style.display = this.div.style.display;
3507      this.pane.style.width = "100%";
3508      this.pane.style.height = "100%";
3509      "msie" == OpenLayers.BROWSER_NAME && (this.pane.style.background = "url(" + OpenLayers.Util.getImageLocation("blank.gif") + ")");
3510      this.isFixed ? this.map.viewPortDiv.appendChild(this.pane) : this.map.layerContainerDiv.appendChild(this.pane);
3511      this.loadMapObject();
3512      null == this.mapObject && this.loadWarningMessage();
3513  },
3514  removeMap: function (a) {
3515      this.pane && this.pane.parentNode && this.pane.parentNode.removeChild(this.pane);
3516      OpenLayers.Layer.prototype.removeMap.apply(this, arguments);
3517  },
3518  loadWarningMessage: function () {
3519      this.div.style.backgroundColor = "darkblue";
3520      var a = this.map.getSize(),
3521          b = Math.min(a.w, 300),
3522          c = Math.min(a.h, 200),
3523          b = new OpenLayers.Size(b, c),
3524          a = new OpenLayers.Pixel(a.w / 2, a.h / 2).add(-b.w / 2, -b.h / 2),
3525          a = OpenLayers.Util.createDiv(this.name + "_warning", a, b, null, null, null, "auto");
3526      a.style.padding = "7px";
3527      a.style.backgroundColor = "yellow";
3528      a.innerHTML = this.getWarningHTML();
3529      this.div.appendChild(a);
3530  },
3531  getWarningHTML: function () {
3532      return "";
3533  },
3534  display: function (a) {
3535      OpenLayers.Layer.prototype.display.apply(this, arguments);
3536      this.pane.style.display = this.div.style.display;
3537  },
3538  setZIndex: function (a) {
3539      OpenLayers.Layer.prototype.setZIndex.apply(this, arguments);
3540      this.pane.style.zIndex = parseInt(this.div.style.zIndex) + 1;
3541  },
3542  moveByPx: function (a, b) {
3543      OpenLayers.Layer.prototype.moveByPx.apply(this, arguments);
3544      this.dragPanMapObject ? this.dragPanMapObject(a, -b) : this.moveTo(this.map.getCachedCenter());
3545  },
3546  moveTo: function (a, b, c) {
3547      OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
3548      if (null != this.mapObject) {
3549          var d = this.map.getCenter(),
3550              e = this.map.getZoom();
3551          if (null != d) {
3552              var f = this.getMapObjectCenter(),
3553                  f = this.getOLLonLatFromMapObjectLonLat(f),
3554                  g = this.getMapObjectZoom(),
3555                  g = this.getOLZoomFromMapObjectZoom(g);
3556              (d.equals(f) && e == g) ||
3557                  (!b && f && this.dragPanMapObject && this.smoothDragPan
3558                      ? ((e = this.map.getViewPortPxFromLonLat(f)), (d = this.map.getViewPortPxFromLonLat(d)), this.dragPanMapObject(d.x - e.x, e.y - d.y))
3559                      : ((d = this.getMapObjectLonLatFromOLLonLat(d)), (e = this.getMapObjectZoomFromOLZoom(e)), this.setMapObjectCenter(d, e, c)));
3560          }
3561      }
3562  },
3563  getLonLatFromViewPortPx: function (a) {
3564      var b = null;
3565      null != this.mapObject && null != this.getMapObjectCenter() && ((a = this.getMapObjectPixelFromOLPixel(a)), (a = this.getMapObjectLonLatFromMapObjectPixel(a)), (b = this.getOLLonLatFromMapObjectLonLat(a)));
3566      return b;
3567  },
3568  getViewPortPxFromLonLat: function (a) {
3569      var b = null;
3570      null != this.mapObject && null != this.getMapObjectCenter() && ((a = this.getMapObjectLonLatFromOLLonLat(a)), (a = this.getMapObjectPixelFromMapObjectLonLat(a)), (b = this.getOLPixelFromMapObjectPixel(a)));
3571      return b;
3572  },
3573  getOLLonLatFromMapObjectLonLat: function (a) {
3574      var b = null;
3575      null != a && ((b = this.getLongitudeFromMapObjectLonLat(a)), (a = this.getLatitudeFromMapObjectLonLat(a)), (b = new OpenLayers.LonLat(b, a)));
3576      return b;
3577  },
3578  getMapObjectLonLatFromOLLonLat: function (a) {
3579      var b = null;
3580      null != a && (b = this.getMapObjectLonLatFromLonLat(a.lon, a.lat));
3581      return b;
3582  },
3583  getOLPixelFromMapObjectPixel: function (a) {
3584      var b = null;
3585      null != a && ((b = this.getXFromMapObjectPixel(a)), (a = this.getYFromMapObjectPixel(a)), (b = new OpenLayers.Pixel(b, a)));
3586      return b;
3587  },
3588  getMapObjectPixelFromOLPixel: function (a) {
3589      var b = null;
3590      null != a && (b = this.getMapObjectPixelFromXY(a.x, a.y));
3591      return b;
3592  },
3593  CLASS_NAME: "OpenLayers.Layer.EventPane",
3594});
3595OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class({
3596  initialize: function () {},
3597  initResolutions: function () {
3598      for (var a = ["minZoomLevel", "maxZoomLevel", "numZoomLevels"], b = 0, c = a.length; b < c; b++) {
3599          var d = a[b];
3600          this[d] = null != this.options[d] ? this.options[d] : this.map[d];
3601      }
3602      if (null == this.minZoomLevel || this.minZoomLevel < this.MIN_ZOOM_LEVEL) this.minZoomLevel = this.MIN_ZOOM_LEVEL;
3603      a = this.MAX_ZOOM_LEVEL - this.minZoomLevel + 1;
3604      b = (null == this.options.numZoomLevels && null != this.options.maxZoomLevel) || (null == this.numZoomLevels && null != this.maxZoomLevel) ? this.maxZoomLevel - this.minZoomLevel + 1 : this.numZoomLevels;
3605      this.numZoomLevels = null != b ? Math.min(b, a) : a;
3606      this.maxZoomLevel = this.minZoomLevel + this.numZoomLevels - 1;
3607      if (null != this.RESOLUTIONS) {
3608          a = 0;
3609          this.resolutions = [];
3610          for (b = this.minZoomLevel; b <= this.maxZoomLevel; b++) this.resolutions[a++] = this.RESOLUTIONS[b];
3611          this.maxResolution = this.resolutions[0];
3612          this.minResolution = this.resolutions[this.resolutions.length - 1];
3613      }
3614  },
3615  getResolution: function () {
3616      if (null != this.resolutions) return OpenLayers.Layer.prototype.getResolution.apply(this, arguments);
3617      var a = null,
3618          b = this.map.getSize(),
3619          c = this.getExtent();
3620      null != b && null != c && (a = Math.max(c.getWidth() / b.w, c.getHeight() / b.h));
3621      return a;
3622  },
3623  getExtent: function () {
3624      var a = this.map.getSize(),
3625          b = this.getLonLatFromViewPortPx({ x: 0, y: 0 }),
3626          a = this.getLonLatFromViewPortPx({ x: a.w, y: a.h });
3627      return null != b && null != a ? new OpenLayers.Bounds(b.lon, a.lat, a.lon, b.lat) : null;
3628  },
3629  getZoomForResolution: function (a) {
3630      if (null != this.resolutions) return OpenLayers.Layer.prototype.getZoomForResolution.apply(this, arguments);
3631      var b = OpenLayers.Layer.prototype.getExtent.apply(this, []);
3632      return this.getZoomForExtent(b);
3633  },
3634  getOLZoomFromMapObjectZoom: function (a) {
3635      var b = null;
3636      null != a && ((b = a - this.minZoomLevel), this.map.baseLayer !== this && (b = this.map.baseLayer.getZoomForResolution(this.getResolutionForZoom(b))));
3637      return b;
3638  },
3639  getMapObjectZoomFromOLZoom: function (a) {
3640      var b = null;
3641      null != a && ((b = a + this.minZoomLevel), this.map.baseLayer !== this && (b = this.getZoomForResolution(this.map.baseLayer.getResolutionForZoom(b))));
3642      return b;
3643  },
3644  CLASS_NAME: "OpenLayers.Layer.FixedZoomLevels",
3645});
3646OpenLayers.Layer.Google = OpenLayers.Class(OpenLayers.Layer.EventPane, OpenLayers.Layer.FixedZoomLevels, {
3647  MIN_ZOOM_LEVEL: 0,
3648  MAX_ZOOM_LEVEL: 21,
3649  RESOLUTIONS: [
3650      1.40625,
3651      0.703125,
3652      0.3515625,
3653      0.17578125,
3654      0.087890625,
3655      0.0439453125,
3656      0.02197265625,
3657      0.010986328125,
3658      0.0054931640625,
3659      0.00274658203125,
3660      0.001373291015625,
3661      6.866455078125e-4,
3662      3.4332275390625e-4,
3663      1.71661376953125e-4,
3664      8.58306884765625e-5,
3665      4.291534423828125e-5,
3666      2.145767211914062e-5,
3667      1.072883605957031e-5,
3668      5.36441802978515e-6,
3669      2.68220901489257e-6,
3670      1.341104507446289e-6,
3671      6.705522537231445e-7,
3672  ],
3673  type: null,
3674  wrapDateLine: !0,
3675  sphericalMercator: !1,
3676  version: null,
3677  initialize: function (a, b) {
3678      b = b || {};
3679      b.version || (b.version = "function" === typeof GMap2 ? "2" : "3");
3680      var c = OpenLayers.Layer.Google["v" + b.version.replace(/\./g, "_")];
3681      if (c) OpenLayers.Util.applyDefaults(b, c);
3682      else throw "Unsupported Google Maps API version: " + b.version;
3683      OpenLayers.Util.applyDefaults(b, c.DEFAULTS);
3684      b.maxExtent && (b.maxExtent = b.maxExtent.clone());
3685      OpenLayers.Layer.EventPane.prototype.initialize.apply(this, [a, b]);
3686      OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this, [a, b]);
3687      this.sphericalMercator && (OpenLayers.Util.extend(this, OpenLayers.Layer.SphericalMercator), this.initMercatorParameters());
3688  },
3689  clone: function () {
3690      return new OpenLayers.Layer.Google(this.name, this.getOptions());
3691  },
3692  setVisibility: function (a) {
3693      var b = null == this.opacity ? 1 : this.opacity;
3694      OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this, arguments);
3695      this.setOpacity(b);
3696  },
3697  display: function (a) {
3698      this._dragging || this.setGMapVisibility(a);
3699      OpenLayers.Layer.EventPane.prototype.display.apply(this, arguments);
3700  },
3701  moveTo: function (a, b, c) {
3702      this._dragging = c;
3703      OpenLayers.Layer.EventPane.prototype.moveTo.apply(this, arguments);
3704      delete this._dragging;
3705  },
3706  setOpacity: function (a) {
3707      a !== this.opacity && (null != this.map && this.map.events.triggerEvent("changelayer", { layer: this, property: "opacity" }), (this.opacity = a));
3708      if (this.getVisibility()) {
3709          var b = this.getMapContainer();
3710          OpenLayers.Util.modifyDOMElement(b, null, null, null, null, null, null, a);
3711      }
3712  },
3713  destroy: function () {
3714      if (this.map) {
3715          this.setGMapVisibility(!1);
3716          var a = OpenLayers.Layer.Google.cache[this.map.id];
3717          a && 1 >= a.count && this.removeGMapElements();
3718      }
3719      OpenLayers.Layer.EventPane.prototype.destroy.apply(this, arguments);
3720  },
3721  removeGMapElements: function () {
3722      var a = OpenLayers.Layer.Google.cache[this.map.id];
3723      if (a) {
3724          var b = this.mapObject && this.getMapContainer();
3725          b && b.parentNode && b.parentNode.removeChild(b);
3726          (b = a.termsOfUse) && b.parentNode && b.parentNode.removeChild(b);
3727          (a = a.poweredBy) && a.parentNode && a.parentNode.removeChild(a);
3728          this.mapObject && window.google && google.maps && google.maps.event && google.maps.event.clearListeners && google.maps.event.clearListeners(this.mapObject, "tilesloaded");
3729      }
3730  },
3731  removeMap: function (a) {
3732      this.visibility && this.mapObject && this.setGMapVisibility(!1);
3733      var b = OpenLayers.Layer.Google.cache[a.id];
3734      b && (1 >= b.count ? (this.removeGMapElements(), delete OpenLayers.Layer.Google.cache[a.id]) : --b.count);
3735      delete this.termsOfUse;
3736      delete this.poweredBy;
3737      delete this.mapObject;
3738      delete this.dragObject;
3739      OpenLayers.Layer.EventPane.prototype.removeMap.apply(this, arguments);
3740  },
3741  getOLBoundsFromMapObjectBounds: function (a) {
3742      var b = null;
3743      null != a &&
3744          ((b = a.getSouthWest()),
3745          (a = a.getNorthEast()),
3746          this.sphericalMercator ? ((b = this.forwardMercator(b.lng(), b.lat())), (a = this.forwardMercator(a.lng(), a.lat()))) : ((b = new OpenLayers.LonLat(b.lng(), b.lat())), (a = new OpenLayers.LonLat(a.lng(), a.lat()))),
3747          (b = new OpenLayers.Bounds(b.lon, b.lat, a.lon, a.lat)));
3748      return b;
3749  },
3750  getWarningHTML: function () {
3751      return OpenLayers.i18n("googleWarning");
3752  },
3753  getMapObjectCenter: function () {
3754      return this.mapObject.getCenter();
3755  },
3756  getMapObjectZoom: function () {
3757      return this.mapObject.getZoom();
3758  },
3759  getLongitudeFromMapObjectLonLat: function (a) {
3760      return this.sphericalMercator ? this.forwardMercator(a.lng(), a.lat()).lon : a.lng();
3761  },
3762  getLatitudeFromMapObjectLonLat: function (a) {
3763      return this.sphericalMercator ? this.forwardMercator(a.lng(), a.lat()).lat : a.lat();
3764  },
3765  getXFromMapObjectPixel: function (a) {
3766      return a.x;
3767  },
3768  getYFromMapObjectPixel: function (a) {
3769      return a.y;
3770  },
3771  CLASS_NAME: "OpenLayers.Layer.Google",
3772});
3773OpenLayers.Layer.Google.cache = {};
3774OpenLayers.Layer.Google.v2 = {
3775  termsOfUse: null,
3776  poweredBy: null,
3777  dragObject: null,
3778  loadMapObject: function () {
3779      this.type || (this.type = G_NORMAL_MAP);
3780      var a,
3781          b,
3782          c,
3783          d = OpenLayers.Layer.Google.cache[this.map.id];
3784      if (d) (a = d.mapObject), (b = d.termsOfUse), (c = d.poweredBy), ++d.count;
3785      else {
3786          var d = this.map.viewPortDiv,
3787              e = document.createElement("div");
3788          e.id = this.map.id + "_GMap2Container";
3789          e.style.position = "absolute";
3790          e.style.width = "100%";
3791          e.style.height = "100%";
3792          d.appendChild(e);
3793          try {
3794              (a = new GMap2(e)),
3795                  (b = e.lastChild),
3796                  d.appendChild(b),
3797                  (b.style.zIndex = "1100"),
3798                  (b.style.right = ""),
3799                  (b.style.bottom = ""),
3800                  (b.className = "olLayerGoogleCopyright"),
3801                  (c = e.lastChild),
3802                  d.appendChild(c),
3803                  (c.style.zIndex = "1100"),
3804                  (c.style.right = ""),
3805                  (c.style.bottom = ""),
3806                  (c.className = "olLayerGooglePoweredBy gmnoprint");
3807          } catch (f) {
3808              throw f;
3809          }
3810          OpenLayers.Layer.Google.cache[this.map.id] = { mapObject: a, termsOfUse: b, poweredBy: c, count: 1 };
3811      }
3812      this.mapObject = a;
3813      this.termsOfUse = b;
3814      this.poweredBy = c;
3815      -1 === OpenLayers.Util.indexOf(this.mapObject.getMapTypes(), this.type) && this.mapObject.addMapType(this.type);
3816      "function" == typeof a.getDragObject ? (this.dragObject = a.getDragObject()) : (this.dragPanMapObject = null);
3817      !1 === this.isBaseLayer && this.setGMapVisibility("none" !== this.div.style.display);
3818  },
3819  onMapResize: function () {
3820      if (this.visibility && this.mapObject.isLoaded()) this.mapObject.checkResize();
3821      else {
3822          if (!this._resized)
3823              var a = this,
3824                  b = GEvent.addListener(this.mapObject, "load", function () {
3825                      GEvent.removeListener(b);
3826                      delete a._resized;
3827                      a.mapObject.checkResize();
3828                      a.moveTo(a.map.getCenter(), a.map.getZoom());
3829                  });
3830          this._resized = !0;
3831      }
3832  },
3833  setGMapVisibility: function (a) {
3834      var b = OpenLayers.Layer.Google.cache[this.map.id];
3835      if (b) {
3836          var c = this.mapObject.getContainer();
3837          !0 === a
3838              ? (this.mapObject.setMapType(this.type), (c.style.display = ""), (this.termsOfUse.style.left = ""), (this.termsOfUse.style.display = ""), (this.poweredBy.style.display = ""), (b.displayed = this.id))
3839              : (b.displayed === this.id && delete b.displayed, b.displayed || ((c.style.display = "none"), (this.termsOfUse.style.display = "none"), (this.termsOfUse.style.left = "-9999px"), (this.poweredBy.style.display = "none")));
3840      }
3841  },
3842  getMapContainer: function () {
3843      return this.mapObject.getContainer();
3844  },
3845  getMapObjectBoundsFromOLBounds: function (a) {
3846      var b = null;
3847      null != a &&
3848          ((b = this.sphericalMercator ? this.inverseMercator(a.bottom, a.left) : new OpenLayers.LonLat(a.bottom, a.left)),
3849          (a = this.sphericalMercator ? this.inverseMercator(a.top, a.right) : new OpenLayers.LonLat(a.top, a.right)),
3850          (b = new GLatLngBounds(new GLatLng(b.lat, b.lon), new GLatLng(a.lat, a.lon))));
3851      return b;
3852  },
3853  setMapObjectCenter: function (a, b) {
3854      this.mapObject.setCenter(a, b);
3855  },
3856  dragPanMapObject: function (a, b) {
3857      this.dragObject.moveBy(new GSize(-a, b));
3858  },
3859  getMapObjectLonLatFromMapObjectPixel: function (a) {
3860      return this.mapObject.fromContainerPixelToLatLng(a);
3861  },
3862  getMapObjectPixelFromMapObjectLonLat: function (a) {
3863      return this.mapObject.fromLatLngToContainerPixel(a);
3864  },
3865  getMapObjectZoomFromMapObjectBounds: function (a) {
3866      return this.mapObject.getBoundsZoomLevel(a);
3867  },
3868  getMapObjectLonLatFromLonLat: function (a, b) {
3869      var c;
3870      this.sphericalMercator ? ((c = this.inverseMercator(a, b)), (c = new GLatLng(c.lat, c.lon))) : (c = new GLatLng(b, a));
3871      return c;
3872  },
3873  getMapObjectPixelFromXY: function (a, b) {
3874      return new GPoint(a, b);
3875  },
3876};
3877OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
3878  namespaces: null,
3879  namespaceAlias: null,
3880  defaultPrefix: null,
3881  readers: {},
3882  writers: {},
3883  xmldom: null,
3884  initialize: function (a) {
3885      window.ActiveXObject && (this.xmldom = new ActiveXObject("Microsoft.XMLDOM"));
3886      OpenLayers.Format.prototype.initialize.apply(this, [a]);
3887      this.namespaces = OpenLayers.Util.extend({}, this.namespaces);
3888      this.namespaceAlias = {};
3889      for (var b in this.namespaces) this.namespaceAlias[this.namespaces[b]] = b;
3890  },
3891  destroy: function () {
3892      this.xmldom = null;
3893      OpenLayers.Format.prototype.destroy.apply(this, arguments);
3894  },
3895  setNamespace: function (a, b) {
3896      this.namespaces[a] = b;
3897      this.namespaceAlias[b] = a;
3898  },
3899  read: function (a) {
3900      var b = a.indexOf("<");
3901      0 < b && (a = a.substring(b));
3902      b = OpenLayers.Util.Try(
3903          OpenLayers.Function.bind(function () {
3904              var b;
3905              b = window.ActiveXObject && !this.xmldom ? new ActiveXObject("Microsoft.XMLDOM") : this.xmldom;
3906              b.loadXML(a);
3907              return b;
3908          }, this),
3909          function () {
3910              return new DOMParser().parseFromString(a, "text/xml");
3911          },
3912          function () {
3913              var b = new XMLHttpRequest();
3914              b.open("GET", "data:text/xml;charset=utf-8," + encodeURIComponent(a), !1);
3915              b.overrideMimeType && b.overrideMimeType("text/xml");
3916              b.send(null);
3917              return b.responseXML;
3918          }
3919      );
3920      this.keepData && (this.data = b);
3921      return b;
3922  },
3923  write: function (a) {
3924      if (this.xmldom) a = a.xml;
3925      else {
3926          var b = new XMLSerializer();
3927          if (1 == a.nodeType) {
3928              var c = document.implementation.createDocument("", "", null);
3929              c.importNode && (a = c.importNode(a, !0));
3930              c.appendChild(a);
3931              a = b.serializeToString(c);
3932          } else a = b.serializeToString(a);
3933      }
3934      return a;
3935  },
3936  createElementNS: function (a, b) {
3937      return this.xmldom ? ("string" == typeof a ? this.xmldom.createNode(1, b, a) : this.xmldom.createNode(1, b, "")) : document.createElementNS(a, b);
3938  },
3939  createDocumentFragment: function () {
3940      return this.xmldom ? this.xmldom.createDocumentFragment() : document.createDocumentFragment();
3941  },
3942  createTextNode: function (a) {
3943      "string" !== typeof a && (a = String(a));
3944      return this.xmldom ? this.xmldom.createTextNode(a) : document.createTextNode(a);
3945  },
3946  getElementsByTagNameNS: function (a, b, c) {
3947      var d = [];
3948      if (a.getElementsByTagNameNS) d = a.getElementsByTagNameNS(b, c);
3949      else {
3950          a = a.getElementsByTagName("*");
3951          for (var e, f, g = 0, h = a.length; g < h; ++g) if (((e = a[g]), (f = e.prefix ? e.prefix + ":" + c : c), "*" == c || f == e.nodeName)) ("*" != b && b != e.namespaceURI) || d.push(e);
3952      }
3953      return d;
3954  },
3955  getAttributeNodeNS: function (a, b, c) {
3956      var d = null;
3957      if (a.getAttributeNodeNS) d = a.getAttributeNodeNS(b, c);
3958      else {
3959          a = a.attributes;
3960          for (var e, f, g = 0, h = a.length; g < h; ++g)
3961              if (((e = a[g]), e.namespaceURI == b && ((f = e.prefix ? e.prefix + ":" + c : c), f == e.nodeName))) {
3962                  d = e;
3963                  break;
3964              }
3965      }
3966      return d;
3967  },
3968  getAttributeNS: function (a, b, c) {
3969      var d = "";
3970      if (a.getAttributeNS) d = a.getAttributeNS(b, c) || "";
3971      else if ((a = this.getAttributeNodeNS(a, b, c))) d = a.nodeValue;
3972      return d;
3973  },
3974  getChildValue: function (a, b) {
3975      var c = b || "";
3976      if (a)
3977          for (var d = a.firstChild; d; d = d.nextSibling)
3978              switch (d.nodeType) {
3979                  case 3:
3980                  case 4:
3981                      c += d.nodeValue;
3982              }
3983      return c;
3984  },
3985  isSimpleContent: function (a) {
3986      var b = !0;
3987      for (a = a.firstChild; a; a = a.nextSibling)
3988          if (1 === a.nodeType) {
3989              b = !1;
3990              break;
3991          }
3992      return b;
3993  },
3994  contentType: function (a) {
3995      var b = !1,
3996          c = !1,
3997          d = OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;
3998      for (a = a.firstChild; a; a = a.nextSibling) {
3999          switch (a.nodeType) {
4000              case 1:
4001                  c = !0;
4002                  break;
4003              case 8:
4004                  break;
4005              default:
4006                  b = !0;
4007          }
4008          if (c && b) break;
4009      }
4010      if (c && b) d = OpenLayers.Format.XML.CONTENT_TYPE.MIXED;
4011      else {
4012          if (c) return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX;
4013          if (b) return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE;
4014      }
4015      return d;
4016  },
4017  hasAttributeNS: function (a, b, c) {
4018      var d = !1;
4019      return (d = a.hasAttributeNS ? a.hasAttributeNS(b, c) : !!this.getAttributeNodeNS(a, b, c));
4020  },
4021  setAttributeNS: function (a, b, c, d) {
4022      if (a.setAttributeNS) a.setAttributeNS(b, c, d);
4023      else if (this.xmldom) b ? ((b = a.ownerDocument.createNode(2, c, b)), (b.nodeValue = d), a.setAttributeNode(b)) : a.setAttribute(c, d);
4024      else throw "setAttributeNS not implemented";
4025  },
4026  createElementNSPlus: function (a, b) {
4027      b = b || {};
4028      var c = b.uri || this.namespaces[b.prefix];
4029      c || ((c = a.indexOf(":")), (c = this.namespaces[a.substring(0, c)]));
4030      c || (c = this.namespaces[this.defaultPrefix]);
4031      c = this.createElementNS(c, a);
4032      b.attributes && this.setAttributes(c, b.attributes);
4033      var d = b.value;
4034      null != d && c.appendChild(this.createTextNode(d));
4035      return c;
4036  },
4037  setAttributes: function (a, b) {
4038      var c, d, e;
4039      for (e in b) null != b[e] && b[e].toString && ((c = b[e].toString()), (d = this.namespaces[e.substring(0, e.indexOf(":"))] || null), this.setAttributeNS(a, d, e, c));
4040  },
4041  readNode: function (a, b) {
4042      b || (b = {});
4043      var c = this.readers[a.namespaceURI ? this.namespaceAlias[a.namespaceURI] : this.defaultPrefix];
4044      if (c) {
4045          var d = a.localName || a.nodeName.split(":").pop();
4046          (c = c[d] || c["*"]) && c.apply(this, [a, b]);
4047      }
4048      return b;
4049  },
4050  readChildNodes: function (a, b) {
4051      b || (b = {});
4052      for (var c = a.childNodes, d, e = 0, f = c.length; e < f; ++e) (d = c[e]), 1 == d.nodeType && this.readNode(d, b);
4053      return b;
4054  },
4055  writeNode: function (a, b, c) {
4056      var d,
4057          e = a.indexOf(":");
4058      0 < e ? ((d = a.substring(0, e)), (a = a.substring(e + 1))) : (d = c ? this.namespaceAlias[c.namespaceURI] : this.defaultPrefix);
4059      b = this.writers[d][a].apply(this, [b]);
4060      c && c.appendChild(b);
4061      return b;
4062  },
4063  getChildEl: function (a, b, c) {
4064      return a && this.getThisOrNextEl(a.firstChild, b, c);
4065  },
4066  getNextEl: function (a, b, c) {
4067      return a && this.getThisOrNextEl(a.nextSibling, b, c);
4068  },
4069  getThisOrNextEl: function (a, b, c) {
4070      a: for (; a; a = a.nextSibling)
4071          switch (a.nodeType) {
4072              case 1:
4073                  if (!((b && b !== (a.localName || a.nodeName.split(":").pop())) || (c && c !== a.namespaceURI))) break a;
4074                  a = null;
4075                  break a;
4076              case 3:
4077                  if (/^\s*$/.test(a.nodeValue)) break;
4078              case 4:
4079              case 6:
4080              case 12:
4081              case 10:
4082              case 11:
4083                  a = null;
4084                  break a;
4085          }
4086      return a || null;
4087  },
4088  lookupNamespaceURI: function (a, b) {
4089      var c = null;
4090      if (a)
4091          if (a.lookupNamespaceURI) c = a.lookupNamespaceURI(b);
4092          else
4093              a: switch (a.nodeType) {
4094                  case 1:
4095                      if (null !== a.namespaceURI && a.prefix === b) {
4096                          c = a.namespaceURI;
4097                          break a;
4098                      }
4099                      if ((c = a.attributes.length))
4100                          for (var d, e = 0; e < c; ++e)
4101                              if (((d = a.attributes[e]), "xmlns" === d.prefix && d.name === "xmlns:" + b)) {
4102                                  c = d.value || null;
4103                                  break a;
4104                              } else if ("xmlns" === d.name && null === b) {
4105                                  c = d.value || null;
4106                                  break a;
4107                              }
4108                      c = this.lookupNamespaceURI(a.parentNode, b);
4109                      break a;
4110                  case 2:
4111                      c = this.lookupNamespaceURI(a.ownerElement, b);
4112                      break a;
4113                  case 9:
4114                      c = this.lookupNamespaceURI(a.documentElement, b);
4115                      break a;
4116                  case 6:
4117                  case 12:
4118                  case 10:
4119                  case 11:
4120                      break a;
4121                  default:
4122                      c = this.lookupNamespaceURI(a.parentNode, b);
4123              }
4124      return c;
4125  },
4126  getXMLDoc: function () {
4127      OpenLayers.Format.XML.document ||
4128          this.xmldom ||
4129          (document.implementation && document.implementation.createDocument
4130              ? (OpenLayers.Format.XML.document = document.implementation.createDocument("", "", null))
4131              : !this.xmldom && window.ActiveXObject && (this.xmldom = new ActiveXObject("Microsoft.XMLDOM")));
4132      return OpenLayers.Format.XML.document || this.xmldom;
4133  },
4134  CLASS_NAME: "OpenLayers.Format.XML",
4135});
4136OpenLayers.Format.XML.CONTENT_TYPE = { EMPTY: 0, SIMPLE: 1, COMPLEX: 2, MIXED: 3 };
4137OpenLayers.Format.XML.lookupNamespaceURI = OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI, OpenLayers.Format.XML.prototype);
4138OpenLayers.Format.XML.document = null;
4139OpenLayers.Format.WFST = function (a) {
4140  a = OpenLayers.Util.applyDefaults(a, OpenLayers.Format.WFST.DEFAULTS);
4141  var b = OpenLayers.Format.WFST["v" + a.version.replace(/\./g, "_")];
4142  if (!b) throw "Unsupported WFST version: " + a.version;
4143  return new b(a);
4144};
4145OpenLayers.Format.WFST.DEFAULTS = { version: "1.0.0" };
4146OpenLayers.Feature = OpenLayers.Class({
4147  layer: null,
4148  id: null,
4149  lonlat: null,
4150  data: null,
4151  marker: null,
4152  popupClass: null,
4153  popup: null,
4154  initialize: function (a, b, c) {
4155      this.layer = a;
4156      this.lonlat = b;
4157      this.data = null != c ? c : {};
4158      this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
4159  },
4160  destroy: function () {
4161      null != this.layer && null != this.layer.map && null != this.popup && this.layer.map.removePopup(this.popup);
4162      null != this.layer && null != this.marker && this.layer.removeMarker(this.marker);
4163      this.data = this.lonlat = this.id = this.layer = null;
4164      null != this.marker && (this.destroyMarker(this.marker), (this.marker = null));
4165      null != this.popup && (this.destroyPopup(this.popup), (this.popup = null));
4166  },
4167  onScreen: function () {
4168      var a = !1;
4169      null != this.layer && null != this.layer.map && (a = this.layer.map.getExtent().containsLonLat(this.lonlat));
4170      return a;
4171  },
4172  createMarker: function () {
4173      null != this.lonlat && (this.marker = new OpenLayers.Marker(this.lonlat, this.data.icon));
4174      return this.marker;
4175  },
4176  destroyMarker: function () {
4177      this.marker.destroy();
4178  },
4179  createPopup: function (a) {
4180      null != this.lonlat &&
4181          (this.popup || (this.popup = new (this.popupClass ? this.popupClass : OpenLayers.Popup.Anchored)(this.id + "_popup", this.lonlat, this.data.popupSize, this.data.popupContentHTML, this.marker ? this.marker.icon : null, a)),
4182          null != this.data.overflow && (this.popup.contentDiv.style.overflow = this.data.overflow),
4183          (this.popup.feature = this));
4184      return this.popup;
4185  },
4186  destroyPopup: function () {
4187      this.popup && ((this.popup.feature = null), this.popup.destroy(), (this.popup = null));
4188  },
4189  CLASS_NAME: "OpenLayers.Feature",
4190});
4191OpenLayers.State = { UNKNOWN: "Unknown", INSERT: "Insert", UPDATE: "Update", DELETE: "Delete" };
4192OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
4193  fid: null,
4194  geometry: null,
4195  attributes: null,
4196  bounds: null,
4197  state: null,
4198  style: null,
4199  url: null,
4200  renderIntent: "default",
4201  modified: null,
4202  initialize: function (a, b, c) {
4203      OpenLayers.Feature.prototype.initialize.apply(this, [null, null, b]);
4204      this.lonlat = null;
4205      this.geometry = a ? a : null;
4206      this.state = null;
4207      this.attributes = {};
4208      b && (this.attributes = OpenLayers.Util.extend(this.attributes, b));
4209      this.style = c ? c : null;
4210  },
4211  destroy: function () {
4212      this.layer && (this.layer.removeFeatures(this), (this.layer = null));
4213      this.modified = this.geometry = null;
4214      OpenLayers.Feature.prototype.destroy.apply(this, arguments);
4215  },
4216  clone: function () {
4217      return new OpenLayers.Feature.Vector(this.geometry ? this.geometry.clone() : null, this.attributes, this.style);
4218  },
4219  onScreen: function (a) {
4220      var b = !1;
4221      this.layer && this.layer.map && ((b = this.layer.map.getExtent()), a ? ((a = this.geometry.getBounds()), (b = b.intersectsBounds(a))) : (b = b.toGeometry().intersects(this.geometry)));
4222      return b;
4223  },
4224  getVisibility: function () {
4225      return !(
4226          (this.style && "none" == this.style.display) ||
4227          !this.layer ||
4228          (this.layer && this.layer.styleMap && "none" == this.layer.styleMap.createSymbolizer(this, this.renderIntent).display) ||
4229          (this.layer && !this.layer.getVisibility())
4230      );
4231  },
4232  createMarker: function () {
4233      return null;
4234  },
4235  destroyMarker: function () {},
4236  createPopup: function () {
4237      return null;
4238  },
4239  atPoint: function (a, b, c) {
4240      var d = !1;
4241      this.geometry && (d = this.geometry.atPoint(a, b, c));
4242      return d;
4243  },
4244  destroyPopup: function () {},
4245  move: function (a) {
4246      if (this.layer && this.geometry.move) {
4247          a = "OpenLayers.LonLat" == a.CLASS_NAME ? this.layer.getViewPortPxFromLonLat(a) : a;
4248          var b = this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),
4249              c = this.layer.map.getResolution();
4250          this.geometry.move(c * (a.x - b.x), c * (b.y - a.y));
4251          this.layer.drawFeature(this);
4252          return b;
4253      }
4254  },
4255  toState: function (a) {
4256      if (a == OpenLayers.State.UPDATE)
4257          switch (this.state) {
4258              case OpenLayers.State.UNKNOWN:
4259              case OpenLayers.State.DELETE:
4260                  this.state = a;
4261          }
4262      else if (a == OpenLayers.State.INSERT)
4263          switch (this.state) {
4264              case OpenLayers.State.UNKNOWN:
4265                  break;
4266              default:
4267                  this.state = a;
4268          }
4269      else if (a == OpenLayers.State.DELETE)
4270          switch (this.state) {
4271              case OpenLayers.State.UNKNOWN:
4272              case OpenLayers.State.UPDATE:
4273                  this.state = a;
4274          }
4275      else a == OpenLayers.State.UNKNOWN && (this.state = a);
4276  },
4277  CLASS_NAME: "OpenLayers.Feature.Vector",
4278});
4279OpenLayers.Feature.Vector.style = {
4280  default: {
4281      fillColor: "#ee9900",
4282      fillOpacity: 0.4,
4283      hoverFillColor: "white",
4284      hoverFillOpacity: 0.8,
4285      strokeColor: "#ee9900",
4286      strokeOpacity: 1,
4287      strokeWidth: 1,
4288      strokeLinecap: "round",
4289      strokeDashstyle: "solid",
4290      hoverStrokeColor: "red",
4291      hoverStrokeOpacity: 1,
4292      hoverStrokeWidth: 0.2,
4293      pointRadius: 6,
4294      hoverPointRadius: 1,
4295      hoverPointUnit: "%",
4296      pointerEvents: "visiblePainted",
4297      cursor: "inherit",
4298      fontColor: "#000000",
4299      labelAlign: "cm",
4300      labelOutlineColor: "white",
4301      labelOutlineWidth: 3,
4302  },
4303  select: {
4304      fillColor: "blue",
4305      fillOpacity: 0.4,
4306      hoverFillColor: "white",
4307      hoverFillOpacity: 0.8,
4308      strokeColor: "blue",
4309      strokeOpacity: 1,
4310      strokeWidth: 2,
4311      strokeLinecap: "round",
4312      strokeDashstyle: "solid",
4313      hoverStrokeColor: "red",
4314      hoverStrokeOpacity: 1,
4315      hoverStrokeWidth: 0.2,
4316      pointRadius: 6,
4317      hoverPointRadius: 1,
4318      hoverPointUnit: "%",
4319      pointerEvents: "visiblePainted",
4320      cursor: "pointer",
4321      fontColor: "#000000",
4322      labelAlign: "cm",
4323      labelOutlineColor: "white",
4324      labelOutlineWidth: 3,
4325  },
4326  temporary: {
4327      fillColor: "#66cccc",
4328      fillOpacity: 0.2,
4329      hoverFillColor: "white",
4330      hoverFillOpacity: 0.8,
4331      strokeColor: "#66cccc",
4332      strokeOpacity: 1,
4333      strokeLinecap: "round",
4334      strokeWidth: 2,
4335      strokeDashstyle: "solid",
4336      hoverStrokeColor: "red",
4337      hoverStrokeOpacity: 1,
4338      hoverStrokeWidth: 0.2,
4339      pointRadius: 6,
4340      hoverPointRadius: 1,
4341      hoverPointUnit: "%",
4342      pointerEvents: "visiblePainted",
4343      cursor: "inherit",
4344      fontColor: "#000000",
4345      labelAlign: "cm",
4346      labelOutlineColor: "white",
4347      labelOutlineWidth: 3,
4348  },
4349  delete: { display: "none" },
4350};
4351OpenLayers.Style = OpenLayers.Class({
4352  id: null,
4353  name: null,
4354  title: null,
4355  description: null,
4356  layerName: null,
4357  isDefault: !1,
4358  rules: null,
4359  context: null,
4360  defaultStyle: null,
4361  defaultsPerSymbolizer: !1,
4362  propertyStyles: null,
4363  initialize: function (a, b) {
4364      OpenLayers.Util.extend(this, b);
4365      this.rules = [];
4366      b && b.rules && this.addRules(b.rules);
4367      this.setDefaultStyle(a || OpenLayers.Feature.Vector.style["default"]);
4368      this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
4369  },
4370  destroy: function () {
4371      for (var a = 0, b = this.rules.length; a < b; a++) this.rules[a].destroy(), (this.rules[a] = null);
4372      this.defaultStyle = this.rules = null;
4373  },
4374  createSymbolizer: function (a) {
4375      for (var b = this.defaultsPerSymbolizer ? {} : this.createLiterals(OpenLayers.Util.extend({}, this.defaultStyle), a), c = this.rules, d, e = [], f = !1, g = 0, h = c.length; g < h; g++)
4376          (d = c[g]), d.evaluate(a) && (d instanceof OpenLayers.Rule && d.elseFilter ? e.push(d) : ((f = !0), this.applySymbolizer(d, b, a)));
4377      if (!1 == f && 0 < e.length) for (f = !0, g = 0, h = e.length; g < h; g++) this.applySymbolizer(e[g], b, a);
4378      0 < c.length && !1 == f && (b.display = "none");
4379      null != b.label && "string" !== typeof b.label && (b.label = String(b.label));
4380      return b;
4381  },
4382  applySymbolizer: function (a, b, c) {
4383      var d = c.geometry ? this.getSymbolizerPrefix(c.geometry) : OpenLayers.Style.SYMBOLIZER_PREFIXES[0];
4384      a = a.symbolizer[d] || a.symbolizer;
4385      !0 === this.defaultsPerSymbolizer &&
4386          ((d = this.defaultStyle),
4387          OpenLayers.Util.applyDefaults(a, { pointRadius: d.pointRadius }),
4388          (!0 !== a.stroke && !0 !== a.graphic) ||
4389              OpenLayers.Util.applyDefaults(a, { strokeWidth: d.strokeWidth, strokeColor: d.strokeColor, strokeOpacity: d.strokeOpacity, strokeDashstyle: d.strokeDashstyle, strokeLinecap: d.strokeLinecap }),
4390          (!0 !== a.fill && !0 !== a.graphic) || OpenLayers.Util.applyDefaults(a, { fillColor: d.fillColor, fillOpacity: d.fillOpacity }),
4391          !0 === a.graphic &&
4392              OpenLayers.Util.applyDefaults(a, {
4393                  pointRadius: this.defaultStyle.pointRadius,
4394                  externalGraphic: this.defaultStyle.externalGraphic,
4395                  graphicName: this.defaultStyle.graphicName,
4396                  graphicOpacity: this.defaultStyle.graphicOpacity,
4397                  graphicWidth: this.defaultStyle.graphicWidth,
4398                  graphicHeight: this.defaultStyle.graphicHeight,
4399                  graphicXOffset: this.defaultStyle.graphicXOffset,
4400                  graphicYOffset: this.defaultStyle.graphicYOffset,
4401              }));
4402      return this.createLiterals(OpenLayers.Util.extend(b, a), c);
4403  },
4404  createLiterals: function (a, b) {
4405      var c = OpenLayers.Util.extend({}, b.attributes || b.data);
4406      OpenLayers.Util.extend(c, this.context);
4407      for (var d in this.propertyStyles) a[d] = OpenLayers.Style.createLiteral(a[d], c, b, d);
4408      return a;
4409  },
4410  findPropertyStyles: function () {
4411      var a = {};
4412      this.addPropertyStyles(a, this.defaultStyle);
4413      for (var b = this.rules, c, d, e = 0, f = b.length; e < f; e++) {
4414          c = b[e].symbolizer;
4415          for (var g in c)
4416              if (((d = c[g]), "object" == typeof d)) this.addPropertyStyles(a, d);
4417              else {
4418                  this.addPropertyStyles(a, c);
4419                  break;
4420              }
4421      }
4422      return a;
4423  },
4424  addPropertyStyles: function (a, b) {
4425      var c, d;
4426      for (d in b) (c = b[d]), "string" == typeof c && c.match(/\$\{\w+\}/) && (a[d] = !0);
4427      return a;
4428  },
4429  addRules: function (a) {
4430      Array.prototype.push.apply(this.rules, a);
4431      this.propertyStyles = this.findPropertyStyles();
4432  },
4433  setDefaultStyle: function (a) {
4434      this.defaultStyle = a;
4435      this.propertyStyles = this.findPropertyStyles();
4436  },
4437  getSymbolizerPrefix: function (a) {
4438      for (var b = OpenLayers.Style.SYMBOLIZER_PREFIXES, c = 0, d = b.length; c < d; c++) if (-1 != a.CLASS_NAME.indexOf(b[c])) return b[c];
4439  },
4440  clone: function () {
4441      var a = OpenLayers.Util.extend({}, this);
4442      if (this.rules) {
4443          a.rules = [];
4444          for (var b = 0, c = this.rules.length; b < c; ++b) a.rules.push(this.rules[b].clone());
4445      }
4446      a.context = this.context && OpenLayers.Util.extend({}, this.context);
4447      b = OpenLayers.Util.extend({}, this.defaultStyle);
4448      return new OpenLayers.Style(b, a);
4449  },
4450  CLASS_NAME: "OpenLayers.Style",
4451});
4452OpenLayers.Style.createLiteral = function (a, b, c, d) {
4453  "string" == typeof a && -1 != a.indexOf("${") && ((a = OpenLayers.String.format(a, b, [c, d])), (a = isNaN(a) || !a ? a : parseFloat(a)));
4454  return a;
4455};
4456OpenLayers.Style.SYMBOLIZER_PREFIXES = ["Point", "Line", "Polygon", "Text", "Raster"];
4457OpenLayers.Filter = OpenLayers.Class({
4458  initialize: function (a) {
4459      OpenLayers.Util.extend(this, a);
4460  },
4461  destroy: function () {},
4462  evaluate: function (a) {
4463      return !0;
4464  },
4465  clone: function () {
4466      return null;
4467  },
4468  toString: function () {
4469      return OpenLayers.Format && OpenLayers.Format.CQL ? OpenLayers.Format.CQL.prototype.write(this) : Object.prototype.toString.call(this);
4470  },
4471  CLASS_NAME: "OpenLayers.Filter",
4472});
4473OpenLayers.Filter.Spatial = OpenLayers.Class(OpenLayers.Filter, {
4474  type: null,
4475  property: null,
4476  value: null,
4477  distance: null,
4478  distanceUnits: null,
4479  evaluate: function (a) {
4480      var b = !1;
4481      switch (this.type) {
4482          case OpenLayers.Filter.Spatial.BBOX:
4483          case OpenLayers.Filter.Spatial.INTERSECTS:
4484              if (a.geometry) {
4485                  var c = this.value;
4486                  "OpenLayers.Bounds" == this.value.CLASS_NAME && (c = this.value.toGeometry());
4487                  a.geometry.intersects(c) && (b = !0);
4488              }
4489              break;
4490          default:
4491              throw Error("evaluate is not implemented for this filter type.");
4492      }
4493      return b;
4494  },
4495  clone: function () {
4496      var a = OpenLayers.Util.applyDefaults({ value: this.value && this.value.clone && this.value.clone() }, this);
4497      return new OpenLayers.Filter.Spatial(a);
4498  },
4499  CLASS_NAME: "OpenLayers.Filter.Spatial",
4500});
4501OpenLayers.Filter.Spatial.BBOX = "BBOX";
4502OpenLayers.Filter.Spatial.INTERSECTS = "INTERSECTS";
4503OpenLayers.Filter.Spatial.DWITHIN = "DWITHIN";
4504OpenLayers.Filter.Spatial.WITHIN = "WITHIN";
4505OpenLayers.Filter.Spatial.CONTAINS = "CONTAINS";
4506OpenLayers.Filter.FeatureId = OpenLayers.Class(OpenLayers.Filter, {
4507  fids: null,
4508  type: "FID",
4509  initialize: function (a) {
4510      this.fids = [];
4511      OpenLayers.Filter.prototype.initialize.apply(this, [a]);
4512  },
4513  evaluate: function (a) {
4514      for (var b = 0, c = this.fids.length; b < c; b++) if ((a.fid || a.id) == this.fids[b]) return !0;
4515      return !1;
4516  },
4517  clone: function () {
4518      var a = new OpenLayers.Filter.FeatureId();
4519      OpenLayers.Util.extend(a, this);
4520      a.fids = this.fids.slice();
4521      return a;
4522  },
4523  CLASS_NAME: "OpenLayers.Filter.FeatureId",
4524});
4525OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
4526  namespaces: {
4527      xlink: "http://www.w3.org/1999/xlink",
4528      xsi: "http://www.w3.org/2001/XMLSchema-instance",
4529      wfs: "http://www.opengis.net/wfs",
4530      gml: "http://www.opengis.net/gml",
4531      ogc: "http://www.opengis.net/ogc",
4532      ows: "http://www.opengis.net/ows",
4533  },
4534  defaultPrefix: "wfs",
4535  version: null,
4536  schemaLocations: null,
4537  srsName: null,
4538  extractAttributes: !0,
4539  xy: !0,
4540  stateName: null,
4541  initialize: function (a) {
4542      this.stateName = {};
4543      this.stateName[OpenLayers.State.INSERT] = "wfs:Insert";
4544      this.stateName[OpenLayers.State.UPDATE] = "wfs:Update";
4545      this.stateName[OpenLayers.State.DELETE] = "wfs:Delete";
4546      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
4547  },
4548  getSrsName: function (a, b) {
4549      var c = b && b.srsName;
4550      c || (c = a && a.layer ? a.layer.projection.getCode() : this.srsName);
4551      return c;
4552  },
4553  read: function (a, b) {
4554      b = b || {};
4555      OpenLayers.Util.applyDefaults(b, { output: "features" });
4556      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
4557      a && 9 == a.nodeType && (a = a.documentElement);
4558      var c = {};
4559      a && this.readNode(a, c, !0);
4560      c.features && "features" === b.output && (c = c.features);
4561      return c;
4562  },
4563  readers: {
4564      wfs: {
4565          FeatureCollection: function (a, b) {
4566              b.features = [];
4567              this.readChildNodes(a, b);
4568          },
4569      },
4570  },
4571  write: function (a, b) {
4572      var c = this.writeNode("wfs:Transaction", { features: a, options: b }),
4573          d = this.schemaLocationAttr();
4574      d && this.setAttributeNS(c, this.namespaces.xsi, "xsi:schemaLocation", d);
4575      return OpenLayers.Format.XML.prototype.write.apply(this, [c]);
4576  },
4577  writers: {
4578      wfs: {
4579          GetFeature: function (a) {
4580              var b = this.createElementNSPlus("wfs:GetFeature", {
4581                  attributes: { service: "WFS", version: this.version, handle: a && a.handle, outputFormat: a && a.outputFormat, maxFeatures: a && a.maxFeatures, "xsi:schemaLocation": this.schemaLocationAttr(a) },
4582              });
4583              if ("string" == typeof this.featureType) this.writeNode("Query", a, b);
4584              else for (var c = 0, d = this.featureType.length; c < d; c++) (a.featureType = this.featureType[c]), this.writeNode("Query", a, b);
4585              return b;
4586          },
4587          Transaction: function (a) {
4588              a = a || {};
4589              var b = a.options || {},
4590                  c = this.createElementNSPlus("wfs:Transaction", { attributes: { service: "WFS", version: this.version, handle: b.handle } }),
4591                  d,
4592                  e = a.features;
4593              if (e) {
4594                  !0 === b.multi &&
4595                      OpenLayers.Util.extend(this.geometryTypes, {
4596                          "OpenLayers.Geometry.Point": "MultiPoint",
4597                          "OpenLayers.Geometry.LineString": !0 === this.multiCurve ? "MultiCurve" : "MultiLineString",
4598                          "OpenLayers.Geometry.Polygon": !0 === this.multiSurface ? "MultiSurface" : "MultiPolygon",
4599                      });
4600                  var f, g;
4601                  a = 0;
4602                  for (d = e.length; a < d; ++a) (g = e[a]), (f = this.stateName[g.state]) && this.writeNode(f, { feature: g, options: b }, c);
4603                  !0 === b.multi && this.setGeometryTypes();
4604              }
4605              if (b.nativeElements) for (a = 0, d = b.nativeElements.length; a < d; ++a) this.writeNode("wfs:Native", b.nativeElements[a], c);
4606              return c;
4607          },
4608          Native: function (a) {
4609              return this.createElementNSPlus("wfs:Native", { attributes: { vendorId: a.vendorId, safeToIgnore: a.safeToIgnore }, value: a.value });
4610          },
4611          Insert: function (a) {
4612              var b = a.feature;
4613              a = a.options;
4614              a = this.createElementNSPlus("wfs:Insert", { attributes: { handle: a && a.handle } });
4615              this.srsName = this.getSrsName(b);
4616              this.writeNode("feature:_typeName", b, a);
4617              return a;
4618          },
4619          Update: function (a) {
4620              var b = a.feature;
4621              a = a.options;
4622              a = this.createElementNSPlus("wfs:Update", { attributes: { handle: a && a.handle, typeName: (this.featureNS ? this.featurePrefix + ":" : "") + this.featureType } });
4623              this.featureNS && a.setAttribute("xmlns:" + this.featurePrefix, this.featureNS);
4624              var c = b.modified;
4625              null === this.geometryName || (c && void 0 === c.geometry) || ((this.srsName = this.getSrsName(b)), this.writeNode("Property", { name: this.geometryName, value: b.geometry }, a));
4626              for (var d in b.attributes) void 0 === b.attributes[d] || (c && c.attributes && (!c.attributes || void 0 === c.attributes[d])) || this.writeNode("Property", { name: d, value: b.attributes[d] }, a);
4627              this.writeNode("ogc:Filter", new OpenLayers.Filter.FeatureId({ fids: [b.fid] }), a);
4628              return a;
4629          },
4630          Property: function (a) {
4631              var b = this.createElementNSPlus("wfs:Property");
4632              this.writeNode("Name", a.name, b);
4633              null !== a.value && this.writeNode("Value", a.value, b);
4634              return b;
4635          },
4636          Name: function (a) {
4637              return this.createElementNSPlus("wfs:Name", { value: a });
4638          },
4639          Value: function (a) {
4640              var b;
4641              a instanceof OpenLayers.Geometry ? ((b = this.createElementNSPlus("wfs:Value")), (a = this.writeNode("feature:_geometry", a).firstChild), b.appendChild(a)) : (b = this.createElementNSPlus("wfs:Value", { value: a }));
4642              return b;
4643          },
4644          Delete: function (a) {
4645              var b = a.feature;
4646              a = a.options;
4647              a = this.createElementNSPlus("wfs:Delete", { attributes: { handle: a && a.handle, typeName: (this.featureNS ? this.featurePrefix + ":" : "") + this.featureType } });
4648              this.featureNS && a.setAttribute("xmlns:" + this.featurePrefix, this.featureNS);
4649              this.writeNode("ogc:Filter", new OpenLayers.Filter.FeatureId({ fids: [b.fid] }), a);
4650              return a;
4651          },
4652      },
4653  },
4654  schemaLocationAttr: function (a) {
4655      a = OpenLayers.Util.extend({ featurePrefix: this.featurePrefix, schema: this.schema }, a);
4656      var b = OpenLayers.Util.extend({}, this.schemaLocations);
4657      a.schema && (b[a.featurePrefix] = a.schema);
4658      a = [];
4659      var c, d;
4660      for (d in b) (c = this.namespaces[d]) && a.push(c + " " + b[d]);
4661      return a.join(" ") || void 0;
4662  },
4663  setFilterProperty: function (a) {
4664      if (a.filters) for (var b = 0, c = a.filters.length; b < c; ++b) OpenLayers.Format.WFST.v1.prototype.setFilterProperty.call(this, a.filters[b]);
4665      else a instanceof OpenLayers.Filter.Spatial && !a.property && (a.property = this.geometryName);
4666  },
4667  CLASS_NAME: "OpenLayers.Format.WFST.v1",
4668});
4669OpenLayers.Format.OGCExceptionReport = OpenLayers.Class(OpenLayers.Format.XML, {
4670  namespaces: { ogc: "http://www.opengis.net/ogc" },
4671  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
4672  defaultPrefix: "ogc",
4673  read: function (a) {
4674      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
4675      var b = { exceptionReport: null };
4676      a.documentElement && (this.readChildNodes(a, b), null === b.exceptionReport && (b = new OpenLayers.Format.OWSCommon().read(a)));
4677      return b;
4678  },
4679  readers: {
4680      ogc: {
4681          ServiceExceptionReport: function (a, b) {
4682              b.exceptionReport = { exceptions: [] };
4683              this.readChildNodes(a, b.exceptionReport);
4684          },
4685          ServiceException: function (a, b) {
4686              var c = { code: a.getAttribute("code"), locator: a.getAttribute("locator"), text: this.getChildValue(a) };
4687              b.exceptions.push(c);
4688          },
4689      },
4690  },
4691  CLASS_NAME: "OpenLayers.Format.OGCExceptionReport",
4692});
4693OpenLayers.Format.XML.VersionedOGC = OpenLayers.Class(OpenLayers.Format.XML, {
4694  defaultVersion: null,
4695  version: null,
4696  profile: null,
4697  allowFallback: !1,
4698  name: null,
4699  stringifyOutput: !1,
4700  parser: null,
4701  initialize: function (a) {
4702      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
4703      a = this.CLASS_NAME;
4704      this.name = a.substring(a.lastIndexOf(".") + 1);
4705  },
4706  getVersion: function (a, b) {
4707      var c;
4708      a ? ((c = this.version), c || ((c = a.getAttribute("version")), c || (c = this.defaultVersion))) : (c = (b && b.version) || this.version || this.defaultVersion);
4709      return c;
4710  },
4711  getParser: function (a) {
4712      a = a || this.defaultVersion;
4713      var b = this.profile ? "_" + this.profile : "";
4714      if (!this.parser || this.parser.VERSION != a) {
4715          var c = OpenLayers.Format[this.name]["v" + a.replace(/\./g, "_") + b];
4716          if (!c && ("" !== b && this.allowFallback && ((b = ""), (c = OpenLayers.Format[this.name]["v" + a.replace(/\./g, "_")])), !c)) throw "Can't find a " + this.name + " parser for version " + a + b;
4717          this.parser = new c(this.options);
4718      }
4719      return this.parser;
4720  },
4721  write: function (a, b) {
4722      var c = this.getVersion(null, b);
4723      this.parser = this.getParser(c);
4724      c = this.parser.write(a, b);
4725      return !1 === this.stringifyOutput ? c : OpenLayers.Format.XML.prototype.write.apply(this, [c]);
4726  },
4727  read: function (a, b) {
4728      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
4729      var c = this.getVersion(a.documentElement);
4730      this.parser = this.getParser(c);
4731      var d = this.parser.read(a, b),
4732          e = this.parser.errorProperty || null;
4733      null !== e && void 0 === d[e] && ((e = new OpenLayers.Format.OGCExceptionReport()), (d.error = e.read(a)));
4734      d.version = c;
4735      return d;
4736  },
4737  CLASS_NAME: "OpenLayers.Format.XML.VersionedOGC",
4738});
4739OpenLayers.Filter.Logical = OpenLayers.Class(OpenLayers.Filter, {
4740  filters: null,
4741  type: null,
4742  initialize: function (a) {
4743      this.filters = [];
4744      OpenLayers.Filter.prototype.initialize.apply(this, [a]);
4745  },
4746  destroy: function () {
4747      this.filters = null;
4748      OpenLayers.Filter.prototype.destroy.apply(this);
4749  },
4750  evaluate: function (a) {
4751      var b, c;
4752      switch (this.type) {
4753          case OpenLayers.Filter.Logical.AND:
4754              b = 0;
4755              for (c = this.filters.length; b < c; b++) if (!1 == this.filters[b].evaluate(a)) return !1;
4756              return !0;
4757          case OpenLayers.Filter.Logical.OR:
4758              b = 0;
4759              for (c = this.filters.length; b < c; b++) if (!0 == this.filters[b].evaluate(a)) return !0;
4760              return !1;
4761          case OpenLayers.Filter.Logical.NOT:
4762              return !this.filters[0].evaluate(a);
4763      }
4764  },
4765  clone: function () {
4766      for (var a = [], b = 0, c = this.filters.length; b < c; ++b) a.push(this.filters[b].clone());
4767      return new OpenLayers.Filter.Logical({ type: this.type, filters: a });
4768  },
4769  CLASS_NAME: "OpenLayers.Filter.Logical",
4770});
4771OpenLayers.Filter.Logical.AND = "&&";
4772OpenLayers.Filter.Logical.OR = "||";
4773OpenLayers.Filter.Logical.NOT = "!";
4774OpenLayers.Filter.Comparison = OpenLayers.Class(OpenLayers.Filter, {
4775  type: null,
4776  property: null,
4777  value: null,
4778  matchCase: !0,
4779  lowerBoundary: null,
4780  upperBoundary: null,
4781  initialize: function (a) {
4782      OpenLayers.Filter.prototype.initialize.apply(this, [a]);
4783      this.type === OpenLayers.Filter.Comparison.LIKE && void 0 === a.matchCase && (this.matchCase = null);
4784  },
4785  evaluate: function (a) {
4786      a instanceof OpenLayers.Feature.Vector && (a = a.attributes);
4787      var b = !1;
4788      a = a[this.property];
4789      switch (this.type) {
4790          case OpenLayers.Filter.Comparison.EQUAL_TO:
4791              b = this.value;
4792              b = this.matchCase || "string" != typeof a || "string" != typeof b ? a == b : a.toUpperCase() == b.toUpperCase();
4793              break;
4794          case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:
4795              b = this.value;
4796              b = this.matchCase || "string" != typeof a || "string" != typeof b ? a != b : a.toUpperCase() != b.toUpperCase();
4797              break;
4798          case OpenLayers.Filter.Comparison.LESS_THAN:
4799              b = a < this.value;
4800              break;
4801          case OpenLayers.Filter.Comparison.GREATER_THAN:
4802              b = a > this.value;
4803              break;
4804          case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:
4805              b = a <= this.value;
4806              break;
4807          case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:
4808              b = a >= this.value;
4809              break;
4810          case OpenLayers.Filter.Comparison.BETWEEN:
4811              b = a >
4811= this.lowerBoundary && a <= this.upperBoundary;
4812              break;
4813          case OpenLayers.Filter.Comparison.LIKE:
4814              b = RegExp(this.value, "gi").test(a);
4815              break;
4816          case OpenLayers.Filter.Comparison.IS_NULL:
4817              b = null === a;
4818      }
4819      return b;
4820  },
4821  value2regex: function (a, b, c) {
4822      if ("." == a) throw Error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison");
4823      a = a ? a : "*";
4824      b = b ? b : ".";
4825      this.value = this.value.replace(RegExp("\\" + (c ? c : "!") + "(.|$)", "g"), "\\$1");
4826      this.value = this.value.replace(RegExp("\\" + b, "g"), ".");
4827      this.value = this.value.replace(RegExp("\\" + a, "g"), ".*");
4828      this.value = this.value.replace(RegExp("\\\\.\\*", "g"), "\\" + a);
4829      return (this.value = this.value.replace(RegExp("\\\\\\.", "g"), "\\" + b));
4830  },
4831  regex2value: function () {
4832      var a = this.value,
4833          a = a.replace(/!/g, "!!"),
4834          a = a.replace(/(\\)?\\\./g, function (a, c) {
4835              return c ? a : "!.";
4836          }),
4837          a = a.replace(/(\\)?\\\*/g, function (a, c) {
4838              return c ? a : "!*";
4839          }),
4840          a = a.replace(/\\\\/g, "\\");
4841      return (a = a.replace(/\.\*/g, "*"));
4842  },
4843  clone: function () {
4844      return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison(), this);
4845  },
4846  CLASS_NAME: "OpenLayers.Filter.Comparison",
4847});
4848OpenLayers.Filter.Comparison.EQUAL_TO = "==";
4849OpenLayers.Filter.Comparison.NOT_EQUAL_TO = "!=";
4850OpenLayers.Filter.Comparison.LESS_THAN = "<";
4851OpenLayers.Filter.Comparison.GREATER_THAN = ">";
4852OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO = "<=";
4853OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO = ">=";
4854OpenLayers.Filter.Comparison.BETWEEN = "..";
4855OpenLayers.Filter.Comparison.LIKE = "~";
4856OpenLayers.Filter.Comparison.IS_NULL = "NULL";
4857OpenLayers.Format.Filter = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { defaultVersion: "1.0.0", CLASS_NAME: "OpenLayers.Format.Filter" });
4858OpenLayers.Filter.Function = OpenLayers.Class(OpenLayers.Filter, { name: null, params: null, CLASS_NAME: "OpenLayers.Filter.Function" });
4859OpenLayers.Date = {
4860  dateRegEx: /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/,
4861  toISOString: (function () {
4862      return "toISOString" in Date.prototype
4863          ? function (a) {
4864                return a.toISOString();
4865            }
4866          : function (a) {
4867                return isNaN(a.getTime())
4868                    ? "Invalid Date"
4869                    : a.getUTCFullYear() +
4870                          "-" +
4871                          OpenLayers.Number.zeroPad(a.getUTCMonth() + 1, 2) +
4872                          "-" +
4873                          OpenLayers.Number.zeroPad(a.getUTCDate(), 2) +
4874                          "T" +
4875                          OpenLayers.Number.zeroPad(a.getUTCHours(), 2) +
4876                          ":" +
4877                          OpenLayers.Number.zeroPad(a.getUTCMinutes(), 2) +
4878                          ":" +
4879                          OpenLayers.Number.zeroPad(a.getUTCSeconds(), 2) +
4880                          "." +
4881                          OpenLayers.Number.zeroPad(a.getUTCMilliseconds(), 3) +
4882                          "Z";
4883            };
4884  })(),
4885  parse: function (a) {
4886      var b;
4887      if ((a = a.match(this.dateRegEx)) && (a[1] || a[7])) {
4888          b = parseInt(a[1], 10) || 0;
4889          var c = parseInt(a[2], 10) - 1 || 0,
4890              d = parseInt(a[3], 10) || 1;
4891          b = new Date(Date.UTC(b, c, d));
4892          if ((c = a[7])) {
4893              var d = parseInt(a[4], 10),
4894                  e = parseInt(a[5], 10),
4895                  f = parseFloat(a[6]),
4896                  g = f | 0,
4897                  f = Math.round(1e3 * (f - g));
4898              b.setUTCHours(d, e, g, f);
4899              "Z" !== c && ((c = parseInt(c, 10)), (a = parseInt(a[8], 10) || 0), (a = -1e3 * (60 * 60 * c + 60 * a)), (b = new Date(b.getTime() + a)));
4900          }
4901      } else b = new Date("invalid");
4902      return b;
4903  },
4904};
4905OpenLayers.Format.Filter.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
4906  namespaces: { ogc: "http://www.opengis.net/ogc", gml: "http://www.opengis.net/gml", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
4907  defaultPrefix: "ogc",
4908  schemaLocation: null,
4909  initialize: function (a) {
4910      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
4911  },
4912  read: function (a) {
4913      var b = {};
4914      this.readers.ogc.Filter.apply(this, [a, b]);
4915      return b.filter;
4916  },
4917  readers: {
4918      ogc: {
4919          _expression: function (a) {
4920              for (var b = "", c = a.firstChild; c; c = c.nextSibling)
4921                  switch (c.nodeType) {
4922                      case 1:
4923                          a = this.readNode(c);
4924                          a.property ? (b += "${" + a.property + "}") : void 0 !== a.value && (b += a.value);
4925                          break;
4926                      case 3:
4927                      case 4:
4928                          b += c.nodeValue;
4929                  }
4930              return b;
4931          },
4932          Filter: function (a, b) {
4933              var c = { fids: [], filters: [] };
4934              this.readChildNodes(a, c);
4935              0 < c.fids.length ? (b.filter = new OpenLayers.Filter.FeatureId({ fids: c.fids })) : 0 < c.filters.length && (b.filter = c.filters[0]);
4936          },
4937          FeatureId: function (a, b) {
4938              var c = a.getAttribute("fid");
4939              c && b.fids.push(c);
4940          },
4941          And: function (a, b) {
4942              var c = new OpenLayers.Filter.Logical({ type: OpenLayers.Filter.Logical.AND });
4943              this.readChildNodes(a, c);
4944              b.filters.push(c);
4945          },
4946          Or: function (a, b) {
4947              var c = new OpenLayers.Filter.Logical({ type: OpenLayers.Filter.Logical.OR });
4948              this.readChildNodes(a, c);
4949              b.filters.push(c);
4950          },
4951          Not: function (a, b) {
4952              var c = new OpenLayers.Filter.Logical({ type: OpenLayers.Filter.Logical.NOT });
4953              this.readChildNodes(a, c);
4954              b.filters.push(c);
4955          },
4956          PropertyIsLessThan: function (a, b) {
4957              var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.LESS_THAN });
4958              this.readChildNodes(a, c);
4959              b.filters.push(c);
4960          },
4961          PropertyIsGreaterThan: function (a, b) {
4962              var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.GREATER_THAN });
4963              this.readChildNodes(a, c);
4964              b.filters.push(c);
4965          },
4966          PropertyIsLessThanOrEqualTo: function (a, b) {
4967              var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO });
4968              this.readChildNodes(a, c);
4969              b.filters.push(c);
4970          },
4971          PropertyIsGreaterThanOrEqualTo: function (a, b) {
4972              var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO });
4973              this.readChildNodes(a, c);
4974              b.filters.push(c);
4975          },
4976          PropertyIsBetween: function (a, b) {
4977              var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.BETWEEN });
4978              this.readChildNodes(a, c);
4979              b.filters.push(c);
4980          },
4981          Literal: function (a, b) {
4982              b.value = OpenLayers.String.numericIf(this.getChildValue(a), !0);
4983          },
4984          PropertyName: function (a, b) {
4985              b.property = this.getChildValue(a);
4986          },
4987          LowerBoundary: function (a, b) {
4988              b.lowerBoundary = OpenLayers.String.numericIf(this.readers.ogc._expression.call(this, a), !0);
4989          },
4990          UpperBoundary: function (a, b) {
4991              b.upperBoundary = OpenLayers.String.numericIf(this.readers.ogc._expression.call(this, a), !0);
4992          },
4993          Intersects: function (a, b) {
4994              this.readSpatial(a, b, OpenLayers.Filter.Spatial.INTERSECTS);
4995          },
4996          Within: function (a, b) {
4997              this.readSpatial(a, b, OpenLayers.Filter.Spatial.WITHIN);
4998          },
4999          Contains: function (a, b) {
5000              this.readSpatial(a, b, OpenLayers.Filter.Spatial.CONTAINS);
5001          },
5002          DWithin: function (a, b) {
5003              this.readSpatial(a, b, OpenLayers.Filter.Spatial.DWITHIN);
5004          },
5005          Distance: function (a, b) {
5006              b.distance = parseInt(this.getChildValue(a));
5007              b.distanceUnits = a.getAttribute("units");
5008          },
5009          Function: function (a, b) {},
5010          PropertyIsNull: function (a, b) {
5011              var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.IS_NULL });
5012              this.readChildNodes(a, c);
5013              b.filters.push(c);
5014          },
5015      },
5016  },
5017  readSpatial: function (a, b, c) {
5018      c = new OpenLayers.Filter.Spatial({ type: c });
5019      this.readChildNodes(a, c);
5020      c.value = c.components[0];
5021      delete c.components;
5022      b.filters.push(c);
5023  },
5024  encodeLiteral: function (a) {
5025      a instanceof Date && (a = OpenLayers.Date.toISOString(a));
5026      return a;
5027  },
5028  writeOgcExpression: function (a, b) {
5029      a instanceof OpenLayers.Filter.Function ? this.writeNode("Function", a, b) : this.writeNode("Literal", a, b);
5030      return b;
5031  },
5032  write: function (a) {
5033      return this.writers.ogc.Filter.apply(this, [a]);
5034  },
5035  writers: {
5036      ogc: {
5037          Filter: function (a) {
5038              var b = this.createElementNSPlus("ogc:Filter");
5039              this.writeNode(this.getFilterType(a), a, b);
5040              return b;
5041          },
5042          _featureIds: function (a) {
5043              for (var b = this.createDocumentFragment(), c = 0, d = a.fids.length; c < d; ++c) this.writeNode("ogc:FeatureId", a.fids[c], b);
5044              return b;
5045          },
5046          FeatureId: function (a) {
5047              return this.createElementNSPlus("ogc:FeatureId", { attributes: { fid: a } });
5048          },
5049          And: function (a) {
5050              for (var b = this.createElementNSPlus("ogc:And"), c, d = 0, e = a.filters.length; d < e; ++d) (c = a.filters[d]), this.writeNode(this.getFilterType(c), c, b);
5051              return b;
5052          },
5053          Or: function (a) {
5054              for (var b = this.createElementNSPlus("ogc:Or"), c, d = 0, e = a.filters.length; d < e; ++d) (c = a.filters[d]), this.writeNode(this.getFilterType(c), c, b);
5055              return b;
5056          },
5057          Not: function (a) {
5058              var b = this.createElementNSPlus("ogc:Not");
5059              a = a.filters[0];
5060              this.writeNode(this.getFilterType(a), a, b);
5061              return b;
5062          },
5063          PropertyIsLessThan: function (a) {
5064              var b = this.createElementNSPlus("ogc:PropertyIsLessThan");
5065              this.writeNode("PropertyName", a, b);
5066              this.writeOgcExpression(a.value, b);
5067              return b;
5068          },
5069          PropertyIsGreaterThan: function (a) {
5070              var b = this.createElementNSPlus("ogc:PropertyIsGreaterThan");
5071              this.writeNode("PropertyName", a, b);
5072              this.writeOgcExpression(a.value, b);
5073              return b;
5074          },
5075          PropertyIsLessThanOrEqualTo: function (a) {
5076              var b = this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");
5077              this.writeNode("PropertyName", a, b);
5078              this.writeOgcExpression(a.value, b);
5079              return b;
5080          },
5081          PropertyIsGreaterThanOrEqualTo: function (a) {
5082              var b = this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");
5083              this.writeNode("PropertyName", a, b);
5084              this.writeOgcExpression(a.value, b);
5085              return b;
5086          },
5087          PropertyIsBetween: function (a) {
5088              var b = this.createElementNSPlus("ogc:PropertyIsBetween");
5089              this.writeNode("PropertyName", a, b);
5090              this.writeNode("LowerBoundary", a, b);
5091              this.writeNode("UpperBoundary", a, b);
5092              return b;
5093          },
5094          PropertyName: function (a) {
5095              return this.createElementNSPlus("ogc:PropertyName", { value: a.property });
5096          },
5097          Literal: function (a) {
5098              return this.createElementNSPlus("ogc:Literal", { value: (this.encodeLiteral || OpenLayers.Format.Filter.v1.prototype.encodeLiteral)(a) });
5099          },
5100          LowerBoundary: function (a) {
5101              var b = this.createElementNSPlus("ogc:LowerBoundary");
5102              this.writeOgcExpression(a.lowerBoundary, b);
5103              return b;
5104          },
5105          UpperBoundary: function (a) {
5106              var b = this.createElementNSPlus("ogc:UpperBoundary");
5107              this.writeNode("Literal", a.upperBoundary, b);
5108              return b;
5109          },
5110          INTERSECTS: function (a) {
5111              return this.writeSpatial(a, "Intersects");
5112          },
5113          WITHIN: function (a) {
5114              return this.writeSpatial(a, "Within");
5115          },
5116          CONTAINS: function (a) {
5117              return this.writeSpatial(a, "Contains");
5118          },
5119          DWITHIN: function (a) {
5120              var b = this.writeSpatial(a, "DWithin");
5121              this.writeNode("Distance", a, b);
5122              return b;
5123          },
5124          Distance: function (a) {
5125              return this.createElementNSPlus("ogc:Distance", { attributes: { units: a.distanceUnits }, value: a.distance });
5126          },
5127          Function: function (a) {
5128              var b = this.createElementNSPlus("ogc:Function", { attributes: { name: a.name } });
5129              a = a.params;
5130              for (var c = 0, d = a.length; c < d; c++) this.writeOgcExpression(a[c], b);
5131              return b;
5132          },
5133          PropertyIsNull: function (a) {
5134              var b = this.createElementNSPlus("ogc:PropertyIsNull");
5135              this.writeNode("PropertyName", a, b);
5136              return b;
5137          },
5138      },
5139  },
5140  getFilterType: function (a) {
5141      var b = this.filterMap[a.type];
5142      if (!b) throw "Filter writing not supported for rule type: " + a.type;
5143      return b;
5144  },
5145  filterMap: {
5146      "&&": "And",
5147      "||": "Or",
5148      "!": "Not",
5149      "==": "PropertyIsEqualTo",
5150      "!=": "PropertyIsNotEqualTo",
5151      "<": "PropertyIsLessThan",
5152      ">": "PropertyIsGreaterThan",
5153      "<=": "PropertyIsLessThanOrEqualTo",
5154      ">=": "PropertyIsGreaterThanOrEqualTo",
5155      "..": "PropertyIsBetween",
5156      "~": "PropertyIsLike",
5157      NULL: "PropertyIsNull",
5158      BBOX: "BBOX",
5159      DWITHIN: "DWITHIN",
5160      WITHIN: "WITHIN",
5161      CONTAINS: "CONTAINS",
5162      INTERSECTS: "INTERSECTS",
5163      FID: "_featureIds",
5164  },
5165  CLASS_NAME: "OpenLayers.Format.Filter.v1",
5166});
5167OpenLayers.Geometry = OpenLayers.Class({
5168  id: null,
5169  parent: null,
5170  bounds: null,
5171  initialize: function () {
5172      this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
5173  },
5174  destroy: function () {
5175      this.bounds = this.id = null;
5176  },
5177  clone: function () {
5178      return new OpenLayers.Geometry();
5179  },
5180  setBounds: function (a) {
5181      a && (this.bounds = a.clone());
5182  },
5183  clearBounds: function () {
5184      this.bounds = null;
5185      this.parent && this.parent.clearBounds();
5186  },
5187  extendBounds: function (a) {
5188      this.getBounds() ? this.bounds.extend(a) : this.setBounds(a);
5189  },
5190  getBounds: function () {
5191      null == this.bounds && this.calculateBounds();
5192      return this.bounds;
5193  },
5194  calculateBounds: function () {},
5195  distanceTo: function (a, b) {},
5196  getVertices: function (a) {},
5197  atPoint: function (a, b, c) {
5198      var d = !1;
5199      null != this.getBounds() && null != a && ((b = null != b ? b : 0), (c = null != c ? c : 0), (d = new OpenLayers.Bounds(this.bounds.left - b, this.bounds.bottom - c, this.bounds.right + b, this.bounds.top + c).containsLonLat(a)));
5200      return d;
5201  },
5202  getLength: function () {
5203      return 0;
5204  },
5205  getArea: function () {
5206      return 0;
5207  },
5208  getCentroid: function () {
5209      return null;
5210  },
5211  toString: function () {
5212      return OpenLayers.Format && OpenLayers.Format.WKT ? OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this)) : Object.prototype.toString.call(this);
5213  },
5214  CLASS_NAME: "OpenLayers.Geometry",
5215});
5216OpenLayers.Geometry.fromWKT = function (a) {
5217  var b;
5218  if (OpenLayers.Format && OpenLayers.Format.WKT) {
5219      var c = OpenLayers.Geometry.fromWKT.format;
5220      c || ((c = new OpenLayers.Format.WKT()), (OpenLayers.Geometry.fromWKT.format = c));
5221      a = c.read(a);
5222      if (a instanceof OpenLayers.Feature.Vector) b = a.geometry;
5223      else if (OpenLayers.Util.isArray(a)) {
5224          b = a.length;
5225          for (var c = Array(b), d = 0; d < b; ++d) c[d] = a[d].geometry;
5226          b = new OpenLayers.Geometry.Collection(c);
5227      }
5228  }
5229  return b;
5230};
5231OpenLayers.Geometry.segmentsIntersect = function (a, b, c) {
5232  var d = c && c.point;
5233  c = c && c.tolerance;
5234  var e = !1,
5235      f = a.x1 - b.x1,
5236      g = a.y1 - b.y1,
5237      h = a.x2 - a.x1,
5238      k = a.y2 - a.y1,
5239      l = b.y2 - b.y1,
5240      m = b.x2 - b.x1,
5241      n = l * h - m * k,
5242      l = m * g - l * f,
5243      g = h * g - k * f;
5244  0 == n ? 0 == l && 0 == g && (e = !0) : ((f = l / n), (n = g / n), 0 <= f && 1 >= f && 0 <= n && 1 >= n && (d ? ((h = a.x1 + f * h), (n = a.y1 + f * k), (e = new OpenLayers.Geometry.Point(h, n))) : (e = !0)));
5245  if (c)
5246      if (e) {
5247          if (d)
5248              a: for (a = [a, b], b = 0; 2 > b; ++b)
5249                  for (f = a[b], k = 1; 3 > k; ++k)
5250                      if (((h = f["x" + k]), (n = f["y" + k]), (d = Math.sqrt(Math.pow(h - e.x, 2) + Math.pow(n - e.y, 2))), d < c)) {
5251                          e.x = h;
5252                          e.y = n;
5253                          break a;
5254                      }
5255      } else
5256          a: for (a = [a, b], b = 0; 2 > b; ++b)
5257              for (h = a[b], n = a[(b + 1) % 2], k = 1; 3 > k; ++k)
5258                  if (((f = { x: h["x" + k], y: h["y" + k] }), (g = OpenLayers.Geometry.distanceToSegment(f, n)), g.distance < c)) {
5259                      e = d ? new OpenLayers.Geometry.Point(f.x, f.y) : !0;
5260                      break a;
5261                  }
5262  return e;
5263};
5264OpenLayers.Geometry.distanceToSegment = function (a, b) {
5265  var c = OpenLayers.Geometry.distanceSquaredToSegment(a, b);
5266  c.distance = Math.sqrt(c.distance);
5267  return c;
5268};
5269OpenLayers.Geometry.distanceSquaredToSegment = function (a, b) {
5270  var c = a.x,
5271      d = a.y,
5272      e = b.x1,
5273      f = b.y1,
5274      g = b.x2,
5275      h = b.y2,
5276      k = g - e,
5277      l = h - f,
5278      m = (k * (c - e) + l * (d - f)) / (Math.pow(k, 2) + Math.pow(l, 2));
5279  0 >= m || (1 <= m ? ((e = g), (f = h)) : ((e += m * k), (f += m * l)));
5280  return { distance: Math.pow(e - c, 2) + Math.pow(f - d, 2), x: e, y: f, along: m };
5281};
5282OpenLayers.Geometry.Point = OpenLayers.Class(OpenLayers.Geometry, {
5283  x: null,
5284  y: null,
5285  initialize: function (a, b) {
5286      OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
5287      this.x = parseFloat(a);
5288      this.y = parseFloat(b);
5289  },
5290  clone: function (a) {
5291      null == a && (a = new OpenLayers.Geometry.Point(this.x, this.y));
5292      OpenLayers.Util.applyDefaults(a, this);
5293      return a;
5294  },
5295  calculateBounds: function () {
5296      this.bounds = new OpenLayers.Bounds(this.x, this.y, this.x, this.y);
5297  },
5298  distanceTo: function (a, b) {
5299      var c = !(b && !1 === b.edge) && b && b.details,
5300          d,
5301          e,
5302          f,
5303          g,
5304          h;
5305      a instanceof OpenLayers.Geometry.Point
5306          ? ((e = this.x), (f = this.y), (g = a.x), (h = a.y), (d = Math.sqrt(Math.pow(e - g, 2) + Math.pow(f - h, 2))), (d = c ? { x0: e, y0: f, x1: g, y1: h, distance: d } : d))
5307          : ((d = a.distanceTo(this, b)), c && (d = { x0: d.x1, y0: d.y1, x1: d.x0, y1: d.y0, distance: d.distance }));
5308      return d;
5309  },
5310  equals: function (a) {
5311      var b = !1;
5312      null != a && (b = (this.x == a.x && this.y == a.y) || (isNaN(this.x) && isNaN(this.y) && isNaN(a.x) && isNaN(a.y)));
5313      return b;
5314  },
5315  toShortString: function () {
5316      return this.x + ", " + this.y;
5317  },
5318  move: function (a, b) {
5319      this.x += a;
5320      this.y += b;
5321      this.clearBounds();
5322  },
5323  rotate: function (a, b) {
5324      a *= Math.PI / 180;
5325      var c = this.distanceTo(b),
5326          d = a + Math.atan2(this.y - b.y, this.x - b.x);
5327      this.x = b.x + c * Math.cos(d);
5328      this.y = b.y + c * Math.sin(d);
5329      this.clearBounds();
5330  },
5331  getCentroid: function () {
5332      return new OpenLayers.Geometry.Point(this.x, this.y);
5333  },
5334  resize: function (a, b, c) {
5335      this.x = b.x + a * (void 0 == c ? 1 : c) * (this.x - b.x);
5336      this.y = b.y + a * (this.y - b.y);
5337      this.clearBounds();
5338      return this;
5339  },
5340  intersects: function (a) {
5341      var b = !1;
5342      return (b = "OpenLayers.Geometry.Point" == a.CLASS_NAME ? this.equals(a) : a.intersects(this));
5343  },
5344  transform: function (a, b) {
5345      a && b && (OpenLayers.Projection.transform(this, a, b), (this.bounds = null));
5346      return this;
5347  },
5348  getVertices: function (a) {
5349      return [this];
5350  },
5351  CLASS_NAME: "OpenLayers.Geometry.Point",
5352});
5353OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, {
5354  components: null,
5355  componentTypes: null,
5356  initialize: function (a) {
5357      OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
5358      this.components = [];
5359      null != a && this.addComponents(a);
5360  },
5361  destroy: function () {
5362      this.components.length = 0;
5363      this.components = null;
5364      OpenLayers.Geometry.prototype.destroy.apply(this, arguments);
5365  },
5366  clone: function () {
5367      for (var a = eval("new " + this.CLASS_NAME + "()"), b = 0, c = this.components.length; b < c; b++) a.addComponent(this.components[b].clone());
5368      OpenLayers.Util.applyDefaults(a, this);
5369      return a;
5370  },
5371  getComponentsString: function () {
5372      for (var a = [], b = 0, c = this.components.length; b < c; b++) a.push(this.components[b].toShortString());
5373      return a.join(",");
5374  },
5375  calculateBounds: function () {
5376      this.bounds = null;
5377      var a = new OpenLayers.Bounds(),
5378          b = this.components;
5379      if (b) for (var c = 0, d = b.length; c < d; c++) a.extend(b[c].getBounds());
5380      null != a.left && null != a.bottom && null != a.right && null != a.top && this.setBounds(a);
5381  },
5382  addComponents: function (a) {
5383      OpenLayers.Util.isArray(a) || (a = [a]);
5384      for (var b = 0, c = a.length; b < c; b++) this.addComponent(a[b]);
5385  },
5386  addComponent: function (a, b) {
5387      var c = !1;
5388      if (a && (null == this.componentTypes || -1 < OpenLayers.Util.indexOf(this.componentTypes, a.CLASS_NAME))) {
5389          if (null != b && b < this.components.length) {
5390              var c = this.components.slice(0, b),
5391                  d = this.components.slice(b, this.components.length);
5392              c.push(a);
5393              this.components = c.concat(d);
5394          } else this.components.push(a);
5395          a.parent = this;
5396          this.clearBounds();
5397          c = !0;
5398      }
5399      return c;
5400  },
5401  removeComponents: function (a) {
5402      var b = !1;
5403      OpenLayers.Util.isArray(a) || (a = [a]);
5404      for (var c = a.length - 1; 0 <= c; --c) b = this.removeComponent(a[c]) || b;
5405      return b;
5406  },
5407  removeComponent: function (a) {
5408      OpenLayers.Util.removeItem(this.components, a);
5409      this.clearBounds();
5410      return !0;
5411  },
5412  getLength: function () {
5413      for (var a = 0, b = 0, c = this.components.length; b < c; b++) a += this.components[b].getLength();
5414      return a;
5415  },
5416  getArea: function () {
5417      for (var a = 0, b = 0, c = this.components.length; b < c; b++) a += this.components[b].getArea();
5418      return a;
5419  },
5420  getGeodesicArea: function (a) {
5421      for (var b = 0, c = 0, d = this.components.length; c < d; c++) b += this.components[c].getGeodesicArea(a);
5422      return b;
5423  },
5424  getCentroid: function (a) {
5425      if (!a) return this.components.length && this.components[0].getCentroid();
5426      a = this.components.length;
5427      if (!a) return !1;
5428      for (var b = [], c = [], d = 0, e = Number.MAX_VALUE, f, g = 0; g < a; ++g) {
5429          f = this.components[g];
5430          var h = f.getArea();
5431          f = f.getCentroid(!0);
5432          isNaN(h) || isNaN(f.x) || isNaN(f.y) || (b.push(h), (d += h), (e = h < e && 0 < h ? h : e), c.push(f));
5433      }
5434      a = b.length;
5435      if (0 === d) {
5436          for (g = 0; g < a; ++g) b[g] = 1;
5437          d = b.length;
5438      } else {
5439          for (g = 0; g < a; ++g) b[g] /= e;
5440          d /= e;
5441      }
5442      for (var k = (e = 0), g = 0; g < a; ++g) (f = c[g]), (h = b[g]), (e += f.x * h), (k += f.y * h);
5443      return new OpenLayers.Geometry.Point(e / d, k / d);
5444  },
5445  getGeodesicLength: function (a) {
5446      for (var b = 0, c = 0, d = this.components.length; c < d; c++) b += this.components[c].getGeodesicLength(a);
5447      return b;
5448  },
5449  move: function (a, b) {
5450      for (var c = 0, d = this.components.length; c < d; c++) this.components[c].move(a, b);
5451  },
5452  rotate: function (a, b) {
5453      for (var c = 0, d = this.components.length; c < d; ++c) this.components[c].rotate(a, b);
5454  },
5455  resize: function (a, b, c) {
5456      for (var d = 0; d < this.components.length; ++d) this.components[d].resize(a, b, c);
5457      return this;
5458  },
5459  distanceTo: function (a, b) {
5460      for (
5461          var c = !(b && !1 === b.edge) && b && b.details, d, e, f, g = Number.POSITIVE_INFINITY, h = 0, k = this.components.length;
5462          h < k && !((d = this.components[h].distanceTo(a, b)), (f = c ? d.distance : d), f < g && ((g = f), (e = d), 0 == g));
5463          ++h
5464      );
5465      return e;
5466  },
5467  equals: function (a) {
5468      var b = !0;
5469      if (a && a.CLASS_NAME && this.CLASS_NAME == a.CLASS_NAME)
5470          if (OpenLayers.Util.isArray(a.components) && a.components.length == this.components.length)
5471              for (var c = 0, d = this.components.length; c < d; ++c) {
5472                  if (!this.components[c].equals(a.components[c])) {
5473                      b = !1;
5474                      break;
5475                  }
5476              }
5477          else b = !1;
5478      else b = !1;
5479      return b;
5480  },
5481  transform: function (a, b) {
5482      if (a && b) {
5483          for (var c = 0, d = this.components.length; c < d; c++) this.components[c].transform(a, b);
5484          this.bounds = null;
5485      }
5486      return this;
5487  },
5488  intersects: function (a) {
5489      for (var b = !1, c = 0, d = this.components.length; c < d && !(b = a.intersects(this.components[c])); ++c);
5490      return b;
5491  },
5492  getVertices: function (a) {
5493      for (var b = [], c = 0, d = this.components.length; c < d; ++c) Array.prototype.push.apply(b, this.components[c].getVertices(a));
5494      return b;
5495  },
5496  CLASS_NAME: "OpenLayers.Geometry.Collection",
5497});
5498OpenLayers.Geometry.MultiPoint = OpenLayers.Class(OpenLayers.Geometry.Collection, {
5499  componentTypes: ["OpenLayers.Geometry.Point"],
5500  addPoint: function (a, b) {
5501      this.addComponent(a, b);
5502  },
5503  removePoint: function (a) {
5504      this.removeComponent(a);
5505  },
5506  CLASS_NAME: "OpenLayers.Geometry.MultiPoint",
5507});
5508OpenLayers.Geometry.Curve = OpenLayers.Class(OpenLayers.Geometry.MultiPoint, {
5509  componentTypes: ["OpenLayers.Geometry.Point"],
5510  getLength: function () {
5511      var a = 0;
5512      if (this.components && 1 < this.components.length) for (var b = 1, c = this.components.length; b < c; b++) a += this.components[b - 1].distanceTo(this.components[b]);
5513      return a;
5514  },
5515  getGeodesicLength: function (a) {
5516      var b = this;
5517      if (a) {
5518          var c = new OpenLayers.Projection("EPSG:4326");
5519          c.equals(a) || (b = this.clone().transform(a, c));
5520      }
5521      a = 0;
5522      if (b.components && 1 < b.components.length)
5523          for (var d, e = 1, f = b.components.length; e < f; e++) (c = b.components[e - 1]), (d = b.components[e]), (a += OpenLayers.Util.distVincenty({ lon: c.x, lat: c.y }, { lon: d.x, lat: d.y }));
5524      return 1e3 * a;
5525  },
5526  CLASS_NAME: "OpenLayers.Geometry.Curve",
5527});
5528OpenLayers.Geometry.LineString = OpenLayers.Class(OpenLayers.Geometry.Curve, {
5529  removeComponent: function (a) {
5530      var b = this.components && 2 < this.components.length;
5531      b && OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this, arguments);
5532      return b;
5533  },
5534  intersects: function (a) {
5535      var b = !1,
5536          c = a.CLASS_NAME;
5537      if ("OpenLayers.Geometry.LineString" == c || "OpenLayers.Geometry.LinearRing" == c || "OpenLayers.Geometry.Point" == c) {
5538          var d = this.getSortedSegments();
5539          a = "OpenLayers.Geometry.Point" == c ? [{ x1: a.x, y1: a.y, x2: a.x, y2: a.y }] : a.getSortedSegments();
5540          var e,
5541              f,
5542              g,
5543              h,
5544              k,
5545              l,
5546              m,
5547              n = 0,
5548              p = d.length;
5549          a: for (; n < p; ++n) {
5550              c = d[n];
5551              e = c.x1;
5552              f = c.x2;
5553              g = c.y1;
5554              h = c.y2;
5555              var q = 0,
5556                  r = a.length;
5557              for (; q < r; ++q) {
5558                  k = a[q];
5559                  if (k.x1 > f) break;
5560                  if (!(k.x2 < e || ((l = k.y1), (m = k.y2), Math.min(l, m) > Math.max(g, h) || Math.max(l, m) < Math.min(g, h) || !OpenLayers.Geometry.segmentsIntersect(c, k)))) {
5561                      b = !0;
5562                      break a;
5563                  }
5564              }
5565          }
5566      } else b = a.intersects(this);
5567      return b;
5568  },
5569  getSortedSegments: function () {
5570      for (var a = this.components.length - 1, b = Array(a), c, d, e = 0; e < a; ++e)
5571          (c = this.components[e]), (d = this.components[e + 1]), (b[e] = c.x < d.x ? { x1: c.x, y1: c.y, x2: d.x, y2: d.y } : { x1: d.x, y1: d.y, x2: c.x, y2: c.y });
5572      return b.sort(function (a, b) {
5573          return a.x1 - b.x1;
5574      });
5575  },
5576  splitWithSegment: function (a, b) {
5577      for (var c = !(b && !1 === b.edge), d = b && b.tolerance, e = [], f = this.getVertices(), g = [], h = [], k = !1, l, m, n, p = { point: !0, tolerance: d }, q = null, r = 0, s = f.length - 2; r <= s; ++r)
5578          if (
5579              ((d = f[r]),
5580              g.push(d.clone()),
5581              (l = f[r + 1]),
5582              (m = { x1: d.x, y1: d.y, x2: l.x, y2: l.y }),
5583              (m = OpenLayers.Geometry.segmentsIntersect(a, m, p)),
5584              m instanceof OpenLayers.Geometry.Point && ((n = (m.x === a.x1 && m.y === a.y1) || (m.x === a.x2 && m.y === a.y2) || m.equals(d) || m.equals(l) ? !0 : !1) || c))
5585          )
5586              m.equals(h[h.length - 1]) || h.push(m.clone()), (0 === r && m.equals(d)) || m.equals(l) || ((k = !0), m.equals(d) || g.push(m), e.push(new OpenLayers.Geometry.LineString(g)), (g = [m.clone()]));
5587      k && (g.push(l.clone()), e.push(new OpenLayers.Geometry.LineString(g)));
5588      if (0 < h.length)
5589          var t = a.x1 < a.x2 ? 1 : -1,
5590              u = a.y1 < a.y2 ? 1 : -1,
5591              q = {
5592                  lines: e,
5593                  points: h.sort(function (a, b) {
5594                      return t * a.x - t * b.x || u * a.y - u * b.y;
5595                  }),
5596              };
5597      return q;
5598  },
5599  split: function (a, b) {
5600      var c = null,
5601          d = b && b.mutual,
5602          e,
5603          f,
5604          g,
5605          h;
5606      if (a instanceof OpenLayers.Geometry.LineString) {
5607          var k = this.getVertices(),
5608              l,
5609              m,
5610              n,
5611              p,
5612              q,
5613              r = [];
5614          g = [];
5615          for (var s = 0, t = k.length - 2; s <= t; ++s) {
5616              l = k[s];
5617              m = k[s + 1];
5618              n = { x1: l.x, y1: l.y, x2: m.x, y2: m.y };
5619              h = h || [a];
5620              d && r.push(l.clone());
5621              for (var u = 0; u < h.length; ++u)
5622                  if ((p = h[u].splitWithSegment(n, b)))
5623                      if (((q = p.lines), 0 < q.length && (q.unshift(u, 1), Array.prototype.splice.apply(h, q), (u += q.length - 2)), d))
5624                          for (var v = 0, w = p.points.length; v < w; ++v) (q = p.points[v]), q.equals(l) || (r.push(q), g.push(new OpenLayers.Geometry.LineString(r)), (r = q.equals(m) ? [] : [q.clone()]));
5625          }
5626          d && 0 < g.length && 0 < r.length && (r.push(m.clone()), g.push(new OpenLayers.Geometry.LineString(r)));
5627      } else c = a.splitWith(this, b);
5628      h && 1 < h.length ? (f = !0) : (h = []);
5629      g && 1 < g.length ? (e = !0) : (g = []);
5630      if (f || e) c = d ? [g, h] : h;
5631      return c;
5632  },
5633  splitWith: function (a, b) {
5634      return a.split(this, b);
5635  },
5636  getVertices: function (a) {
5637      return !0 === a ? [this.components[0], this.components[this.components.length - 1]] : !1 === a ? this.components.slice(1, this.components.length - 1) : this.components.slice();
5638  },
5639  distanceTo: function (a, b) {
5640      var c = !(b && !1 === b.edge) && b && b.details,
5641          d,
5642          e = {},
5643          f = Number.POSITIVE_INFINITY;
5644      if (a instanceof OpenLayers.Geometry.Point) {
5645          for (var g = this.getSortedSegments(), h = a.x, k = a.y, l, m = 0, n = g.length; m < n; ++m)
5646              if (((l = g[m]), (d = OpenLayers.Geometry.distanceToSegment(a, l)), d.distance < f)) {
5647                  if (((f = d.distance), (e = d), 0 === f)) break;
5648              } else if (l.x2 > h && ((k > l.y1 && k < l.y2) || (k < l.y1 && k > l.y2))) break;
5649          e = c ? { distance: e.distance, x0: e.x, y0: e.y, x1: h, y1: k } : e.distance;
5650      } else if (a instanceof OpenLayers.Geometry.LineString) {
5651          var g = this.getSortedSegments(),
5652              h = a.getSortedSegments(),
5653              p,
5654              q,
5655              r = h.length,
5656              s = { point: !0 },
5657              m = 0,
5658              n = g.length;
5659          a: for (; m < n; ++m) {
5660              k = g[m];
5661              l = k.x1;
5662              q = k.y1;
5663              for (var t = 0; t < r; ++t)
5664                  if (((d = h[t]), (p = OpenLayers.Geometry.segmentsIntersect(k, d, s)))) {
5665                      f = 0;
5666                      e = { distance: 0, x0: p.x, y0: p.y, x1: p.x, y1: p.y };
5667                      break a;
5668                  } else (d = OpenLayers.Geometry.distanceToSegment({ x: l, y: q }, d)), d.distance < f && ((f = d.distance), (e = { distance: f, x0: l, y0: q, x1: d.x, y1: d.y }));
5669          }
5670          c || (e = e.distance);
5671          0 !== f && k && ((d = a.distanceTo(new OpenLayers.Geometry.Point(k.x2, k.y2), b)), (m = c ? d.distance : d), m < f && (e = c ? { distance: f, x0: d.x1, y0: d.y1, x1: d.x0, y1: d.y0 } : m));
5672      } else (e = a.distanceTo(this, b)), c && (e = { distance: e.distance, x0: e.x1, y0: e.y1, x1: e.x0, y1: e.y0 });
5673      return e;
5674  },
5675  simplify: function (a) {
5676      if (this && null !== this) {
5677          var b = this.getVertices();
5678          if (3 > b.length) return this;
5679          var c = function (a, b, d, k) {
5680                  for (var l = 0, m = 0, n = b, p; n < d; n++) {
5681                      p = a[b];
5682                      var q = a[d],
5683                          r = a[n],
5684                          r = Math.abs(0.5 * (p.x * q.y + q.x * r.y + r.x * p.y - q.x * p.y - r.x * q.y - p.x * r.y));
5685                      p = Math.sqrt(Math.pow(p.x - q.x, 2) + Math.pow(p.y - q.y, 2));
5686                      p = 2 * (r / p);
5687                      p > l && ((l = p), (m = n));
5688                  }
5689                  l > k && m != b && (e.push(m), c(a, b, m, k), c(a, m, d, k));
5690              },
5691              d = b.length - 1,
5692              e = [];
5693          e.push(0);
5694          for (e.push(d); b[0].equals(b[d]); ) d--, e.push(d);
5695          c(b, 0, d, a);
5696          a = [];
5697          e.sort(function (a, b) {
5698              return a - b;
5699          });
5700          for (d = 0; d < e.length; d++) a.push(b[e[d]]);
5701          return new OpenLayers.Geometry.LineString(a);
5702      }
5703      return this;
5704  },
5705  CLASS_NAME: "OpenLayers.Geometry.LineString",
5706});
5707OpenLayers.Geometry.MultiLineString = OpenLayers.Class(OpenLayers.Geometry.Collection, {
5708  componentTypes: ["OpenLayers.Geometry.LineString"],
5709  split: function (a, b) {
5710      for (var c = null, d = b && b.mutual, e, f, g, h, k = [], l = [a], m = 0, n = this.components.length; m < n; ++m) {
5711          f = this.components[m];
5712          g = !1;
5713          for (var p = 0; p < l.length; ++p)
5714              if ((e = f.split(l[p], b))) {
5715                  if (d) {
5716                      g = e[0];
5717                      for (var q = 0, r = g.length; q < r; ++q) 0 === q && k.length ? k[k.length - 1].addComponent(g[q]) : k.push(new OpenLayers.Geometry.MultiLineString([g[q]]));
5718                      g = !0;
5719                      e = e[1];
5720                  }
5721                  if (e.length) {
5722                      e.unshift(p, 1);
5723                      Array.prototype.splice.apply(l, e);
5724                      break;
5725                  }
5726              }
5727          g || (k.length ? k[k.length - 1].addComponent(f.clone()) : (k = [new OpenLayers.Geometry.MultiLineString(f.clone())]));
5728      }
5729      k && 1 < k.length ? (g = !0) : (k = []);
5730      l && 1 < l.length ? (h = !0) : (l = []);
5731      if (g || h) c = d ? [k, l] : l;
5732      return c;
5733  },
5734  splitWith: function (a, b) {
5735      var c = null,
5736          d = b && b.mutual,
5737          e,
5738          f,
5739          g,
5740          h,
5741          k,
5742          l;
5743      if (a instanceof OpenLayers.Geometry.LineString) {
5744          l = [];
5745          k = [a];
5746          for (var m = 0, n = this.components.length; m < n; ++m) {
5747              g = !1;
5748              f = this.components[m];
5749              for (var p = 0; p < k.length; ++p)
5750                  if ((e = k[p].split(f, b))) {
5751                      d && ((g = e[0]), g.length && (g.unshift(p, 1), Array.prototype.splice.apply(k, g), (p += g.length - 2)), (e = e[1]), 0 === e.length && (e = [f.clone()]));
5752                      g = 0;
5753                      for (var q = e.length; g < q; ++g) 0 === g && l.length ? l[l.length - 1].addComponent(e[g]) : l.push(new OpenLayers.Geometry.MultiLineString([e[g]]));
5754                      g = !0;
5755                  }
5756              g || (l.length ? l[l.length - 1].addComponent(f.clone()) : (l = [new OpenLayers.Geometry.MultiLineString([f.clone()])]));
5757          }
5758      } else c = a.split(this);
5759      k && 1 < k.length ? (h = !0) : (k = []);
5760      l && 1 < l.length ? (g = !0) : (l = []);
5761      if (h || g) c = d ? [k, l] : l;
5762      return c;
5763  },
5764  CLASS_NAME: "OpenLayers.Geometry.MultiLineString",
5765});
5766OpenLayers.Geometry.LinearRing = OpenLayers.Class(OpenLayers.Geometry.LineString, {
5767  componentTypes: ["OpenLayers.Geometry.Point"],
5768  addComponent: function (a, b) {
5769      var c = !1,
5770          d = this.components.pop();
5771      (null == b && a.equals(d)) || (c = OpenLayers.Geometry.Collection.prototype.addComponent.apply(this, arguments));
5772      OpenLayers.Geometry.Collection.prototype.addComponent.apply(this, [this.components[0]]);
5773      return c;
5774  },
5775  removeComponent: function (a) {
5776      var b = this.components && 3 < this.components.length;
5777      b && (this.components.pop(), OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this, arguments), OpenLayers.Geometry.Collection.prototype.addComponent.apply(this, [this.components[0]]));
5778      return b;
5779  },
5780  move: function (a, b) {
5781      for (var c = 0, d = this.components.length; c < d - 1; c++) this.components[c].move(a, b);
5782  },
5783  rotate: function (a, b) {
5784      for (var c = 0, d = this.components.length; c < d - 1; ++c) this.components[c].rotate(a, b);
5785  },
5786  resize: function (a, b, c) {
5787      for (var d = 0, e = this.components.length; d < e - 1; ++d) this.components[d].resize(a, b, c);
5788      return this;
5789  },
5790  transform: function (a, b) {
5791      if (a && b) {
5792          for (var c = 0, d = this.components.length; c < d - 1; c++) this.components[c].transform(a, b);
5793          this.bounds = null;
5794      }
5795      return this;
5796  },
5797  getCentroid: function () {
5798      if (this.components) {
5799          var a = this.components.length;
5800          if (0 < a && 2 >= a) return this.components[0].clone();
5801          if (2 < a) {
5802              var b = 0,
5803                  c = 0,
5804                  d = this.components[0].x,
5805                  e = this.components[0].y,
5806                  f = -1 * this.getArea();
5807              if (0 != f) {
5808                  for (var g = 0; g < a - 1; g++)
5809                      var h = this.components[g], k = this.components[g + 1], b = b + (h.x + k.x - 2 * d) * ((h.x - d) * (k.y - e) - (k.x - d) * (h.y - e)), c = c + (h.y + k.y - 2 * e) * ((h.x - d) * (k.y - e) - (k.x - d) * (h.y - e));
5810                  b = d + b / (6 * f);
5811                  a = e + c / (6 * f);
5812              } else {
5813                  for (g = 0; g < a - 1; g++) (b += this.components[g].x), (c += this.components[g].y);
5814                  b /= a - 1;
5815                  a = c / (a - 1);
5816              }
5817              return new OpenLayers.Geometry.Point(b, a);
5818          }
5819          return null;
5820      }
5821  },
5822  getArea: function () {
5823      var a = 0;
5824      if (this.components && 2 < this.components.length) {
5825          for (var b = (a = 0), c = this.components.length; b < c - 1; b++) var d = this.components[b], e = this.components[b + 1], a = a + (d.x + e.x) * (e.y - d.y);
5826          a = -a / 2;
5827      }
5828      return a;
5829  },
5830  getGeodesicArea: function (a) {
5831      var b = this;
5832      if (a) {
5833          var c = new OpenLayers.Projection("EPSG:4326");
5834          c.equals(a) || (b = this.clone().transform(a, c));
5835      }
5836      a = 0;
5837      c = b.components && b.components.length;
5838      if (2 < c) {
5839          for (var d, e, f = 0; f < c - 1; f++) (d = b.components[f]), (e = b.components[f + 1]), (a += OpenLayers.Util.rad(e.x - d.x) * (2 + Math.sin(OpenLayers.Util.rad(d.y)) + Math.sin(OpenLayers.Util.rad(e.y))));
5840          a = (40680631590769 * a) / 2;
5841      }
5842      return a;
5843  },
5844  containsPoint: function (a) {
5845      var b = OpenLayers.Number.limitSigDigs,
5846          c = b(a.x, 14);
5847      a = b(a.y, 14);
5848      for (var d = this.components.length - 1, e, f, g, h, k, l = 0, m = 0; m < d; ++m)
5849          if (((e = this.components[m]), (g = b(e.x, 14)), (e = b(e.y, 14)), (f = this.components[m + 1]), (h = b(f.x, 14)), (f = b(f.y, 14)), e == f)) {
5850              if (a == e && ((g <= h && c >= g && c <= h) || (g >= h && c <= g && c >= h))) {
5851                  l = -1;
5852                  break;
5853              }
5854          } else {
5855              k = b((a - f) * ((h - g) / (f - e)) + h, 14);
5856              if (k == c && ((e < f && a >= e && a <= f) || (e > f && a <= e && a >= f))) {
5857                  l = -1;
5858                  break;
5859              }
5860              k <= c || (g != h && (k < Math.min(g, h) || k > Math.max(g, h))) || (((e < f && a >= e && a < f) || (e > f && a < e && a >= f)) && ++l);
5861          }
5862      return -1 == l ? 1 : !!(l & 1);
5863  },
5864  intersects: function (a) {
5865      var b = !1;
5866      if ("OpenLayers.Geometry.Point" == a.CLASS_NAME) b = this.containsPoint(a);
5867      else if ("OpenLayers.Geometry.LineString" == a.CLASS_NAME) b = a.intersects(this);
5868      else if ("OpenLayers.Geometry.LinearRing" == a.CLASS_NAME) b = OpenLayers.Geometry.LineString.prototype.intersects.apply(this, [a]);
5869      else for (var c = 0, d = a.components.length; c < d && !(b = a.components[c].intersects(this)); ++c);
5870      return b;
5871  },
5872  getVertices: function (a) {
5873      return !0 === a ? [] : this.components.slice(0, this.components.length - 1);
5874  },
5875  CLASS_NAME: "OpenLayers.Geometry.LinearRing",
5876});
5877OpenLayers.Geometry.Polygon = OpenLayers.Class(OpenLayers.Geometry.Collection, {
5878  componentTypes: ["OpenLayers.Geometry.LinearRing"],
5879  getArea: function () {
5880      var a = 0;
5881      if (this.components && 0 < this.components.length) for (var a = a + Math.abs(this.components[0].getArea()), b = 1, c = this.components.length; b < c; b++) a -= Math.abs(this.components[b].getArea());
5882      return a;
5883  },
5884  getGeodesicArea: function (a) {
5885      var b = 0;
5886      if (this.components && 0 < this.components.length) for (var b = b + Math.abs(this.components[0].getGeodesicArea(a)), c = 1, d = this.components.length; c < d; c++) b -= Math.abs(this.components[c].getGeodesicArea(a));
5887      return b;
5888  },
5889  containsPoint: function (a) {
5890      var b = this.components.length,
5891          c = !1;
5892      if (0 < b && ((c = this.components[0].containsPoint(a)), 1 !== c && c && 1 < b))
5893          for (var d, e = 1; e < b; ++e)
5894              if ((d = this.components[e].containsPoint(a))) {
5895                  c = 1 === d ? 1 : !1;
5896                  break;
5897              }
5898      return c;
5899  },
5900  intersects: function (a) {
5901      var b = !1,
5902          c,
5903          d;
5904      if ("OpenLayers.Geometry.Point" == a.CLASS_NAME) b = this.containsPoint(a);
5905      else if ("OpenLayers.Geometry.LineString" == a.CLASS_NAME || "OpenLayers.Geometry.LinearRing" == a.CLASS_NAME) {
5906          c = 0;
5907          for (d = this.components.length; c < d && !(b = a.intersects(this.components[c])); ++c);
5908          if (!b) for (c = 0, d = a.components.length; c < d && !(b = this.containsPoint(a.components[c])); ++c);
5909      } else for (c = 0, d = a.components.length; c < d && !(b = this.intersects(a.components[c])); ++c);
5910      if (!b && "OpenLayers.Geometry.Polygon" == a.CLASS_NAME) {
5911          var e = this.components[0];
5912          c = 0;
5913          for (d = e.components.length; c < d && !(b = a.containsPoint(e.components[c])); ++c);
5914      }
5915      return b;
5916  },
5917  distanceTo: function (a, b) {
5918      return b && !1 === b.edge && this.intersects(a) ? 0 : OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this, [a, b]);
5919  },
5920  CLASS_NAME: "OpenLayers.Geometry.Polygon",
5921});
5922OpenLayers.Geometry.Polygon.createRegularPolygon = function (a, b, c, d) {
5923  var e = Math.PI * (1 / c - 0.5);
5924  d && (e += (d / 180) * Math.PI);
5925  for (var f, g = [], h = 0; h < c; ++h) (f = e + (2 * h * Math.PI) / c), (d = a.x + b * Math.cos(f)), (f = a.y + b * Math.sin(f)), g.push(new OpenLayers.Geometry.Point(d, f));
5926  a = new OpenLayers.Geometry.LinearRing(g);
5927  return new OpenLayers.Geometry.Polygon([a]);
5928};
5929OpenLayers.Geometry.MultiPolygon = OpenLayers.Class(OpenLayers.Geometry.Collection, { componentTypes: ["OpenLayers.Geometry.Polygon"], CLASS_NAME: "OpenLayers.Geometry.MultiPolygon" });
5930OpenLayers.Format.GML = OpenLayers.Class(OpenLayers.Format.XML, {
5931  featureNS: "http://mapserver.gis.umn.edu/mapserver",
5932  featurePrefix: "feature",
5933  featureName: "featureMember",
5934  layerName: "features",
5935  geometryName: "geometry",
5936  collectionName: "FeatureCollection",
5937  gmlns: "http://www.opengis.net/gml",
5938  extractAttributes: !0,
5939  xy: !0,
5940  initialize: function (a) {
5941      this.regExes = { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g };
5942      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
5943  },
5944  read: function (a) {
5945      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
5946      a = this.getElementsByTagNameNS(a.documentElement, this.gmlns, this.featureName);
5947      for (var b = [], c = 0; c < a.length; c++) {
5948          var d = this.parseFeature(a[c]);
5949          d && b.push(d);
5950      }
5951      return b;
5952  },
5953  parseFeature: function (a) {
5954      for (var b = "MultiPolygon Polygon MultiLineString LineString MultiPoint Point Envelope".split(" "), c, d, e, f = 0; f < b.length; ++f)
5955          if (((c = b[f]), (d = this.getElementsByTagNameNS(a, this.gmlns, c)), 0 < d.length)) {
5956              if ((e = this.parseGeometry[c.toLowerCase()])) (e = e.apply(this, [d[0]])), this.internalProjection && this.externalProjection && e.transform(this.externalProjection, this.internalProjection);
5957              else throw new TypeError("Unsupported geometry type: " + c);
5958              break;
5959          }
5960      var g;
5961      c = this.getElementsByTagNameNS(a, this.gmlns, "Box");
5962      for (f = 0; f < c.length; ++f) (b = c[f]), (d = this.parseGeometry.box.apply(this, [b])), (b = b.parentNode), "boundedBy" === (b.localName || b.nodeName.split(":").pop()) ? (g = d) : (e = d.toGeometry());
5963      var h;
5964      this.extractAttributes && (h = this.parseAttributes(a));
5965      h = new OpenLayers.Feature.Vector(e, h);
5966      h.bounds = g;
5967      h.gml = { featureType: a.firstChild.nodeName.split(":")[1], featureNS: a.firstChild.namespaceURI, featureNSPrefix: a.firstChild.prefix };
5968      a = a.firstChild;
5969      for (var k; a && (1 != a.nodeType || !(k = a.getAttribute("fid") || a.getAttribute("id"))); ) a = a.nextSibling;
5970      h.fid = k;
5971      return h;
5972  },
5973  parseGeometry: {
5974      point: function (a) {
5975          var b, c;
5976          c = [];
5977          b = this.getElementsByTagNameNS(a, this.gmlns, "pos");
5978          0 < b.length && ((c = b[0].firstChild.nodeValue), (c = c.replace(this.regExes.trimSpace, "")), (c = c.split(this.regExes.splitSpace)));
5979          0 == c.length && ((b = this.getElementsByTagNameNS(a, this.gmlns, "coordinates")), 0 < b.length && ((c = b[0].firstChild.nodeValue), (c = c.replace(this.regExes.removeSpace, "")), (c = c.split(","))));
5980          0 == c.length &&
5981              ((b = this.getElementsByTagNameNS(a, this.gmlns, "coord")),
5982              0 < b.length &&
5983                  ((a = this.getElementsByTagNameNS(b[0], this.gmlns, "X")), (b = this.getElementsByTagNameNS(b[0], this.gmlns, "Y")), 0 < a.length && 0 < b.length && (c = [a[0].firstChild.nodeValue, b[0].firstChild.nodeValue])));
5984          2 == c.length && (c[2] = null);
5985          return this.xy ? new OpenLayers.Geometry.Point(c[0], c[1], c[2]) : new OpenLayers.Geometry.Point(c[1], c[0], c[2]);
5986      },
5987      multipoint: function (a) {
5988          a = this.getElementsByTagNameNS(a, this.gmlns, "Point");
5989          var b = [];
5990          if (0 < a.length) for (var c, d = 0; d < a.length; ++d) (c = this.parseGeometry.point.apply(this, [a[d]])) && b.push(c);
5991          return new OpenLayers.Geometry.MultiPoint(b);
5992      },
5993      linestring: function (a, b) {
5994          var c, d;
5995          d = [];
5996          var e = [];
5997          c = this.getElementsByTagNameNS(a, this.gmlns, "posList");
5998          if (0 < c.length) {
5999              d = this.getChildValue(c[0]);
6000              d = d.replace(this.regExes.trimSpace, "");
6001              d = d.split(this.regExes.splitSpace);
6002              var f = parseInt(c[0].getAttribute("dimension")),
6003                  g,
6004                  h,
6005                  k;
6006              for (c = 0; c < d.length / f; ++c) (g = c * f), (h = d[g]), (k = d[g + 1]), (g = 2 == f ? null : d[g + 2]), this.xy ? e.push(new OpenLayers.Geometry.Point(h, k, g)) : e.push(new OpenLayers.Geometry.Point(k, h, g));
6007          }
6008          if (0 == d.length && ((c = this.getElementsByTagNameNS(a, this.gmlns, "coordinates")), 0 < c.length))
6009              for (d = this.getChildValue(c[0]), d = d.replace(this.regExes.trimSpace, ""), d = d.replace(this.regExes.trimComma, ","), f = d.split(this.regExes.splitSpace), c = 0; c < f.length; ++c)
6010                  (d = f[c].split(",")), 2 == d.length && (d[2] = null), this.xy ? e.push(new OpenLayers.Geometry.Point(d[0], d[1], d[2])) : e.push(new OpenLayers.Geometry.Point(d[1], d[0], d[2]));
6011          d = null;
6012          0 != e.length && (d = b ? new OpenLayers.Geometry.LinearRing(e) : new OpenLayers.Geometry.LineString(e));
6013          return d;
6014      },
6015      multilinestring: function (a) {
6016          a = this.getElementsByTagNameNS(a, this.gmlns, "LineString");
6017          var b = [];
6018          if (0 < a.length) for (var c, d = 0; d < a.length; ++d) (c = this.parseGeometry.linestring.apply(this, [a[d]])) && b.push(c);
6019          return new OpenLayers.Geometry.MultiLineString(b);
6020      },
6021      polygon: function (a) {
6022          a = this.getElementsByTagNameNS(a, this.gmlns, "LinearRing");
6023          var b = [];
6024          if (0 < a.length) for (var c, d = 0; d < a.length; ++d) (c = this.parseGeometry.linestring.apply(this, [a[d], !0])) && b.push(c);
6025          return new OpenLayers.Geometry.Polygon(b);
6026      },
6027      multipolygon: function (a) {
6028          a = this.getElementsByTagNameNS(a, this.gmlns, "Polygon");
6029          var b = [];
6030          if (0 < a.length) for (var c, d = 0; d < a.length; ++d) (c = this.parseGeometry.polygon.apply(this, [a[d]])) && b.push(c);
6031          return new OpenLayers.Geometry.MultiPolygon(b);
6032      },
6033      envelope: function (a) {
6034          var b = [],
6035              c,
6036              d,
6037              e = this.getElementsByTagNameNS(a, this.gmlns, "lowerCorner");
6038          if (0 < e.length) {
6039              c = [];
6040              0 < e.length && ((c = e[0].firstChild.nodeValue), (c = c.replace(this.regExes.trimSpace, "")), (c = c.split(this.regExes.splitSpace)));
6041              2 == c.length && (c[2] = null);
6042              var f = this.xy ? new OpenLayers.Geometry.Point(c[0], c[
60421], c[2]) : new OpenLayers.Geometry.Point(c[1], c[0], c[2]);
6043          }
6044          a = this.getElementsByTagNameNS(a, this.gmlns, "upperCorner");
6045          if (0 < a.length) {
6046              c = [];
6047              0 < a.length && ((c = a[0].firstChild.nodeValue), (c = c.replace(this.regExes.trimSpace, "")), (c = c.split(this.regExes.splitSpace)));
6048              2 == c.length && (c[2] = null);
6049              var g = this.xy ? new OpenLayers.Geometry.Point(c[0], c[1], c[2]) : new OpenLayers.Geometry.Point(c[1], c[0], c[2]);
6050          }
6051          f &&
6052              g &&
6053              (b.push(new OpenLayers.Geometry.Point(f.x, f.y)),
6054              b.push(new OpenLayers.Geometry.Point(g.x, f.y)),
6055              b.push(new OpenLayers.Geometry.Point(g.x, g.y)),
6056              b.push(new OpenLayers.Geometry.Point(f.x, g.y)),
6057              b.push(new OpenLayers.Geometry.Point(f.x, f.y)),
6058              (b = new OpenLayers.Geometry.LinearRing(b)),
6059              (d = new OpenLayers.Geometry.Polygon([b])));
6060          return d;
6061      },
6062      box: function (a) {
6063          var b = this.getElementsByTagNameNS(a, this.gmlns, "coordinates"),
6064              c = (a = null);
6065          0 < b.length && ((b = b[0].firstChild.nodeValue), (b = b.split(" ")), 2 == b.length && ((a = b[0].split(",")), (c = b[1].split(","))));
6066          if (null !== a && null !== c) return new OpenLayers.Bounds(parseFloat(a[0]), parseFloat(a[1]), parseFloat(c[0]), parseFloat(c[1]));
6067      },
6068  },
6069  parseAttributes: function (a) {
6070      var b = {};
6071      a = a.firstChild;
6072      for (var c, d, e; a; ) {
6073          if (1 == a.nodeType) {
6074              a = a.childNodes;
6075              for (c = 0; c < a.length; ++c)
6076                  if (((d = a[c]), 1 == d.nodeType))
6077                      if (((e = d.childNodes), 1 == e.length)) {
6078                          if (((e = e[0]), 3 == e.nodeType || 4 == e.nodeType)) (d = d.prefix ? d.nodeName.split(":")[1] : d.nodeName), (e = e.nodeValue.replace(this.regExes.trimSpace, "")), (b[d] = e);
6079                      } else b[d.nodeName.split(":").pop()] = null;
6080              break;
6081          }
6082          a = a.nextSibling;
6083      }
6084      return b;
6085  },
6086  write: function (a) {
6087      OpenLayers.Util.isArray(a) || (a = [a]);
6088      for (var b = this.createElementNS("http://www.opengis.net/wfs", "wfs:" + this.collectionName), c = 0; c < a.length; c++) b.appendChild(this.createFeatureXML(a[c]));
6089      return OpenLayers.Format.XML.prototype.write.apply(this, [b]);
6090  },
6091  createFeatureXML: function (a) {
6092      var b = this.buildGeometryNode(a.geometry),
6093          c = this.createElementNS(this.featureNS, this.featurePrefix + ":" + this.geometryName);
6094      c.appendChild(b);
6095      var b = this.createElementNS(this.gmlns, "gml:" + this.featureName),
6096          d = this.createElementNS(this.featureNS, this.featurePrefix + ":" + this.layerName);
6097      d.setAttribute("fid", a.fid || a.id);
6098      d.appendChild(c);
6099      for (var e in a.attributes) {
6100          var c = this.createTextNode(a.attributes[e]),
6101              f = e.substring(e.lastIndexOf(":") + 1),
6102              f = this.createElementNS(this.featureNS, this.featurePrefix + ":" + f);
6103          f.appendChild(c);
6104          d.appendChild(f);
6105      }
6106      b.appendChild(d);
6107      return b;
6108  },
6109  buildGeometryNode: function (a) {
6110      this.externalProjection && this.internalProjection && ((a = a.clone()), a.transform(this.internalProjection, this.externalProjection));
6111      var b = a.CLASS_NAME,
6112          b = b.substring(b.lastIndexOf(".") + 1);
6113      return this.buildGeometry[b.toLowerCase()].apply(this, [a]);
6114  },
6115  buildGeometry: {
6116      point: function (a) {
6117          var b = this.createElementNS(this.gmlns, "gml:Point");
6118          b.appendChild(this.buildCoordinatesNode(a));
6119          return b;
6120      },
6121      multipoint: function (a) {
6122          var b = this.createElementNS(this.gmlns, "gml:MultiPoint");
6123          a = a.components;
6124          for (var c, d, e = 0; e < a.length; e++) (c = this.createElementNS(this.gmlns, "gml:pointMember")), (d = this.buildGeometry.point.apply(this, [a[e]])), c.appendChild(d), b.appendChild(c);
6125          return b;
6126      },
6127      linestring: function (a) {
6128          var b = this.createElementNS(this.gmlns, "gml:LineString");
6129          b.appendChild(this.buildCoordinatesNode(a));
6130          return b;
6131      },
6132      multilinestring: function (a) {
6133          var b = this.createElementNS(this.gmlns, "gml:MultiLineString");
6134          a = a.components;
6135          for (var c, d, e = 0; e < a.length; ++e) (c = this.createElementNS(this.gmlns, "gml:lineStringMember")), (d = this.buildGeometry.linestring.apply(this, [a[e]])), c.appendChild(d), b.appendChild(c);
6136          return b;
6137      },
6138      linearring: function (a) {
6139          var b = this.createElementNS(this.gmlns, "gml:LinearRing");
6140          b.appendChild(this.buildCoordinatesNode(a));
6141          return b;
6142      },
6143      polygon: function (a) {
6144          var b = this.createElementNS(this.gmlns, "gml:Polygon");
6145          a = a.components;
6146          for (var c, d, e = 0; e < a.length; ++e)
6147              (c = 0 == e ? "outerBoundaryIs" : "innerBoundaryIs"), (c = this.createElementNS(this.gmlns, "gml:" + c)), (d = this.buildGeometry.linearring.apply(this, [a[e]])), c.appendChild(d), b.appendChild(c);
6148          return b;
6149      },
6150      multipolygon: function (a) {
6151          var b = this.createElementNS(this.gmlns, "gml:MultiPolygon");
6152          a = a.components;
6153          for (var c, d, e = 0; e < a.length; ++e) (c = this.createElementNS(this.gmlns, "gml:polygonMember")), (d = this.buildGeometry.polygon.apply(this, [a[e]])), c.appendChild(d), b.appendChild(c);
6154          return b;
6155      },
6156      bounds: function (a) {
6157          var b = this.createElementNS(this.gmlns, "gml:Box");
6158          b.appendChild(this.buildCoordinatesNode(a));
6159          return b;
6160      },
6161  },
6162  buildCoordinatesNode: function (a) {
6163      var b = this.createElementNS(this.gmlns, "gml:coordinates");
6164      b.setAttribute("decimal", ".");
6165      b.setAttribute("cs", ",");
6166      b.setAttribute("ts", " ");
6167      var c = [];
6168      if (a instanceof OpenLayers.Bounds) c.push(a.left + "," + a.bottom), c.push(a.right + "," + a.top);
6169      else {
6170          a = a.components ? a.components : [a];
6171          for (var d = 0; d < a.length; d++) c.push(a[d].x + "," + a[d].y);
6172      }
6173      c = this.createTextNode(c.join(" "));
6174      b.appendChild(c);
6175      return b;
6176  },
6177  CLASS_NAME: "OpenLayers.Format.GML",
6178});
6179OpenLayers.Format.GML || (OpenLayers.Format.GML = {});
6180OpenLayers.Format.GML.Base = OpenLayers.Class(OpenLayers.Format.XML, {
6181  namespaces: { gml: "http://www.opengis.net/gml", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance", wfs: "http://www.opengis.net/wfs" },
6182  defaultPrefix: "gml",
6183  schemaLocation: null,
6184  featureType: null,
6185  featureNS: null,
6186  geometryName: "geometry",
6187  extractAttributes: !0,
6188  srsName: null,
6189  xy: !0,
6190  geometryTypes: null,
6191  singleFeatureType: null,
6192  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g, featureMember: /^(.*:)?featureMembers?$/ },
6193  initialize: function (a) {
6194      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
6195      this.setGeometryTypes();
6196      a && a.featureNS && this.setNamespace("feature", a.featureNS);
6197      this.singleFeatureType = !a || "string" === typeof a.featureType;
6198  },
6199  read: function (a) {
6200      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
6201      a && 9 == a.nodeType && (a = a.documentElement);
6202      var b = [];
6203      this.readNode(a, { features: b }, !0);
6204      if (0 == b.length) {
6205          var c = this.getElementsByTagNameNS(a, this.namespaces.gml, "featureMember");
6206          if (c.length) {
6207              a = 0;
6208              for (var d = c.length; a < d; ++a) this.readNode(c[a], { features: b }, !0);
6209          } else (c = this.getElementsByTagNameNS(a, this.namespaces.gml, "featureMembers")), c.length && this.readNode(c[0], { features: b }, !0);
6210      }
6211      return b;
6212  },
6213  readNode: function (a, b, c) {
6214      !0 === c && !0 === this.autoConfig && ((this.featureType = null), delete this.namespaceAlias[this.featureNS], delete this.namespaces.feature, (this.featureNS = null));
6215      this.featureNS ||
6216          a.prefix in this.namespaces ||
6217          a.parentNode.namespaceURI != this.namespaces.gml ||
6218          !this.regExes.featureMember.test(a.parentNode.nodeName) ||
6219          ((this.featureType = a.nodeName.split(":").pop()), this.setNamespace("feature", a.namespaceURI), (this.featureNS = a.namespaceURI), (this.autoConfig = !0));
6220      return OpenLayers.Format.XML.prototype.readNode.apply(this, [a, b]);
6221  },
6222  readers: {
6223      gml: {
6224          _inherit: function (a, b, c) {},
6225          featureMember: function (a, b) {
6226              this.readChildNodes(a, b);
6227          },
6228          featureMembers: function (a, b) {
6229              this.readChildNodes(a, b);
6230          },
6231          name: function (a, b) {
6232              b.name = this.getChildValue(a);
6233          },
6234          boundedBy: function (a, b) {
6235              var c = {};
6236              this.readChildNodes(a, c);
6237              c.components && 0 < c.components.length && (b.bounds = c.components[0]);
6238          },
6239          Point: function (a, b) {
6240              var c = { points: [] };
6241              this.readChildNodes(a, c);
6242              b.components || (b.components = []);
6243              b.components.push(c.points[0]);
6244          },
6245          coordinates: function (a, b) {
6246              for (var c = this.getChildValue(a).replace(this.regExes.trimSpace, ""), c = c.replace(this.regExes.trimComma, ","), c = c.split(this.regExes.splitSpace), d, e = c.length, f = Array(e), g = 0; g < e; ++g)
6247                  (d = c[g].split(",")), (f[g] = this.xy ? new OpenLayers.Geometry.Point(d[0], d[1], d[2]) : new OpenLayers.Geometry.Point(d[1], d[0], d[2]));
6248              b.points = f;
6249          },
6250          coord: function (a, b) {
6251              var c = {};
6252              this.readChildNodes(a, c);
6253              b.points || (b.points = []);
6254              b.points.push(new OpenLayers.Geometry.Point(c.x, c.y, c.z));
6255          },
6256          X: function (a, b) {
6257              b.x = this.getChildValue(a);
6258          },
6259          Y: function (a, b) {
6260              b.y = this.getChildValue(a);
6261          },
6262          Z: function (a, b) {
6263              b.z = this.getChildValue(a);
6264          },
6265          MultiPoint: function (a, b) {
6266              var c = { components: [] };
6267              this.readers.gml._inherit.apply(this, [a, c, b]);
6268              this.readChildNodes(a, c);
6269              b.components = [new OpenLayers.Geometry.MultiPoint(c.components)];
6270          },
6271          pointMember: function (a, b) {
6272              this.readChildNodes(a, b);
6273          },
6274          LineString: function (a, b) {
6275              var c = {};
6276              this.readers.gml._inherit.apply(this, [a, c, b]);
6277              this.readChildNodes(a, c);
6278              b.components || (b.components = []);
6279              b.components.push(new OpenLayers.Geometry.LineString(c.points));
6280          },
6281          MultiLineString: function (a, b) {
6282              var c = { components: [] };
6283              this.readers.gml._inherit.apply(this, [a, c, b]);
6284              this.readChildNodes(a, c);
6285              b.components = [new OpenLayers.Geometry.MultiLineString(c.components)];
6286          },
6287          lineStringMember: function (a, b) {
6288              this.readChildNodes(a, b);
6289          },
6290          Polygon: function (a, b) {
6291              var c = { outer: null, inner: [] };
6292              this.readers.gml._inherit.apply(this, [a, c, b]);
6293              this.readChildNodes(a, c);
6294              c.inner.unshift(c.outer);
6295              b.components || (b.components = []);
6296              b.components.push(new OpenLayers.Geometry.Polygon(c.inner));
6297          },
6298          LinearRing: function (a, b) {
6299              var c = {};
6300              this.readers.gml._inherit.apply(this, [a, c]);
6301              this.readChildNodes(a, c);
6302              b.components = [new OpenLayers.Geometry.LinearRing(c.points)];
6303          },
6304          MultiPolygon: function (a, b) {
6305              var c = { components: [] };
6306              this.readers.gml._inherit.apply(this, [a, c, b]);
6307              this.readChildNodes(a, c);
6308              b.components = [new OpenLayers.Geometry.MultiPolygon(c.components)];
6309          },
6310          polygonMember: function (a, b) {
6311              this.readChildNodes(a, b);
6312          },
6313          GeometryCollection: function (a, b) {
6314              var c = { components: [] };
6315              this.readers.gml._inherit.apply(this, [a, c, b]);
6316              this.readChildNodes(a, c);
6317              b.components = [new OpenLayers.Geometry.Collection(c.components)];
6318          },
6319          geometryMember: function (a, b) {
6320              this.readChildNodes(a, b);
6321          },
6322      },
6323      feature: {
6324          "*": function (a, b) {
6325              var c,
6326                  d = a.localName || a.nodeName.split(":").pop();
6327              b.features
6328                  ? this.singleFeatureType || -1 === OpenLayers.Util.indexOf(this.featureType, d)
6329                      ? d === this.featureType && (c = "_typeName")
6330                      : (c = "_typeName")
6331                  : 0 == a.childNodes.length || (1 == a.childNodes.length && 3 == a.firstChild.nodeType)
6332                  ? this.extractAttributes && (c = "_attribute")
6333                  : (c = "_geometry");
6334              c && this.readers.feature[c].apply(this, [a, b]);
6335          },
6336          _typeName: function (a, b) {
6337              var c = { components: [], attributes: {} };
6338              this.readChildNodes(a, c);
6339              c.name && (c.attributes.name = c.name);
6340              var d = new OpenLayers.Feature.Vector(c.components[0], c.attributes);
6341              this.singleFeatureType || ((d.type = a.nodeName.split(":").pop()), (d.namespace = a.namespaceURI));
6342              var e = a.getAttribute("fid") || this.getAttributeNS(a, this.namespaces.gml, "id");
6343              e && (d.fid = e);
6344              this.internalProjection && this.externalProjection && d.geometry && d.geometry.transform(this.externalProjection, this.internalProjection);
6345              c.bounds && (d.bounds = c.bounds);
6346              b.features.push(d);
6347          },
6348          _geometry: function (a, b) {
6349              this.geometryName || (this.geometryName = a.nodeName.split(":").pop());
6350              this.readChildNodes(a, b);
6351          },
6352          _attribute: function (a, b) {
6353              var c = a.localName || a.nodeName.split(":").pop(),
6354                  d = this.getChildValue(a);
6355              b.attributes[c] = d;
6356          },
6357      },
6358      wfs: {
6359          FeatureCollection: function (a, b) {
6360              this.readChildNodes(a, b);
6361          },
6362      },
6363  },
6364  write: function (a) {
6365      var b;
6366      b = OpenLayers.Util.isArray(a) ? "featureMembers" : "featureMember";
6367      a = this.writeNode("gml:" + b, a);
6368      this.setAttributeNS(a, this.namespaces.xsi, "xsi:schemaLocation", this.schemaLocation);
6369      return OpenLayers.Format.XML.prototype.write.apply(this, [a]);
6370  },
6371  writers: {
6372      gml: {
6373          featureMember: function (a) {
6374              var b = this.createElementNSPlus("gml:featureMember");
6375              this.writeNode("feature:_typeName", a, b);
6376              return b;
6377          },
6378          MultiPoint: function (a) {
6379              var b = this.createElementNSPlus("gml:MultiPoint");
6380              a = a.components || [a];
6381              for (var c = 0, d = a.length; c < d; ++c) this.writeNode("pointMember", a[c], b);
6382              return b;
6383          },
6384          pointMember: function (a) {
6385              var b = this.createElementNSPlus("gml:pointMember");
6386              this.writeNode("Point", a, b);
6387              return b;
6388          },
6389          MultiLineString: function (a) {
6390              var b = this.createElementNSPlus("gml:MultiLineString");
6391              a = a.components || [a];
6392              for (var c = 0, d = a.length; c < d; ++c) this.writeNode("lineStringMember", a[c], b);
6393              return b;
6394          },
6395          lineStringMember: function (a) {
6396              var b = this.createElementNSPlus("gml:lineStringMember");
6397              this.writeNode("LineString", a, b);
6398              return b;
6399          },
6400          MultiPolygon: function (a) {
6401              var b = this.createElementNSPlus("gml:MultiPolygon");
6402              a = a.components || [a];
6403              for (var c = 0, d = a.length; c < d; ++c) this.writeNode("polygonMember", a[c], b);
6404              return b;
6405          },
6406          polygonMember: function (a) {
6407              var b = this.createElementNSPlus("gml:polygonMember");
6408              this.writeNode("Polygon", a, b);
6409              return b;
6410          },
6411          GeometryCollection: function (a) {
6412              for (var b = this.createElementNSPlus("gml:GeometryCollection"), c = 0, d = a.components.length; c < d; ++c) this.writeNode("geometryMember", a.components[c], b);
6413              return b;
6414          },
6415          geometryMember: function (a) {
6416              var b = this.createElementNSPlus("gml:geometryMember");
6417              a = this.writeNode("feature:_geometry", a);
6418              b.appendChild(a.firstChild);
6419              return b;
6420          },
6421      },
6422      feature: {
6423          _typeName: function (a) {
6424              var b = this.createElementNSPlus("feature:" + this.featureType, { attributes: { fid: a.fid } });
6425              a.geometry && this.writeNode("feature:_geometry", a.geometry, b);
6426              for (var c in a.attributes) {
6427                  var d = a.attributes[c];
6428                  null != d && this.writeNode("feature:_attribute", { name: c, value: d }, b);
6429              }
6430              return b;
6431          },
6432          _geometry: function (a) {
6433              this.externalProjection && this.internalProjection && (a = a.clone().transform(this.internalProjection, this.externalProjection));
6434              var b = this.createElementNSPlus("feature:" + this.geometryName);
6435              a = this.writeNode("gml:" + this.geometryTypes[a.CLASS_NAME], a, b);
6436              this.srsName && a.setAttribute("srsName", this.srsName);
6437              return b;
6438          },
6439          _attribute: function (a) {
6440              return this.createElementNSPlus("feature:" + a.name, { value: a.value });
6441          },
6442      },
6443      wfs: {
6444          FeatureCollection: function (a) {
6445              for (var b = this.createElementNSPlus("wfs:FeatureCollection"), c = 0, d = a.length; c < d; ++c) this.writeNode("gml:featureMember", a[c], b);
6446              return b;
6447          },
6448      },
6449  },
6450  setGeometryTypes: function () {
6451      this.geometryTypes = {
6452          "OpenLayers.Geometry.Point": "Point",
6453          "OpenLayers.Geometry.MultiPoint": "MultiPoint",
6454          "OpenLayers.Geometry.LineString": "LineString",
6455          "OpenLayers.Geometry.MultiLineString": "MultiLineString",
6456          "OpenLayers.Geometry.Polygon": "Polygon",
6457          "OpenLayers.Geometry.MultiPolygon": "MultiPolygon",
6458          "OpenLayers.Geometry.Collection": "GeometryCollection",
6459      };
6460  },
6461  CLASS_NAME: "OpenLayers.Format.GML.Base",
6462});
6463OpenLayers.Format.GML.v3 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
6464  schemaLocation: "http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",
6465  curve: !1,
6466  multiCurve: !0,
6467  surface: !1,
6468  multiSurface: !0,
6469  initialize: function (a) {
6470      OpenLayers.Format.GML.Base.prototype.initialize.apply(this, [a]);
6471  },
6472  readers: {
6473      gml: OpenLayers.Util.applyDefaults(
6474          {
6475              _inherit: function (a, b, c) {
6476                  if ((a = parseInt(a.getAttribute("srsDimension"), 10) || (c && c.srsDimension))) b.srsDimension = a;
6477              },
6478              featureMembers: function (a, b) {
6479                  this.readChildNodes(a, b);
6480              },
6481              Curve: function (a, b) {
6482                  var c = { points: [] };
6483                  this.readers.gml._inherit.apply(this, [a, c, b]);
6484                  this.readChildNodes(a, c);
6485                  b.components || (b.components = []);
6486                  b.components.push(new OpenLayers.Geometry.LineString(c.points));
6487              },
6488              segments: function (a, b) {
6489                  this.readChildNodes(a, b);
6490              },
6491              LineStringSegment: function (a, b) {
6492                  var c = {};
6493                  this.readChildNodes(a, c);
6494                  c.points && Array.prototype.push.apply(b.points, c.points);
6495              },
6496              pos: function (a, b) {
6497                  var c = this.getChildValue(a).replace(this.regExes.trimSpace, "").split(this.regExes.splitSpace),
6498                      c = this.xy ? new OpenLayers.Geometry.Point(c[0], c[
64981], c[2]) : new OpenLayers.Geometry.Point(c[1], c[0], c[2]);
6499                  b.points = [c];
6500              },
6501              posList: function (a, b) {
6502                  for (
6503                      var c = this.getChildValue(a).replace(this.regExes.trimSpace, "").split(this.regExes.splitSpace),
6504                          d = b.srsDimension || parseInt(a.getAttribute("srsDimension") || a.getAttribute("dimension"), 10) || 2,
6505                          e,
6506                          f,
6507                          g,
6508                          h = Array(c.length / d),
6509                          k = 0,
6510                          l = c.length;
6511                      k < l;
6512                      k += d
6513                  )
6514                      (e = c[k]), (f = c[k + 1]), (g = 2 == d ? void 0 : c[k + 2]), (h[k / d] = this.xy ? new OpenLayers.Geometry.Point(e, f, g) : new OpenLayers.Geometry.Point(f, e, g));
6515                  b.points = h;
6516              },
6517              Surface: function (a, b) {
6518                  this.readChildNodes(a, b);
6519              },
6520              patches: function (a, b) {
6521                  this.readChildNodes(a, b);
6522              },
6523              PolygonPatch: function (a, b) {
6524                  this.readers.gml.Polygon.apply(this, [a, b]);
6525              },
6526              exterior: function (a, b) {
6527                  var c = {};
6528                  this.readChildNodes(a, c);
6529                  b.outer = c.components[0];
6530              },
6531              interior: function (a, b) {
6532                  var c = {};
6533                  this.readChildNodes(a, c);
6534                  b.inner.push(c.components[0]);
6535              },
6536              MultiCurve: function (a, b) {
6537                  var c = { components: [] };
6538                  this.readers.gml._inherit.apply(this, [a, c, b]);
6539                  this.readChildNodes(a, c);
6540                  0 < c.components.length && (b.components = [new OpenLayers.Geometry.MultiLineString(c.components)]);
6541              },
6542              curveMember: function (a, b) {
6543                  this.readChildNodes(a, b);
6544              },
6545              MultiSurface: function (a, b) {
6546                  var c = { components: [] };
6547                  this.readers.gml._inherit.apply(this, [a, c, b]);
6548                  this.readChildNodes(a, c);
6549                  0 < c.components.length && (b.components = [new OpenLayers.Geometry.MultiPolygon(c.components)]);
6550              },
6551              surfaceMember: function (a, b) {
6552                  this.readChildNodes(a, b);
6553              },
6554              surfaceMembers: function (a, b) {
6555                  this.readChildNodes(a, b);
6556              },
6557              pointMembers: function (a, b) {
6558                  this.readChildNodes(a, b);
6559              },
6560              lineStringMembers: function (a, b) {
6561                  this.readChildNodes(a, b);
6562              },
6563              polygonMembers: function (a, b) {
6564                  this.readChildNodes(a, b);
6565              },
6566              geometryMembers: function (a, b) {
6567                  this.readChildNodes(a, b);
6568              },
6569              Envelope: function (a, b) {
6570                  var c = { points: Array(2) };
6571                  this.readChildNodes(a, c);
6572                  b.components || (b.components = []);
6573                  var d = c.points[0],
6574                      c = c.points[1];
6575                  b.components.push(new OpenLayers.Bounds(d.x, d.y, c.x, c.y));
6576              },
6577              lowerCorner: function (a, b) {
6578                  var c = {};
6579                  this.readers.gml.pos.apply(this, [a, c]);
6580                  b.points[0] = c.points[0];
6581              },
6582              upperCorner: function (a, b) {
6583                  var c = {};
6584                  this.readers.gml.pos.apply(this, [a, c]);
6585                  b.points[1] = c.points[0];
6586              },
6587          },
6588          OpenLayers.Format.GML.Base.prototype.readers.gml
6589      ),
6590      feature: OpenLayers.Format.GML.Base.prototype.readers.feature,
6591      wfs: OpenLayers.Format.GML.Base.prototype.readers.wfs,
6592  },
6593  write: function (a) {
6594      var b;
6595      b = OpenLayers.Util.isArray(a) ? "featureMembers" : "featureMember";
6596      a = this.writeNode("gml:" + b, a);
6597      this.setAttributeNS(a, this.namespaces.xsi, "xsi:schemaLocation", this.schemaLocation);
6598      return OpenLayers.Format.XML.prototype.write.apply(this, [a]);
6599  },
6600  writers: {
6601      gml: OpenLayers.Util.applyDefaults(
6602          {
6603              featureMembers: function (a) {
6604                  for (var b = this.createElementNSPlus("gml:featureMembers"), c = 0, d = a.length; c < d; ++c) this.writeNode("feature:_typeName", a[c], b);
6605                  return b;
6606              },
6607              Point: function (a) {
6608                  var b = this.createElementNSPlus("gml:Point");
6609                  this.writeNode("pos", a, b);
6610                  return b;
6611              },
6612              pos: function (a) {
6613                  return this.createElementNSPlus("gml:pos", { value: this.xy ? a.x + " " + a.y : a.y + " " + a.x });
6614              },
6615              LineString: function (a) {
6616                  var b = this.createElementNSPlus("gml:LineString");
6617                  this.writeNode("posList", a.components, b);
6618                  return b;
6619              },
6620              Curve: function (a) {
6621                  var b = this.createElementNSPlus("gml:Curve");
6622                  this.writeNode("segments", a, b);
6623                  return b;
6624              },
6625              segments: function (a) {
6626                  var b = this.createElementNSPlus("gml:segments");
6627                  this.writeNode("LineStringSegment", a, b);
6628                  return b;
6629              },
6630              LineStringSegment: function (a) {
6631                  var b = this.createElementNSPlus("gml:LineStringSegment");
6632                  this.writeNode("posList", a.components, b);
6633                  return b;
6634              },
6635              posList: function (a) {
6636                  for (var b = a.length, c = Array(b), d, e = 0; e < b; ++e) (d = a[e]), (c[e] = this.xy ? d.x + " " + d.y : d.y + " " + d.x);
6637                  return this.createElementNSPlus("gml:posList", { value: c.join(" ") });
6638              },
6639              Surface: function (a) {
6640                  var b = this.createElementNSPlus("gml:Surface");
6641                  this.writeNode("patches", a, b);
6642                  return b;
6643              },
6644              patches: function (a) {
6645                  var b = this.createElementNSPlus("gml:patches");
6646                  this.writeNode("PolygonPatch", a, b);
6647                  return b;
6648              },
6649              PolygonPatch: function (a) {
6650                  var b = this.createElementNSPlus("gml:PolygonPatch", { attributes: { interpolation: "planar" } });
6651                  this.writeNode("exterior", a.components[0], b);
6652                  for (var c = 1, d = a.components.length; c < d; ++c) this.writeNode("interior", a.components[c], b);
6653                  return b;
6654              },
6655              Polygon: function (a) {
6656                  var b = this.createElementNSPlus("gml:Polygon");
6657                  this.writeNode("exterior", a.components[0], b);
6658                  for (var c = 1, d = a.components.length; c < d; ++c) this.writeNode("interior", a.components[c], b);
6659                  return b;
6660              },
6661              exterior: function (a) {
6662                  var b = this.createElementNSPlus("gml:exterior");
6663                  this.writeNode("LinearRing", a, b);
6664                  return b;
6665              },
6666              interior: function (a) {
6667                  var b = this.createElementNSPlus("gml:interior");
6668                  this.writeNode("LinearRing", a, b);
6669                  return b;
6670              },
6671              LinearRing: function (a) {
6672                  var b = this.createElementNSPlus("gml:LinearRing");
6673                  this.writeNode("posList", a.components, b);
6674                  return b;
6675              },
6676              MultiCurve: function (a) {
6677                  var b = this.createElementNSPlus("gml:MultiCurve");
6678                  a = a.components || [a];
6679                  for (var c = 0, d = a.length; c < d; ++c) this.writeNode("curveMember", a[c], b);
6680                  return b;
6681              },
6682              curveMember: function (a) {
6683                  var b = this.createElementNSPlus("gml:curveMember");
6684                  this.curve ? this.writeNode("Curve", a, b) : this.writeNode("LineString", a, b);
6685                  return b;
6686              },
6687              MultiSurface: function (a) {
6688                  var b = this.createElementNSPlus("gml:MultiSurface");
6689                  a = a.components || [a];
6690                  for (var c = 0, d = a.length; c < d; ++c) this.writeNode("surfaceMember", a[c], b);
6691                  return b;
6692              },
6693              surfaceMember: function (a) {
6694                  var b = this.createElementNSPlus("gml:surfaceMember");
6695                  this.surface ? this.writeNode("Surface", a, b) : this.writeNode("Polygon", a, b);
6696                  return b;
6697              },
6698              Envelope: function (a) {
6699                  var b = this.createElementNSPlus("gml:Envelope");
6700                  this.writeNode("lowerCorner", a, b);
6701                  this.writeNode("upperCorner", a, b);
6702                  this.srsName && b.setAttribute("srsName", this.srsName);
6703                  return b;
6704              },
6705              lowerCorner: function (a) {
6706                  return this.createElementNSPlus("gml:lowerCorner", { value: this.xy ? a.left + " " + a.bottom : a.bottom + " " + a.left });
6707              },
6708              upperCorner: function (a) {
6709                  return this.createElementNSPlus("gml:upperCorner", { value: this.xy ? a.right + " " + a.top : a.top + " " + a.right });
6710              },
6711          },
6712          OpenLayers.Format.GML.Base.prototype.writers.gml
6713      ),
6714      feature: OpenLayers.Format.GML.Base.prototype.writers.feature,
6715      wfs: OpenLayers.Format.GML.Base.prototype.writers.wfs,
6716  },
6717  setGeometryTypes: function () {
6718      this.geometryTypes = {
6719          "OpenLayers.Geometry.Point": "Point",
6720          "OpenLayers.Geometry.MultiPoint": "MultiPoint",
6721          "OpenLayers.Geometry.LineString": !0 === this.curve ? "Curve" : "LineString",
6722          "OpenLayers.Geometry.MultiLineString": !1 === this.multiCurve ? "MultiLineString" : "MultiCurve",
6723          "OpenLayers.Geometry.Polygon": !0 === this.surface ? "
6723Surface" : "Polygon",
6724          "OpenLayers.Geometry.MultiPolygon": !1 === this.multiSurface ? "MultiPolygon" : "MultiSurface",
6725          "OpenLayers.Geometry.Collection": "GeometryCollection",
6726      };
6727  },
6728  CLASS_NAME: "OpenLayers.Format.GML.v3",
6729});
6730OpenLayers.Format.Filter.v1_1_0 = OpenLayers.Class(OpenLayers.Format.GML.v3, OpenLayers.Format.Filter.v1, {
6731  VERSION: "1.1.0",
6732  schemaLocation: "http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",
6733  initialize: function (a) {
6734      OpenLayers.Format.GML.v3.prototype.initialize.apply(this, [a]);
6735  },
6736  readers: {
6737      ogc: OpenLayers.Util.applyDefaults(
6738          {
6739              PropertyIsEqualTo: function (a, b) {
6740                  var c = a.getAttribute("matchCase"),
6741                      c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.EQUAL_TO, matchCase: !("false" === c || "0" === c) });
6742                  this.readChildNodes(a, c);
6743                  b.filters.push(c);
6744              },
6745              PropertyIsNotEqualTo: function (a, b) {
6746                  var c = a.getAttribute("matchCase"),
6747                      c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.NOT_EQUAL_TO, matchCase: !("false" === c || "0" === c) });
6748                  this.readChildNodes(a, c);
6749                  b.filters.push(c);
6750              },
6751              PropertyIsLike: function (a, b) {
6752                  var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.LIKE });
6753                  this.readChildNodes(a, c);
6754                  var d = a.getAttribute("wildCard"),
6755                      e = a.getAttribute("singleChar"),
6756                      f = a.getAttribute("escapeChar");
6757                  c.value2regex(d, e, f);
6758                  b.filters.push(c);
6759              },
6760          },
6761          OpenLayers.Format.Filter.v1.prototype.readers.ogc
6762      ),
6763      gml: OpenLayers.Format.GML.v3.prototype.readers.gml,
6764      feature: OpenLayers.Format.GML.v3.prototype.readers.feature,
6765  },
6766  writers: {
6767      ogc: OpenLayers.Util.applyDefaults(
6768          {
6769              PropertyIsEqualTo: function (a) {
6770                  var b = this.createElementNSPlus("ogc:PropertyIsEqualTo", { attributes: { matchCase: a.matchCase } });
6771                  this.writeNode("PropertyName", a, b);
6772                  this.writeOgcExpression(a.value, b);
6773                  return b;
6774              },
6775              PropertyIsNotEqualTo: function (a) {
6776                  var b = this.createElementNSPlus("ogc:PropertyIsNotEqualTo", { attributes: { matchCase: a.matchCase } });
6777                  this.writeNode("PropertyName", a, b);
6778                  this.writeOgcExpression(a.value, b);
6779                  return b;
6780              },
6781              PropertyIsLike: function (a) {
6782                  var b = this.createElementNSPlus("ogc:PropertyIsLike", { attributes: { matchCase: a.matchCase, wildCard: "*", singleChar: ".", escapeChar: "!" } });
6783                  this.writeNode("PropertyName", a, b);
6784                  this.writeNode("Literal", a.regex2value(), b);
6785                  return b;
6786              },
6787              BBOX: function (a) {
6788                  var b = this.createElementNSPlus("ogc:BBOX");
6789                  a.property && this.writeNode("PropertyName", a, b);
6790                  var c = this.writeNode("gml:Envelope", a.value);
6791                  a.projection && c.setAttribute("srsName", a.projection);
6792                  b.appendChild(c);
6793                  return b;
6794              },
6795              SortBy: function (a) {
6796                  for (var b = this.createElementNSPlus("ogc:SortBy"), c = 0, d = a.length; c < d; c++) this.writeNode("ogc:SortProperty", a[c], b);
6797                  return b;
6798              },
6799              SortProperty: function (a) {
6800                  var b = this.createElementNSPlus("ogc:SortProperty");
6801                  this.writeNode("ogc:PropertyName", a, b);
6802                  this.writeNode("ogc:SortOrder", "DESC" == a.order ? "DESC" : "ASC", b);
6803                  return b;
6804              },
6805              SortOrder: function (a) {
6806                  return this.createElementNSPlus("ogc:SortOrder", { value: a });
6807              },
6808          },
6809          OpenLayers.Format.Filter.v1.prototype.writers.ogc
6810      ),
6811      gml: OpenLayers.Format.GML.v3.prototype.writers.gml,
6812      feature: OpenLayers.Format.GML.v3.prototype.writers.feature,
6813  },
6814  writeSpatial: function (a, b) {
6815      var c = this.createElementNSPlus("ogc:" + b);
6816      this.writeNode("PropertyName", a, c);
6817      if (a.value instanceof OpenLayers.Filter.Function) this.writeNode("Function", a.value, c);
6818      else {
6819          var d;
6820          d = a.value instanceof OpenLayers.Geometry ? this.writeNode("feature:_geometry", a.value).firstChild : this.writeNode("gml:Envelope", a.value);
6821          a.projection && d.setAttribute("srsName", a.projection);
6822          c.appendChild(d);
6823      }
6824      return c;
6825  },
6826  CLASS_NAME: "OpenLayers.Format.Filter.v1_1_0",
6827});
6828OpenLayers.Format.OWSCommon = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, {
6829  defaultVersion: "1.0.0",
6830  getVersion: function (a, b) {
6831      var c = this.version;
6832      if (!c) {
6833          var d = a.getAttribute("xmlns:ows");
6834          d && "1.1" === d.substring(d.lastIndexOf("/") + 1) && (c = "1.1.0");
6835          c || (c = this.defaultVersion);
6836      }
6837      return c;
6838  },
6839  CLASS_NAME: "OpenLayers.Format.OWSCommon",
6840});
6841OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
6842  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
6843  read: function (a, b) {
6844      OpenLayers.Util.applyDefaults(b, this.options);
6845      var c = {};
6846      this.readChildNodes(a, c);
6847      return c;
6848  },
6849  readers: {
6850      ows: {
6851          Exception: function (a, b) {
6852              var c = { code: a.getAttribute("exceptionCode"), locator: a.getAttribute("locator"), texts: [] };
6853              b.exceptions.push(c);
6854              this.readChildNodes(a, c);
6855          },
6856          ExceptionText: function (a, b) {
6857              var c = this.getChildValue(a);
6858              b.texts.push(c);
6859          },
6860          ServiceIdentification: function (a, b) {
6861              b.serviceIdentification = {};
6862              this.readChildNodes(a, b.serviceIdentification);
6863          },
6864          Title: function (a, b) {
6865              b.title = this.getChildValue(a);
6866          },
6867          Abstract: function (a, b) {
6868              b["abstract"] = this.getChildValue(a);
6869          },
6870          Keywords: function (a, b) {
6871              b.keywords = {};
6872              this.readChildNodes(a, b.keywords);
6873          },
6874          Keyword: function (a, b) {
6875              b[this.getChildValue(a)] = !0;
6876          },
6877          ServiceType: function (a, b) {
6878              b.serviceType = { codeSpace: a.getAttribute("codeSpace"), value: this.getChildValue(a) };
6879          },
6880          ServiceTypeVersion: function (a, b) {
6881              b.serviceTypeVersion = this.getChildValue(a);
6882          },
6883          Fees: function (a, b) {
6884              b.fees = this.getChildValue(a);
6885          },
6886          AccessConstraints: function (a, b) {
6887              b.accessConstraints = this.getChildValue(a);
6888          },
6889          ServiceProvider: function (a, b) {
6890              b.serviceProvider = {};
6891              this.readChildNodes(a, b.serviceProvider);
6892          },
6893          ProviderName: function (a, b) {
6894              b.providerName = this.getChildValue(a);
6895          },
6896          ProviderSite: function (a, b) {
6897              b.providerSite = this.getAttributeNS(a, this.namespaces.xlink, "href");
6898          },
6899          ServiceContact: function (a, b) {
6900              b.serviceContact = {};
6901              this.readChildNodes(a, b.serviceContact);
6902          },
6903          IndividualName: function (a, b) {
6904              b.individualName = this.getChildValue(a);
6905          },
6906          PositionName: function (a, b) {
6907              b.positionName = this.getChildValue(a);
6908          },
6909          ContactInfo: function (a, b) {
6910              b.contactInfo = {};
6911              this.readChildNodes(a, b.contactInfo);
6912          },
6913          Phone: function (a, b) {
6914              b.phone = {};
6915              this.readChildNodes(a, b.phone);
6916          },
6917          Voice: function (a, b) {
6918              b.voice = this.getChildValue(a);
6919          },
6920          Address: function (a, b) {
6921              b.address = {};
6922              this.readChildNodes(a, b.address);
6923          },
6924          DeliveryPoint: function (a, b) {
6925              b.deliveryPoint = this.getChildValue(a);
6926          },
6927          City: function (a, b) {
6928              b.city = this.getChildValue(a);
6929          },
6930          AdministrativeArea: function (a, b) {
6931              b.administrativeArea = this.getChildValue(a);
6932          },
6933          PostalCode: function (a, b) {
6934              b.postalCode = this.getChildValue(a);
6935          },
6936          Country: function (a, b) {
6937              b.country = this.getChildValue(a);
6938          },
6939          ElectronicMailAddress: function (a, b) {
6940              b.electronicMailAddress = this.getChildValue(a);
6941          },
6942          Role: function (a, b) {
6943              b.role = this.getChildValue(a);
6944          },
6945          OperationsMetadata: function (a, b) {
6946              b.operationsMetadata = {};
6947              this.readChildNodes(a, b.operationsMetadata);
6948          },
6949          Operation: function (a, b) {
6950              var c = a.getAttribute("name");
6951              b[c] = {};
6952              this.readChildNodes(a, b[c]);
6953          },
6954          DCP: function (a, b) {
6955              b.dcp = {};
6956              this.readChildNodes(a, b.dcp);
6957          },
6958          HTTP: function (a, b) {
6959              b.http = {};
6960              this.readChildNodes(a, b.http);
6961          },
6962          Get: function (a, b) {
6963              b.get || (b.get = []);
6964              var c = { url: this.getAttributeNS(a, this.namespaces.xlink, "href") };
6965              this.readChildNodes(a, c);
6966              b.get.push(c);
6967          },
6968          Post: function (a, b) {
6969              b.post || (b.post = []);
6970              var c = { url: this.getAttributeNS(a, this.namespaces.xlink, "href") };
6971              this.readChildNodes(a, c);
6972              b.post.push(c);
6973          },
6974          Parameter: function (a, b) {
6975              b.parameters || (b.parameters = {});
6976              var c = a.getAttribute("name");
6977              b.parameters[c] = {};
6978              this.readChildNodes(a, b.parameters[c]);
6979          },
6980          Constraint: function (a, b) {
6981              b.constraints || (b.constraints = {});
6982              var c = a.getAttribute("name");
6983              b.constraints[c] = {};
6984              this.readChildNodes(a, b.constraints[c]);
6985          },
6986          Value: function (a, b) {
6987              b[this.getChildValue(a)] = !0;
6988          },
6989          OutputFormat: function (a, b) {
6990              b.formats.push({ value: this.getChildValue(a) });
6991              this.readChildNodes(a, b);
6992          },
6993          WGS84BoundingBox: function (a, b) {
6994              var c = {};
6995              c.crs = a.getAttribute("crs");
6996              b.BoundingBox ? b.BoundingBox.push(c) : ((b.projection = c.crs), (c = b));
6997              this.readChildNodes(a, c);
6998          },
6999          BoundingBox: function (a, b) {
7000              this.readers.ows.WGS84BoundingBox.apply(this, [a, b]);
7001          },
7002          LowerCorner: function (a, b) {
7003              var c = this.getChildValue(a).replace(this.regExes.trimSpace, ""),
7004                  c = c.replace(this.regExes.trimComma, ","),
7005                  c = c.split(this.regExes.splitSpace);
7006              b.left = c[0];
7007              b.bottom = c[1];
7008          },
7009          UpperCorner: function (a, b) {
7010              var c = this.getChildValue(a).replace(this.regExes.trimSpace, ""),
7011                  c = c.replace(this.regExes.trimComma, ","),
7012                  c = c.split(this.regExes.splitSpace);
7013              b.right = c[0];
7014              b.top = c[1];
7015              b.bounds = new OpenLayers.Bounds(b.left, b.bottom, b.right, b.top);
7016              delete b.left;
7017              delete b.bottom;
7018              delete b.right;
7019              delete b.top;
7020          },
7021          Language: function (a, b) {
7022              b.language = this.getChildValue(a);
7023          },
7024      },
7025  },
7026  writers: {
7027      ows: {
7028          BoundingBox: function (a, b) {
7029              var c = this.createElementNSPlus(b || "ows:BoundingBox", { attributes: { crs: a.projection } });
7030              this.writeNode("ows:LowerCorner", a, c);
7031              this.writeNode("ows:UpperCorner", a, c);
7032              return c;
7033          },
7034          LowerCorner: function (a) {
7035              return this.createElementNSPlus("ows:LowerCorner", { value: a.bounds.left + " " + a.bounds.bottom });
7036          },
7037          UpperCorner: function (a) {
7038              return this.createElementNSPlus("ows:UpperCorner", { value: a.bounds.right + " " + a.bounds.top });
7039          },
7040          Identifier: function (a) {
7041              return this.createElementNSPlus("ows:Identifier", { value: a });
7042          },
7043          Title: function (a) {
7044              return this.createElementNSPlus("ows:Title", { value: a });
7045          },
7046          Abstract: function (a) {
7047              return this.createElementNSPlus("ows:Abstract", { value: a });
7048          },
7049          OutputFormat: function (a) {
7050              return this.createElementNSPlus("ows:OutputFormat", { value: a });
7051          },
7052      },
7053  },
7054  CLASS_NAME: "OpenLayers.Format.OWSCommon.v1",
7055});
7056OpenLayers.Format.OWSCommon.v1_0_0 = OpenLayers.Class(OpenLayers.Format.OWSCommon.v1, {
7057  namespaces: { ows: "http://www.opengis.net/ows", xlink: "http://www.w3.org/1999/xlink" },
7058  readers: {
7059      ows: OpenLayers.Util.applyDefaults(
7060          {
7061              ExceptionReport: function (a, b) {
7062                  b.success = !1;
7063                  b.exceptionReport = { version: a.getAttribute("version"), language: a.getAttribute("language"), exceptions: [] };
7064                  this.readChildNodes(a, b.exceptionReport);
7065              },
7066          },
7067          OpenLayers.Format.OWSCommon.v1.prototype.readers.ows
7068      ),
7069  },
7070  writers: { ows: OpenLayers.Format.OWSCommon.v1.prototype.writers.ows },
7071  CLASS_NAME: "OpenLayers.Format.OWSCommon.v1_0_0",
7072});
7073OpenLayers.Format.WFST.v1_1_0 = OpenLayers.Class(OpenLayers.Format.Filter.v1_1_0, OpenLayers.Format.WFST.v1, {
7074  version: "1.1.0",
7075  schemaLocations: { wfs: "http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" },
7076  initialize: function (a) {
7077      OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this, [a]);
7078      OpenLayers.Format.WFST.v1.prototype.initialize.apply(this, [a]);
7079  },
7080  readNode: function (a, b, c) {
7081      return OpenLayers.Format.GML.v3.prototype.readNode.apply(this, arguments);
7082  },
7083  readers: {
7084      wfs: OpenLayers.Util.applyDefaults(
7085          {
7086              FeatureCollection: function (a, b) {
7087                  b.numberOfFeatures = parseInt(a.getAttribute("numberOfFeatures"));
7088                  OpenLayers.Format.WFST.v1.prototype.readers.wfs.FeatureCollection.apply(this, arguments);
7089              },
7090              TransactionResponse: function (a, b) {
7091                  b.insertIds = [];
7092                  b.success = !1;
7093                  this.readChildNodes(a, b);
7094              },
7095              TransactionSummary: function (a, b) {
7096                  b.success = !0;
7097              },
7098              InsertResults: function (a, b) {
7099                  this.readChildNodes(a, b);
7100              },
7101              Feature: function (a, b) {
7102                  var c = { fids: [] };
7103                  this.readChildNodes(a, c);
7104                  b.insertIds.push(c.fids[0]);
7105              },
7106          },
7107          OpenLayers.Format.WFST.v1.prototype.readers.wfs
7108      ),
7109      gml: OpenLayers.Format.GML.v3.prototype.readers.gml,
7110      feature: OpenLayers.Format.GML.v3.prototype.readers.feature,
7111      ogc: OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc,
7112      ows: OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows,
7113  },
7114  writers: {
7115      wfs: OpenLayers.Util.applyDefaults(
7116          {
7117              GetFeature: function (a) {
7118                  var b = OpenLayers.Format.WFST.v1.prototype.writers.wfs.GetFeature.apply(this, arguments);
7119                  a && this.setAttributes(b, { resultType: a.resultType, startIndex: a.startIndex, count: a.count });
7120                  return b;
7121              },
7122              Query: function (a) {
7123                  a = OpenLayers.Util.extend({ featureNS: this.featureNS, featurePrefix: this.featurePrefix, featureType: this.featureType, srsName: this.srsName }, a);
7124                  var b = a.featurePrefix,
7125                      c = this.createElementNSPlus("wfs:Query", { attributes: { typeName: (b ? b + ":" : "") + a.featureType, srsName: a.srsName } });
7126                  a.featureNS && c.setAttribute("xmlns:" + b, a.featureNS);
7127                  if (a.propertyNames) for (var b = 0, d = a.propertyNames.length; b < d; b++) this.writeNode("wfs:PropertyName", { property: a.propertyNames[b] }, c);
7128                  a.filter && (OpenLayers.Format.WFST.v1_1_0.prototype.setFilterProperty.call(this, a.filter), this.writeNode("ogc:Filter", a.filter, c));
7129                  return c;
7130              },
7131              PropertyName: function (a) {
7132                  return this.createElementNSPlus("wfs:PropertyName", { value: a.property });
7133              },
7134          },
7135          OpenLayers.Format.WFST.v1.prototype.writers.wfs
7136      ),
7137      gml: OpenLayers.Format.GML.v3.prototype.writers.gml,
7138      feature: OpenLayers.Format.GML.v3.prototype.writers.feature,
7139      ogc: OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc,
7140  },
7141  CLASS_NAME: "OpenLayers.Format.WFST.v1_1_0",
7142});
7143OpenLayers.Protocol = OpenLayers.Class({
7144  format: null,
7145  options: null,
7146  autoDestroy: !0,
7147  defaultFilter: null,
7148  initialize: function (a) {
7149      a = a || {};
7150      OpenLayers.Util.extend(this, a);
7151      this.options = a;
7152  },
7153  mergeWithDefaultFilter: function (a) {
7154      return a && this.defaultFilter ? new OpenLayers.Filter.Logical({ type: OpenLayers.Filter.Logical.AND, filters: [this.defaultFilter, a] }) : a || this.defaultFilter || void 0;
7155  },
7156  destroy: function () {
7157      this.format = this.options = null;
7158  },
7159  read: function (a) {
7160      a = a || {};
7161      a.filter = this.mergeWithDefaultFilter(a.filter);
7162  },
7163  create: function () {},
7164  update: function () {},
7165  delete: function () {},
7166  commit: function () {},
7167  abort: function (a) {},
7168  createCallback: function (a, b, c) {
7169      return OpenLayers.Function.bind(function () {
7170          a.apply(this, [b, c]);
7171      }, this);
7172  },
7173  CLASS_NAME: "OpenLayers.Protocol",
7174});
7175OpenLayers.Protocol.Response = OpenLayers.Class({
7176  code: null,
7177  requestType: null,
7178  last: !0,
7179  features: null,
7180  data: null,
7181  reqFeatures: null,
7182  priv: null,
7183  error: null,
7184  initialize: function (a) {
7185      OpenLayers.Util.extend(this, a);
7186  },
7187  success: function () {
7188      return 0 < this.code;
7189  },
7190  CLASS_NAME: "OpenLayers.Protocol.Response",
7191});
7192OpenLayers.Protocol.Response.SUCCESS = 1;
7193OpenLayers.Protocol.Response.FAILURE = 0;
7194OpenLayers.Format.JSON = OpenLayers.Class(OpenLayers.Format, {
7195  indent: "    ",
7196  space: " ",
7197  newline: "\n",
7198  level: 0,
7199  pretty: !1,
7200  nativeJSON: (function () {
7201      return !(!window.JSON || "function" != typeof JSON.parse || "function" != typeof JSON.stringify);
7202  })(),
7203  read: function (a, b) {
7204      var c;
7205      if (this.nativeJSON) c = JSON.parse(a, b);
7206      else
7207          try {
7208              if (
7209                  /^[\],:{}\s]*$/.test(
7210                      a
7211                          .replace(/\\["\\\/bfnrtu]/g, "@")
7212                          .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
7213                          .replace(/(?:^|:|,)(?:\s*\[)+/g, "")
7214                  ) &&
7215                  ((c = eval("(" + a + ")")), "function" === typeof b)
7216              ) {
7217                  var d = function (a, c) {
7218                      if (c && "object" === typeof c) for (var e in c) c.hasOwnProperty(e) && (c[e] = d(e, c[e]));
7219                      return b(a, c);
7220                  };
7221                  c = d("", c);
7222              }
7223          } catch (e) {}
7224      this.keepData && (this.data = c);
7225      return c;
7226  },
7227  write: function (a, b) {
7228      this.pretty = !!b;
7229      var c = null,
7230          d = typeof a;
7231      if (this.serialize[d])
7232          try {
7233              c = !this.pretty && this.nativeJSON ? JSON.stringify(a) : this.serialize[d].apply(this, [a]);
7234          } catch (e) {
7235              OpenLayers.Console.error("Trouble serializing: " + e);
7236          }
7237      return c;
7238  },
7239  writeIndent: function () {
7240      var a = [];
7241      if (this.pretty) for (var b = 0; b < this.level; ++b) a.push(this.indent);
7242      return a.join("");
7243  },
7244  writeNewline: function () {
7245      return this.pretty ? this.newline : "";
7246  },
7247  writeSpace: function () {
7248      return this.pretty ? this.space : "";
7249  },
7250  serialize: {
7251      object: function (a) {
7252          if (null == a) return "null";
7253          if (a.constructor == Date) return this.serialize.date.apply(this, [a]);
7254          if (a.constructor == Array) return this.serialize.array.apply(this, [a]);
7255          var b = ["{"];
7256          this.level += 1;
7257          var c,
7258              d,
7259              e,
7260              f = !1;
7261          for (c in a)
7262              a.hasOwnProperty(c) &&
7263                  ((d = OpenLayers.Format.JSON.prototype.write.apply(this, [c, this.pretty])),
7264                  (e = OpenLayers.Format.JSON.prototype.write.apply(this, [a[c], this.pretty])),
7265                  null != d && null != e && (f && b.push(","), b.push(this.writeNewline(), this.writeIndent(), d, ":", this.writeSpace(), e), (f = !0)));
7266          this.level -= 1;
7267          b.push(this.writeNewline(), this.writeIndent(), "}");
7268          return b.join("");
7269      },
7270      array: function (a) {
7271          var b,
7272              c = ["["];
7273          this.level += 1;
7274          for (var d = 0, e = a.length; d < e; ++d) (b = OpenLayers.Format.JSON.prototype.write.apply(this, [a[d], this.pretty])), null != b && (0 < d && c.push(","), c.push(this.writeNewline(), this.writeIndent(), b));
7275          this.level -= 1;
7276          c.push(this.writeNewline(), this.writeIndent(), "]");
7277          return c.join("");
7278      },
7279      string: function (a) {
7280          var b = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" };
7281          return /["\\\x00-\x1f]/.test(a)
7282              ? '"' +
7283                    a.replace(/([\x00-\x1f\\"])/g, function (a, d) {
7284                        var e = b[d];
7285                        if (e) return e;
7286                        e = d.charCodeAt();
7287                        return "\\u00" + Math.floor(e / 16).toString(16) + (e % 16).toString(16);
7288                    }) +
7289                    '"'
7290              : '"' + a + '"';
7291      },
7292      number: function (a) {
7293          return isFinite(a) ? String(a) : "null";
7294      },
7295      boolean: function (a) {
7296          return String(a);
7297      },
7298      date: function (a) {
7299          function b(a) {
7300              return 10 > a ? "0" + a : a;
7301          }
7302          return '"' + a.getFullYear() + "-" + b(a.getMonth() + 1) + "-" + b(a.getDate()) + "T" + b(a.getHours()) + ":" + b(a.getMinutes()) + ":" + b(a.getSeconds()) + '"';
7303      },
7304  },
7305  CLASS_NAME: "OpenLayers.Format.JSON",
7306});
7307OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
7308  ignoreExtraDims: !1,
7309  read: function (a, b, c) {
7310      b = b ? b : "FeatureCollection";
7311      var d = null,
7312          e = null,
7313          e = "string" == typeof a ? OpenLayers.Format.JSON.prototype.read.apply(this, [a, c]) : a;
7314      if (!e) OpenLayers.Console.error("Bad JSON: " + a);
7315      else if ("string" != typeof e.type) OpenLayers.Console.error("Bad GeoJSON - no type: " + a);
7316      else if (this.isValidType(e, b))
7317          switch (b) {
7318              case "Geometry":
7319                  try {
7320                      d = this.parseGeometry(e);
7321                  } catch (f) {
7322                      OpenLayers.Console.error(f);
7323                  }
7324                  break;
7325              case "Feature":
7326                  try {
7327                      (d = this.parseFeature(e)), (d.type = "Feature");
7328                  } catch (g) {
7329                      OpenLayers.Console.error(g);
7330                  }
7331                  break;
7332              case "FeatureCollection":
7333                  switch (((d = []), e.type)) {
7334                      case "Feature":
7335                          try {
7336                              d.push(this.parseFeature(e));
7337                          } catch (h) {
7338                              (d = null), OpenLayers.Console.error(h);
7339                          }
7340                          break;
7341                      case "FeatureCollection":
7342                          a = 0;
7343                          for (b = e.features.length; a < b; ++a)
7344                              try {
7345                                  d.push(this.parseFeature(e.features[a]));
7346                              } catch (k) {
7347                                  (d = null), OpenLayers.Console.error(k);
7348                              }
7349                          break;
7350                      default:
7351                          try {
7352                              var l = this.parseGeometry(e);
7353                              d.push(new OpenLayers.Feature.Vector(l));
7354                          } catch (m) {
7355                              (d = null), OpenLayers.Console.error(m);
7356                          }
7357                  }
7358          }
7359      return d;
7360  },
7361  isValidType: function (a, b) {
7362      var c = !1;
7363      switch (b) {
7364          case "Geometry":
7365              -1 == OpenLayers.Util.indexOf("Point MultiPoint LineString MultiLineString Polygon MultiPolygon Box GeometryCollection".split(" "), a.type) ? OpenLayers.Console.error("Unsupported geometry type: " + a.type) : (c = !0);
7366              break;
7367          case "FeatureCollection":
7368              c = !0;
7369              break;
7370          default:
7371              a.type == b ? (c = !0) : OpenLayers.Console.error("Cannot convert types from " + a.type + " to " + b);
7372      }
7373      return c;
7374  },
7375  parseFeature: function (a) {
7376      var b, c, d;
7377      c = a.properties ? a.properties : {};
7378      d = (a.geometry && a.geometry.bbox) || a.bbox;
7379      try {
7380          b = this.parseGeometry(a.geometry);
7381      } catch (e) {
7382          throw e;
7383      }
7384      b = new OpenLayers.Feature.Vector(b, c);
7385      d && (b.bounds = OpenLayers.Bounds.fromArray(d));
7386      a.id && (b.fid = a.id);
7387      return b;
7388  },
7389  parseGeometry: function (a) {
7390      if (null == a) return null;
7391      var b,
7392          c = !1;
7393      if ("GeometryCollection" == a.type) {
7394          if (!OpenLayers.Util.isArray(a.geometries)) throw "GeometryCollection must have geometries array: " + a;
7395          b = a.geometries.length;
7396          for (var c = Array(b), d = 0; d < b; ++d) c[d] = this.parseGeometry.apply(this, [a.geometries[d]]);
7397          b = new OpenLayers.Geometry.Collection(c);
7398          c = !0;
7399      } else {
7400          if (!OpenLayers.Util.isArray(a.coordinates)) throw "Geometry must have coordinates array: " + a;
7401          if (!this.parseCoords[a.type.toLowerCase()]) throw "Unsupported geometry type: " + a.type;
7402          try {
7403              b = this.parseCoords[a.type.toLowerCase()].apply(this, [a.coordinates]);
7404          } catch (e) {
7405              throw e;
7406          }
7407      }
7408      this.internalProjection && this.externalProjection && !c && b.transform(this.externalProjection, this.internalProjection);
7409      return b;
7410  },
7411  parseCoords: {
7412      point: function (a) {
7413          if (!1 == this.ignoreExtraDims && 2 != a.length) throw "Only 2D points are supported: " + a;
7414          return new OpenLayers.Geometry.Point(a[0], a[1]);
7415      },
7416      multipoint: function (a) {
7417          for (var b = [], c = null, d = 0, e = a.length; d < e; ++d) {
7418              try {
7419                  c = this.parseCoords.point.apply(this, [a[d]]);
7420              } catch (f) {
7421                  throw f;
7422              }
7423              b.push(c);
7424          }
7425          return new OpenLayers.Geometry.MultiPoint(b);
7426      },
7427      linestring: function (a) {
7428          for (var b = [], c = null, d = 0, e = a.length; d < e; ++d) {
7429              try {
7430                  c = this.parseCoords.point.apply(this, [a[d]]);
7431              } catch (f) {
7432                  throw f;
7433              }
7434              b.push(c);
7435          }
7436          return new OpenLayers.Geometry.LineString(b);
7437      },
7438      multilinestring: function (a) {
7439          for (var b = [], c = null, d = 0, e = a.length; d < e; ++d) {
7440              try {
7441                  c = this.parseCoords.linestring.apply(this, [a[d]]);
7442              } catch (f) {
7443                  throw f;
7444              }
7445              b.push(c);
7446          }
7447          return new OpenLayers.Geometry.MultiLineString(b);
7448      },
7449      polygon: function (a) {
7450          for (var b = [], c, d, e = 0, f = a.length; e < f; ++e) {
7451              try {
7452                  d = this.parseCoords.linestring.apply(this, [a[e]]);
7453              } catch (g) {
7454                  throw g;
7455              }
7456              c = new OpenLayers.Geometry.LinearRing(d.components);
7457              b.push(c);
7458          }
7459          return new OpenLayers.Geometry.Polygon(b);
7460      },
7461      multipolygon: function (a) {
7462          for (var b = [], c = null, d = 0, e = a.length; d < e; ++d) {
7463              try {
7464                  c = this.parseCoords.polygon.apply(this, [a[d]]);
7465              } catch (f) {
7466                  throw f;
7467              }
7468              b.push(c);
7469          }
7470          return new OpenLayers.Geometry.MultiPolygon(b);
7471      },
7472      box: function (a) {
7473          if (2 != a.length) throw "GeoJSON box coordinates must have 2 elements";
7474          return new OpenLayers.Geometry.Polygon([
7475              new OpenLayers.Geometry.LinearRing([
7476                  new OpenLayers.Geometry.Point(a[0][0], a[0][1]),
7477                  new OpenLayers.Geometry.Point(a[1][0], a[0][1]),
7478                  new OpenLayers.Geometry.Point(a[1][0], a[1][1]),
7479                  new OpenLayers.Geometry.Point(a[0][0], a[1][1]),
7480                  new OpenLayers.Geometry.Point(a[0][0], a[0][1]),
7481              ]),
7482          ]);
7483      },
7484  },
7485  write: function (a, b) {
7486      var c = { type: null };
7487      if (OpenLayers.Util.isArray(a)) {
7488          c.type = "FeatureCollection";
7489          var d = a.length;
7490          c.features = Array(d);
7491          for (var e = 0; e < d; ++e) {
7492              var f = a[e];
7493              if (!f instanceof OpenLayers.Feature.Vector) throw "FeatureCollection only supports collections of features: " + f;
7494              c.features[e] = this.extract.feature.apply(this, [f]);
7495          }
7496      } else
7497          0 == a.CLASS_NAME.indexOf("OpenLayers.Geometry")
7498              ? (c = this.extract.geometry.apply(this, [a]))
7499              : a instanceof OpenLayers.Feature.Vector && ((c = this.extract.feature.apply(this, [a])), a.layer && a.layer.projection && (c.crs = this.createCRSObject(a)));
7500      return OpenLayers.Format.JSON.prototype.write.apply(this, [c, b]);
7501  },
7502  createCRSObject: function (a) {
7503      a = a.layer.projection.toString();
7504      var b = {};
7505      a.match(/epsg:/i) && ((a = parseInt(a.substring(a.indexOf(":") + 1))), (b = 4326 == a ? { type: "name", properties: { name: "urn:ogc:def:crs:OGC:1.3:CRS84" } } : { type: "name", properties: { name: "EPSG:" + a } }));
7506      return b;
7507  },
7508  extract: {
7509      feature: function (a) {
7510          var b = this.extract.geometry.apply(this, [a.geometry]),
7511              b = { type: "Feature", properties: a.attributes, geometry: b };
7512          null != a.fid && (b.id = a.fid);
7513          return b;
7514      },
7515      geometry: function (a) {
7516          if (null == a) return null;
7517          this.internalProjection && this.externalProjection && ((a = a.clone()), a.transform(this.internalProjection, this.externalProjection));
7518          var b = a.CLASS_NAME.split(".")[2];
7519          a = this.extract[b.toLowerCase()].apply(this, [a]);
7520          return "Collection" == b ? { type: "GeometryCollection", geometries: a } : { type: b, coordinates: a };
7521      },
7522      point: function (a) {
7523          return [a.x, a.y];
7524      },
7525      multipoint: function (a) {
7526          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push(this.extract.point.apply(this, [a.components[c]]));
7527          return b;
7528      },
7529      linestring: function (a) {
7530          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push(this.extract.point.apply(this, [a.components[c]]));
7531          return b;
7532      },
7533      multilinestring: function (a) {
7534          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push(this.extract.linestring.apply(this, [a.components[c]]));
7535          return b;
7536      },
7537      polygon: function (a) {
7538          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push(this.extract.linestring.apply(this, [a.components[c]]));
7539          return b;
7540      },
7541      multipolygon: function (a) {
7542          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push(this.extract.polygon.apply(this, [a.components[c]]));
7543          return b;
7544      },
7545      collection: function (a) {
7546          for (var b = a.components.length, c = Array(b), d = 0; d < b; ++d) c[d] = this.extract.geometry.apply(this, [a.components[d]]);
7547          return c;
7548      },
7549  },
7550  CLASS_NAME: "OpenLayers.Format.GeoJSON",
7551});
7552OpenLayers.Protocol.Script = OpenLayers.Class(OpenLayers.Protocol, {
7553  url: null,
7554  params: null,
7555  callback: null,
7556  callbackTemplate: "OpenLayers.Protocol.Script.registry.${id}",
7557  callbackKey: "callback",
7558  callbackPrefix: "",
7559  scope: null,
7560  format: null,
7561  pendingRequests: null,
7562  srsInBBOX: !1,
7563  initialize: function (a) {
7564      a = a || {};
7565      this.params = {};
7566      this.pendingRequests = {};
7567      OpenLayers.Protocol.prototype.initialize.apply(this, arguments);
7568      this.format || (this.format = new OpenLayers.Format.GeoJSON());
7569      if (!this.filterToParams && OpenLayers.Format.QueryStringFilter) {
7570          var b = new OpenLayers.Format.QueryStringFilter({ srsInBBOX: this.srsInBBOX });
7571          this.filterToParams = function (a, d) {
7572              return b.write(a, d);
7573          };
7574      }
7575  },
7576  read: function (a) {
7577      OpenLayers.Protocol.prototype.read.apply(this, arguments);
7578      a = OpenLayers.Util.applyDefaults(a, this.options);
7579      a.params = OpenLayers.Util.applyDefaults(a.params, this.options.params);
7580      a.filter && this.filterToParams && (a.params = this.filterToParams(a.filter, a.params));
7581      var b = new OpenLayers.Protocol.Response({ requestType: "read" }),
7582          c = this.createRequest(
7583              a.url,
7584              a.params,
7585              OpenLayers.Function.bind(function (c) {
7586                  b.data = c;
7587                  this.handleRead(b, a);
7588              }, this)
7589          );
7590      b.priv = c;
7591      return b;
7592  },
7593  createRequest: function (a, b, c) {
7594      c = OpenLayers.Protocol.Script.register(c);
7595      var d = OpenLayers.String.format(this.callbackTemplate, { id: c });
7596      b = OpenLayers.Util.extend({}, b);
7597      b[this.callbackKey] = this.callbackPrefix + d;
7598      a = OpenLayers.Util.urlAppend(a, OpenLayers.Util.getParameterString(b));
7599      b = document.createElement("script");
7600      b.type = "text/javascript";
7601      b.src = a;
7602      b.id = "OpenLayers_Protocol_Script_" + c;
7603      this.pendingRequests[b.id] = b;
7604      document.getElementsByTagName("head")[0].appendChild(b);
7605      return b;
7606  },
7607  destroyRequest: function (a) {
7608      OpenLayers.Protocol.Script.unregister(a.id.split("_").pop());
7609      delete this.pendingRequests[a.id];
7610      a.parentNode && a.parentNode.removeChild(a);
7611  },
7612  handleRead: function (a, b) {
7613      this.handleResponse(a, b);
7614  },
7615  handleResponse: function (a, b) {
7616      b.callback && (a.data ? ((a.features = this.parseFeatures(a.data)), (a.code = OpenLayers.Protocol.Response.SUCCESS)) : (a.code = OpenLayers.Protocol.Response.FAILURE), this.destroyRequest(a.priv), b.callback.call(b.scope, a));
7617  },
7618  parseFeatures: function (a) {
7619      return this.format.read(a);
7620  },
7621  abort: function (a) {
7622      if (a) this.destroyRequest(a.priv);
7623      else for (var b in this.pendingRequests) this.destroyRequest(this.pendingRequests[b]);
7624  },
7625  destroy: function () {
7626      this.abort();
7627      delete this.params;
7628      delete this.format;
7629      OpenLayers.Protocol.prototype.destroy.apply(this);
7630  },
7631  CLASS_NAME: "OpenLayers.Protocol.Script",
7632});
7633(function () {
7634  var a = OpenLayers.Protocol.Script,
7635      b = 0;
7636  a.registry = {};
7637  a.register = function (c) {
7638      var d = "c" + ++b;
7639      a.registry[d] = function () {
7640          c.apply(this, arguments);
7641      };
7642      return d;
7643  };
7644  a.unregister = function (b) {
7645      delete a.registry[b];
7646  };
7647})();
7648OpenLayers.Format.EncodedPolyline = OpenLayers.Class(OpenLayers.Format, {
7649  geometryType: "linestring",
7650  initialize: function (a) {
7651      OpenLayers.Format.prototype.initialize.apply(this, [a]);
7652  },
7653  read: function (a) {
7654      var b;
7655      if ("linestring" == this.geometryType) b = OpenLayers.Geometry.LineString;
7656      else if ("linearring" == this.geometryType) b = OpenLayers.Geometry.LinearRing;
7657      else if ("multipoint" == this.geometryType) b = OpenLayers.Geometry.MultiPoint;
7658      else if ("point" != this.geometryType && "polygon" != this.geometryType) return null;
7659      a = this.decodeDeltas(a, 2);
7660      for (var c = a.length, d = [], e = 0; e + 1 < c; ) {
7661          var f = a[e++],
7662              g = a[e++];
7663          d.push(new OpenLayers.Geometry.Point(g, f));
7664      }
7665      return "point" == this.geometryType
7666          ? new OpenLayers.Feature.Vector(d[0])
7667          : "polygon" == this.geometryType
7668          ? new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(d)]))
7669          : new OpenLayers.Feature.Vector(new b(d));
7670  },
7671  decode: function (a, b, c) {
7672      a = this.decodeDeltas(a, b, c || 1e5);
7673      c = a.length;
7674      for (var d = [], e = 0; e + (b - 1) < c; ) {
7675          for (var f = [], g = 0; g < b; ++g) f.push(a[e++]);
7676          d.push(f);
7677      }
7678      return d;
7679  },
7680  write: function (a) {
7681      a = (a.constructor == Array ? a[0] : a).geometry;
7682      var b = a.CLASS_NAME.split(".")[2].toLowerCase();
7683      if ("point" == b) a = Array(a);
7684      else if ("linestring" == b || "linearring" == b || "multipoint" == b) a = a.components;
7685      else if ("polygon" == b) a = a.components[0].components;
7686      else return null;
7687      for (var b = [], c = a.length, d = 0; d < c; ++d) {
7688          var e = a[d];
7689          b.push(e.y);
7690          b.push(e.x);
7691      }
7692      return this.encodeDeltas(b, 2);
7693  },
7694  encode: function (a, b, c) {
7695      c = c || 1e5;
7696      for (var d = [], e = a.length, f = 0; f < e; ++f) for (var g = a[f], h = 0; h < b; ++h) d.push(g[h]);
7697      return this.encodeDeltas(d, b, c);
7698  },
7699  encodeDeltas: function (a, b, c) {
7700      var d,
7701          e = Array(b);
7702      for (d = 0; d < b; ++d) e[d] = 0;
7703      for (var f = a.length, g = 0; g < f; )
7704          for (d = 0; d < b; ++d, ++g) {
7705              var h = a[g],
7706                  k = h - e[d];
7707              e[d] = h;
7708              a[g] = k;
7709          }
7710      return this.encodeFloats(a, c || 1e5);
7711  },
7712  decodeDeltas: function (a, b, c) {
7713      var d,
7714          e = Array(b);
7715      for (d = 0; d < b; ++d) e[d] = 0;
7716      a = this.decodeFloats(a, c || 1e5);
7717      c = a.length;
7718      for (var f = 0; f < c; ) for (d = 0; d < b; ++d, ++f) (e[d] += a[f]), (a[f] = e[d]);
7719      return a;
7720  },
7721  encodeFloats: function (a, b) {
7722      for (var c = b || 1e5, d = a.length, e = 0; e < d; ++e) a[e] = Math.round(a[e] * c);
7723      return this.encodeSignedIntegers(a);
7724  },
7725  decodeFloats: function (a, b) {
7726      for (var c = b || 1e5, d = this.decodeSignedIntegers(a), e = d.length, f = 0; f < e; ++f) d[f] /= c;
7727      return d;
7728  },
7729  encodeSignedIntegers: function (a) {
7730      for (var b = a.length, c = 0; c < b; ++c) {
7731          var d = a[c],
7732              e = d << 1;
7733          0 > d && (e = ~e);
7734          a[c] = e;
7735      }
7736      return this.encodeUnsignedIntegers(a);
7737  },
7738  decodeSignedIntegers: function (a) {
7739      a = this.decodeUnsignedIntegers(a);
7740      for (var b = a.length, c = 0; c < b; ++c) {
7741          var d = a[c];
7742          a[c] = d & 1 ? ~(d >> 1) : d >> 1;
7743      }
7744      return a;
7745  },
7746  encodeUnsignedIntegers: function (a) {
7747      for (var b = "", c = a.length, d = 0; d < c; ++d) b += this.encodeUnsignedInteger(a[d]);
7748      return b;
7749  },
7750  decodeUnsignedIntegers: function (a) {
7751      for (var b = [], c = 0, d = 0, e = a.length, f = 0; f < e; ++f) {
7752          var g = a.charCodeAt(f) - 63,
7753              c = c | ((g & 31) << d);
7754          32 > g ? (b.push(c), (d = c = 0)) : (d += 5);
7755      }
7756      return b;
7757  },
7758  encodeFloat: function (a, b) {
7759      a = Math.round(a * (b || 1e5));
7760      return this.encodeSignedInteger(a);
7761  },
7762  decodeFloat: function (a, b) {
7763      return this.decodeSignedInteger(a) / (b || 1e5);
7764  },
7765  encodeSignedInteger: function (a) {
7766      var b = a << 1;
7767      0 > a && (b = ~b);
7768      return this.encodeUnsignedInteger(b);
7769  },
7770  decodeSignedInteger: function (a) {
7771      a = this.decodeUnsignedInteger(a);
7772      return a & 1 ? ~(a >> 1) : a >> 1;
7773  },
7774  encodeUnsignedInteger: function (a) {
7775      for (var b, c = ""; 32 <= a; ) (b = (32 | (a & 31)) + 63), (c += String.fromCharCode(b)), (a >>= 5);
7776      return (c += String.fromCharCode(a + 63));
7777  },
7778  decodeUnsignedInteger: function (a) {
7779      for (var b = 0, c = 0, d = a.length, e = 0; e < d; ++e) {
7780          var f = a.charCodeAt(e) - 63,
7781              b = b | ((f & 31) << c);
7782          if (32 > f) break;
7783          c += 5;
7784      }
7785      return b;
7786  },
7787  CLASS_NAME: "OpenLayers.Format.EncodedPolyline",
7788});
7789OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
7790  controls: null,
7791  autoActivate: !0,
7792  defaultControl: null,
7793  saveState: !1,
7794  allowDepress: !1,
7795  activeState: null,
7796  initialize: function (a) {
7797      OpenLayers.Control.prototype.initialize.apply(this, [a]);
7798      this.controls = [];
7799      this.activeState = {};
7800  },
7801  destroy: function () {
7802      this.map && this.map.events.unregister("buttonclick", this, this.onButtonClick);
7803      OpenLayers.Control.prototype.destroy.apply(this, arguments);
7804      for (var a, b = this.controls.length - 1; 0 <= b; b--) (a = this.controls[b]), a.events && a.events.un({ activate: this.iconOn, deactivate: this.iconOff }), (a.panel_div = null);
7805      this.activeState = null;
7806  },
7807  activate: function () {
7808      if (OpenLayers.Control.prototype.activate.apply(this, arguments)) {
7809          for (var a, b = 0, c = this.controls.length; b < c; b++) (a = this.controls[b]), (a === this.defaultControl || (this.saveState && this.activeState[a.id])) && a.activate();
7810          !0 === this.saveState && (this.defaultControl = null);
7811          this.redraw();
7812          return !0;
7813      }
7814      return !1;
7815  },
7816  deactivate: function () {
7817      if (OpenLayers.Control.prototype.deactivate.apply(this, arguments)) {
7818          for (var a, b = 0, c = this.controls.length; b < c; b++) (a = this.controls[b]), (this.activeState[a.id] = a.deactivate());
7819          this.redraw();
7820          return !0;
7821      }
7822      return !1;
7823  },
7824  draw: function () {
7825      OpenLayers.Control.prototype.draw.apply(this, arguments);
7826      this.outsideViewport ? (this.events.attachToElement(this.div), this.events.register("buttonclick", this, this.onButtonClick)) : this.map.events.register("buttonclick", this, this.onButtonClick);
7827      this.addControlsToMap(this.controls);
7828      return this.div;
7829  },
7830  redraw: function () {
7831      for (var a = this.div.childNodes.length - 1; 0 <= a; a--) this.div.removeChild(this.div.childNodes[a]);
7832      this.div.innerHTML = "";
7833      if (this.active) for (var a = 0, b = this.controls.length; a < b; a++) this.div.appendChild(this.controls[a].panel_div);
7834  },
7835  activateControl: function (a) {
7836      if (!this.active) return !1;
7837      if (a.type == OpenLayers.Control.TYPE_BUTTON) a.trigger();
7838      else if (a.type == OpenLayers.Control.TYPE_TOGGLE) a.active ? a.deactivate() : a.activate();
7839      else if (this.allowDepress && a.active) a.deactivate();
7840      else {
7841          for (var b, c = 0, d = this.controls.length; c < d; c++) (b = this.controls[c]), b == a || (b.type !== OpenLayers.Control.TYPE_TOOL && null != b.type) || b.deactivate();
7842          a.activate();
7843      }
7844  },
7845  addControls: function (a) {
7846      OpenLayers.Util.isArray(a) || (a = [a]);
7847      this.controls = this.controls.concat(a);
7848      for (var b = 0, c = a.length; b < c; b++) {
7849          var d = a[b],
7850              e = this.createControlMarkup(d);
7851          OpenLayers.Element.addClass(e, d.displayClass + "ItemInactive");
7852          OpenLayers.Element.addClass(e, "olButton");
7853          "" == d.title || e.title || (e.title = d.title);
7854          d.panel_div = e;
7855      }
7856      this.map && (this.addControlsToMap(a), this.redraw());
7857  },
7858  createControlMarkup: function (a) {
7859      return document.createElement("div");
7860  },
7861  addControlsToMap: function (a) {
7862      for (var b, c = 0, d = a.length; c < d; c++)
7863          (b = a[c]), !0 === b.autoActivate ? ((b.autoActivate = !1), this.map.addControl(b), (b.autoActivate = !0)) : (this.map.addControl(b), b.deactivate()), b.events.on({ activate: this.iconOn, deactivate: this.iconOff });
7864  },
7865  iconOn: function () {
7866      var a = this.panel_div;
7867      a.className = a.className.replace(RegExp("\\b(" + this.displayClass + "Item)Inactive\\b"), "$1Active");
7868  },
7869  iconOff: function () {
7870      var a = this.panel_div;
7871      a.className = a.className.replace(RegExp("\\b(" + this.displayClass + "Item)Active\\b"), "$1Inactive");
7872  },
7873  onButtonClick: function (a) {
7874      var b = this.controls;
7875      a = a.buttonElement;
7876      for (var c = b.length - 1; 0 <= c; --c)
7877          if (b[c].panel_div === a) {
7878              this.activateControl(b[c]);
7879              break;
7880          }
7881  },
7882  getControlsBy: function (a, b) {
7883      var c = "function" == typeof b.test;
7884      return OpenLayers.Array.filter(this.controls, function (d) {
7885          return d[a] == b || (c && b.test(d[a]));
7886      });
7887  },
7888  getControlsByName: function (a) {
7889      return this.getControlsBy("name", a);
7890  },
7891  getControlsByClass: function (a) {
7892      return this.getControlsBy("CLASS_NAME", a);
7893  },
7894  CLASS_NAME: "OpenLayers.Control.Panel",
7895});
7896OpenLayers.Control.Button = OpenLayers.Class(OpenLayers.Control, { type: OpenLayers.Control.TYPE_BUTTON, trigger: function () {}, CLASS_NAME: "OpenLayers.Control.Button" });
7897OpenLayers.Control.ZoomIn = OpenLayers.Class(OpenLayers.Control.Button, {
7898  trigger: function () {
7899      this.map && this.map.zoomIn();
7900  },
7901  CLASS_NAME: "OpenLayers.Control.ZoomIn",
7902});
7903OpenLayers.Control.ZoomOut = OpenLayers.Class(OpenLayers.Control.Button, {
7904  trigger: function () {
7905      this.map && this.map.zoomOut();
7906  },
7907  CLASS_NAME: "OpenLayers.Control.ZoomOut",
7908});
7909OpenLayers.Control.ZoomToMaxExtent = OpenLayers.Class(OpenLayers.Control.Button, {
7910  trigger: function () {
7911      this.map && this.map.zoomToMaxExtent();
7912  },
7913  CLASS_NAME: "OpenLayers.Control.ZoomToMaxExtent",
7914});
7915OpenLayers.Control.ZoomPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
7916  initialize: function (a) {
7917      OpenLayers.Control.Panel.prototype.initialize.apply(this, [a]);
7918      this.addControls([new OpenLayers.Control.ZoomIn(), new OpenLayers.Control.ZoomToMaxExtent(), new OpenLayers.Control.ZoomOut()]);
7919  },
7920  CLASS_NAME: "OpenLayers.Control.ZoomPanel",
7921});
7922OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
7923  URL_HASH_FACTOR: (Math.sqrt(5) - 1) / 2,
7924  url: null,
7925  params: null,
7926  reproject: !1,
7927  initialize: function (a, b, c, d) {
7928      OpenLayers.Layer.prototype.initialize.apply(this, [a, d]);
7929      this.url = b;
7930      this.params || (this.params = OpenLayers.Util.extend({}, c));
7931  },
7932  destroy: function () {
7933      this.params = this.url = null;
7934      OpenLayers.Layer.prototype.destroy.apply(this, arguments);
7935  },
7936  clone: function (a) {
7937      null == a && (a = new OpenLayers.Layer.HTTPRequest(this.name, this.url, this.params, this.getOptions()));
7938      return (a = OpenLayers.Layer.prototype.clone.apply(this, [a]));
7939  },
7940  setUrl: function (a) {
7941      this.url = a;
7942  },
7943  mergeNewParams: function (a) {
7944      this.params = OpenLayers.Util.extend(this.params, a);
7945      a = this.redraw();
7946      null != this.map && this.map.events.triggerEvent("changelayer", { layer: this, property: "params" });
7947      return a;
7948  },
7949  redraw: function (a) {
7950      return a ? this.mergeNewParams({ _olSalt: Math.random() }) : OpenLayers.Layer.prototype.redraw.apply(this, []);
7951  },
7952  selectUrl: function (a, b) {
7953      for (var c = 1, d = 0, e = a.length; d < e; d++) (c *= a.charCodeAt(d) * this.URL_HASH_FACTOR), (c -= Math.floor(c));
7954      return b[Math.floor(c * b.length)];
7955  },
7956  getFullRequestString: function (a, b) {
7957      var c = b || this.url,
7958          d = OpenLayers.Util.extend({}, this.params),
7959          d = OpenLayers.Util.extend(d, a),
7960          e = OpenLayers.Util.getParameterString(d);
7961      OpenLayers.Util.isArray(c) && (c = this.selectUrl(e, c));
7962      var e = OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c)),
7963          f;
7964      for (f in d) f.toUpperCase() in e && delete d[f];
7965      e = OpenLayers.Util.getParameterString(d);
7966      return OpenLayers.Util.urlAppend(c, e);
7967  },
7968  CLASS_NAME: "OpenLayers.Layer.HTTPRequest",
7969});
7970OpenLayers.Tile = OpenLayers.Class({
7971  events: null,
7972  eventListeners: null,
7973  id: null,
7974  layer: null,
7975  url: null,
7976  bounds: null,
7977  size: null,
7978  position: null,
7979  isLoading: !1,
7980  initialize: function (a, b, c, d, e, f) {
7981      this.layer = a;
7982      this.position = b.clone();
7983      this.setBounds(c);
7984      this.url = d;
7985      e && (this.size = e.clone());
7986      this.id = OpenLayers.Util.createUniqueID("Tile_");
7987      OpenLayers.Util.extend(this, f);
7988      this.events = new OpenLayers.Events(this);
7989      if (this.eventListeners instanceof Object) this.events.on(this.eventListeners);
7990  },
7991  unload: function () {
7992      this.isLoading && ((this.isLoading = !1), this.events.triggerEvent("unload"));
7993  },
7994  destroy: function () {
7995      this.position = this.size = this.bounds = this.layer = null;
7996      this.eventListeners && this.events.un(this.eventListeners);
7997      this.events.destroy();
7998      this.events = this.eventListeners = null;
7999  },
8000  draw: function (a) {
8001      a || this.clear();
8002      var b = this.shouldDraw();
8003      b && !a && !1 === this.events.triggerEvent("beforedraw") && (b = null);
8004      return b;
8005  },
8006  shouldDraw: function () {
8007      var a = !1,
8008          b = this.layer.maxExtent;
8009      if (b) {
8010          var c = this.layer.map,
8011              c = c.baseLayer.wrapDateLine && c.getMaxExtent();
8012          this.bounds.intersectsBounds(b, { inclusive: !1, worldBounds: c }) && (a = !0);
8013      }
8014      return a || this.layer.displayOutsideMaxExtent;
8015  },
8016  setBounds: function (a) {
8017      a = a.clone();
8018      if (this.layer.map.baseLayer.wrapDateLine) {
8019          var b = this.layer.map.getMaxExtent(),
8020              c = this.layer.map.getResolution();
8021          a = a.wrapDateLine(b, { leftTolerance: c, rightTolerance: c });
8022      }
8023      this.bounds = a;
8024  },
8025  moveTo: function (a, b, c) {
8026      null == c && (c = !0);
8027      this.setBounds(a);
8028      this.position = b.clone();
8029      c && this.draw();
8030  },
8031  clear: function (a) {},
8032  CLASS_NAME: "OpenLayers.Tile",
8033});
8034OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
8035  url: null,
8036  imgDiv: null,
8037  frame: null,
8038  imageReloadAttempts: null,
8039  layerAlphaHack: null,
8040  asyncRequestId: null,
8041  maxGetUrlLength: null,
8042  canvasContext: null,
8043  crossOriginKeyword: null,
8044  initialize: function (a, b, c, d, e, f) {
8045      OpenLayers.Tile.prototype.initialize.apply(this, arguments);
8046      this.url = d;
8047      this.layerAlphaHack = this.layer.alpha && OpenLayers.Util.alphaHack();
8048      if (null != this.maxGetUrlLength || this.layer.gutter || this.layerAlphaHack) (this.frame = document.createElement("div")), (this.frame.style.position = "absolute"), (this.frame.style.overflow = "hidden");
8049      null != this.maxGetUrlLength && OpenLayers.Util.extend(this, OpenLayers.Tile.Image.IFrame);
8050  },
8051  destroy: function () {
8052      this.imgDiv && (this.clear(), (this.frame = this.imgDiv = null));
8053      this.asyncRequestId = null;
8054      OpenLayers.Tile.prototype.destroy.apply(this, arguments);
8055  },
8056  draw: function () {
8057      var a = OpenLayers.Tile.prototype.draw.apply(this, arguments);
8058      a
8059          ? (this.layer != this.layer.map.baseLayer && this.layer.reproject && (this.bounds = this.getBoundsFromBaseLayer(this.position)),
8060            this.isLoading ? (this._loadEvent = "reload") : ((this.isLoading = !0), (this._loadEvent = "loadstart")),
8061            this.renderTile(),
8062            this.positionTile())
8063          : !1 === a && this.unload();
8064      return a;
8065  },
8066  renderTile: function () {
8067      if (this.layer.async) {
8068          var a = (this.asyncRequestId = (this.asyncRequestId || 0) + 1);
8069          this.layer.getURLasync(
8070              this.bounds,
8071              function (b) {
8072                  a == this.asyncRequestId && ((this.url = b), this.initImage());
8073              },
8074              this
8075          );
8076      } else (this.url = this.layer.getURL(this.bounds)), this.initImage();
8077  },
8078  positionTile: function () {
8079      var a = this.getTile().style,
8080          b = this.frame ? this.size : this.layer.getImageSize(this.bounds),
8081          c = 1;
8082      this.layer instanceof OpenLayers.Layer.Grid && (c = this.layer.getServerResolution() / this.layer.map.getResolution());
8083      a.left = this.position.x + "px";
8084      a.top = this.position.y + "px";
8085      a.width = Math.round(c * b.w) + "px";
8086      a.height = Math.round(c * b.h) + "px";
8087  },
8088  clear: function () {
8089      OpenLayers.Tile.prototype.clear.apply(this, arguments);
8090      var a = this.imgDiv;
8091      if (a) {
8092          var b = this.getTile();
8093          b.parentNode === this.layer.div && this.layer.div.removeChild(b);
8094          this.setImgSrc();
8095          !0 === this.layerAlphaHack && (a.style.filter = "");
8096          OpenLayers.Element.removeClass(a, "olImageLoadError");
8097      }
8098      this.canvasContext = null;
8099  },
8100  getImage: function () {
8101      if (!this.imgDiv) {
8102          this.imgDiv = OpenLayers.Tile.Image.IMAGE.cloneNode(!1);
8103          var a = this.imgDiv.style;
8104          if (this.frame) {
8105              var b = 0,
8106                  c = 0;
8107              this.layer.gutter && ((b = 100 * (this.layer.gutter / this.layer.tileSize.w)), (c = 100 * (this.layer.gutter / this.layer.tileSize.h)));
8108              a.left = -b + "%";
8109              a.top = -c + "%";
8110              a.width = 2 * b + 100 + "%";
8111              a.height = 2 * c + 100 + "%";
8112          }
8113          a.visibility = "hidden";
8114          a.opacity = 0;
8115          1 > this.layer.opacity && (a.filter = "alpha(opacity=" + 100 * this.layer.opacity + ")");
8116          a.position = "absolute";
8117          this.layerAlphaHack && ((a.paddingTop = a.height), (a.height = "0"), (a.width = "100%"));
8118          this.frame && this.frame.appendChild(this.imgDiv);
8119      }
8120      return this.imgDiv;
8121  },
8122  setImage: function (a) {
8123      this.imgDiv = a;
8124  },
8125  initImage: function () {
8126      if (this.url || this.imgDiv) {
8127          this.events.triggerEvent("beforeload");
8128          this.layer.div.appendChild(this.getTile());
8129          this.events.triggerEvent(this._loadEvent);
8130          var a = this.getImage(),
8131              b = a.getAttribute("src") || "";
8132          this.url && OpenLayers.Util.isEquivalentUrl(b, this.url)
8133              ? (this._loadTimeout = window.setTimeout(OpenLayers.Function.bind(this.onImageLoad, this), 0))
8134              : (this.stopLoading(),
8135                this.crossOriginKeyword && a.removeAttribute("crossorigin"),
8136                OpenLayers.Event.observe(a, "load", OpenLayers.Function.bind(this.onImageLoad, this)),
8137                OpenLayers.Event.observe(a, "error", OpenLayers.Function.bind(this.onImageError, this)),
8138                (this.imageReloadAttempts = 0),
8139                this.setImgSrc(this.url));
8140      } else this.isLoading = !1;
8141  },
8142  setImgSrc: function (a) {
8143      var b = this.imgDiv;
8144      a
8145          ? ((b.style.visibility = "hidden"), (b.style.opacity = 0), this.crossOriginKeyword && ("data:" !== a.substr(0, 5) ? b.setAttribute("crossorigin", this.crossOriginKeyword) : b.removeAttribute("crossorigin")), (b.src = a))
8146          : (this.stopLoading(), (this.imgDiv = null), b.parentNode && b.parentNode.removeChild(b));
8147  },
8148  getTile: function () {
8149      return this.frame ? this.frame : this.getImage();
8150  },
8151  createBackBuffer: function () {
8152      if (this.imgDiv && !this.isLoading) {
8153          var a;
8154          this.frame ? ((a = this.frame.cloneNode(!1)), a.appendChild(this.imgDiv)) : (a = this.imgDiv);
8155          this.imgDiv = null;
8156          return a;
8157      }
8158  },
8159  onImageLoad: function () {
8160      var a = this.imgDiv;
8161      this.stopLoading();
8162      a.style.visibility = "inherit";
8163      a.style.opacity = this.layer.opacity;
8164      this.isLoading = !1;
8165      this.canvasContext = null;
8166      this.events.triggerEvent("loadend");
8167      !0 === this.layerAlphaHack && (a.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + a.src + "', sizingMethod='scale')");
8168  },
8169  onImageError: function () {
8170      var a = this.imgDiv;
8171      null != a.src &&
8172          (this.imageReloadAttempts++,
8173          this.imageReloadAttempts <= OpenLayers.IMAGE_RELOAD_ATTEMPTS ? this.setImgSrc(this.layer.getURL(this.bounds)) : (OpenLayers.Element.addClass(a, "olImageLoadError"), this.events.triggerEvent("loaderror"), this.onImageLoad()));
8174  },
8175  stopLoading: function () {
8176      OpenLayers.Event.stopObservingElement(this.imgDiv);
8177      window.clearTimeout(this._loadTimeout);
8178      delete this._loadTimeout;
8179  },
8180  getCanvasContext: function () {
8181      if (OpenLayers.CANVAS_SUPPORTED && this.imgDiv && !this.isLoading) {
8182          if (!this.canvasContext) {
8183              var a = document.createElement("canvas");
8184              a.width = this.size.w;
8185              a.height = this.size.h;
8186              this.canvasContext = a.getContext("2d");
8187              this.canvasContext.drawImage(this.imgDiv, 0, 0);
8188          }
8189          return this.canvasContext;
8190      }
8191  },
8192  CLASS_NAME: "OpenLayers.Tile.Image",
8193});
8194OpenLayers.Tile.Image.IMAGE = (function () {
8195  var a = new Image();
8196  a.className = "olTileImage";
8197  a.galleryImg = "no";
8198  return a;
8199})();
8200OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
8201  tileSize: null,
8202  tileOriginCorner: "bl",
8203  tileOrigin: null,
8204  tileOptions: null,
8205  tileClass: OpenLayers.Tile.Image,
8206  grid: null,
8207  singleTile: !1,
8208  ratio: 1.5,
8209  buffer: 0,
8210  transitionEffect: "resize",
8211  numLoadingTiles: 0,
8212  serverResolutions: null,
8213  loading: !1,
8214  backBuffer: null,
8215  gridResolution: null,
8216  backBufferResolution: null,
8217  backBufferLonLat: null,
8218  backBufferTimerId: null,
8219  removeBackBufferDelay: null,
8220  className: null,
8221  gridLayout: null,
8222  rowSign: null,
8223  transitionendEvents: ["transitionend", "webkitTransitionEnd", "otransitionend", "oTransitionEnd"],
8224  initialize: function (a, b, c, d) {
8225      OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this, arguments);
8226      this.grid = [];
8227      this._removeBackBuffer = OpenLayers.Function.bind(this.removeBackBuffer, this);
8228      this.initProperties();
8229      this.rowSign = "t" === this.tileOriginCorner.substr(0, 1) ? 1 : -1;
8230  },
8231  initProperties: function () {
8232      void 0 === this.options.removeBackBufferDelay && (this.removeBackBufferDelay = this.singleTile ? 0 : 2500);
8233      void 0 === this.options.className && (this.className = this.singleTile ? "olLayerGridSingleTile" : "olLayerGrid");
8234  },
8235  setMap: function (a) {
8236      OpenLayers.Layer.HTTPRequest.prototype.setMap.call(this, a);
8237      OpenLayers.Element.addClass(this.div, this.className);
8238  },
8239  removeMap: function (a) {
8240      this.removeBackBuffer();
8241  },
8242  destroy: function () {
8243      this.removeBackBuffer();
8244      this.clearGrid();
8245      this.tileSize = this.grid = null;
8246      OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this, arguments);
8247  },
8248  clearGrid: function () {
8249      if (this.grid) {
8250          for (var a = 0, b = this.grid.length; a < b; a++) for (var c = this.grid[a], d = 0, e = c.length; d < e; d++) this.destroyTile(c[d]);
8251          this.grid = [];
8252          this.gridLayout = this.gridResolution = null;
8253      }
8254  },
8255  addOptions: function (a, b) {
8256      var c = void 0 !== a.singleTile && a.singleTile !== this.singleTile;
8257      OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this, arguments);
8258      this.map && c && (this.initProperties(), this.clearGrid(), (this.tileSize = this.options.tileSize), this.setTileSize(), this.moveTo(null, !0));
8259  },
8260  clone: function (a) {
8261      null == a && (a = new OpenLayers.Layer.Grid(this.name, this.url, this.params, this.getOptions()));
8262      a = OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this, [a]);
8263      null != this.tileSize && (a.tileSize = this.tileSize.clone());
8264      a.grid = [];
8265      a.gridResolution = null;
8266      a.backBuffer = null;
8267      a.backBufferTimerId = null;
8268      a.loading = !1;
8269      a.numLoadingTiles = 0;
8270      return a;
8271  },
8272  moveTo: function (a, b, c) {
8273      OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this, arguments);
8274      a = a || this.map.getExtent();
8275      if (null != a) {
8276          var d = !this.grid.length || b,
8277              e = this.getTilesBounds(),
8278              f = this.map.getResolution();
8279          this.getServerResolution(f);
8280          if (this.singleTile) {
8281              if (d || (!c && !e.containsBounds(a))) b && "resize" !== this.transitionEffect && this.removeBackBuffer(), (b && "resize" !== this.transitionEffect) || this.applyBackBuffer(f), this.initSingleTile(a);
8282          } else
8283              (d = d || !e.intersectsBounds(a, { worldBounds: this.map.baseLayer.wrapDateLine && this.map.getMaxExtent() }))
8284                  ? (!b || ("resize" !== this.transitionEffect && this.gridResolution !== f) || this.applyBackBuffer(f), this.initGriddedTiles(a))
8285                  : this.moveGriddedTiles();
8286      }
8287  },
8288  getTileData: function (a) {
8289      var b = null,
8290          c = a.lon,
8291          d = a.lat,
8292          e = this.grid.length;
8293      if (this.map && e) {
8294          var f = this.map.getResolution();
8295          a = this.tileSize.w;
8296          var g = this.tileSize.h,
8297              h = this.grid[0][0].bounds,
8298              k = h.left,
8299              h = h.top;
8300          if (c < k && this.map.baseLayer.wrapDateLine)
8301              var l = this.map.getMaxExtent().getWidth(),
8302                  m = Math.ceil((k - c) / l),
8303                  c = c + l * m;
8304          c = (c - k) / (f * a);
8305          d = (h - d) / (f * g);
8306          f = Math.floor(c);
8307          k = Math.floor(d);
8308          0 <= k && k < e && (e = this.grid[k][f]) && (b = { tile: e, i: Math.floor((c - f) * a), j: Math.floor((d - k) * g) });
8309      }
8310      return b;
8311  },
8312  destroyTile: function (a) {
8313      this.removeTileMonitoringHooks(a);
8314      a.destroy();
8315  },
8316  getServerResolution: function (a) {
8317      var b = Number.POSITIVE_INFINITY;
8318      a = a || this.map.getResolution();
8319      if (this.serverResolutions && -1 === OpenLayers.Util.indexOf(this.serverResolutions, a)) {
8320          var c, d, e, f;
8321          for (c = this.serverResolutions.length - 1; 0 <= c; c--) {
8322              e = this.serverResolutions[c];
8323              d = Math.abs(e - a);
8324              if (d > b) break;
8325              b = d;
8326              f = e;
8327          }
8328          a = f;
8329      }
8330      return a;
8331  },
8332  getServerZoom: function () {
8333      var a = this.getServerResolution();
8334      return this.serverResolutions ? OpenLayers.Util.indexOf(this.serverResolutions, a) : this.map.getZoomForResolution(a) + (this.zoomOffset || 0);
8335  },
8336  applyBackBuffer: function (a) {
8337      null !== this.backBufferTimerId && this.removeBackBuffer();
8338      var b = this.backBuffer;
8339      if (!b) {
8340          b = this.createBackBuffer();
8341          if (!b) return;
8342          a === this.gridResolution ? this.div.insertBefore(b, this.div.firstChild) : this.map.baseLayer.div.parentNode.insertBefore(b, this.map.baseLayer.div);
8343          this.backBuffer = b;
8344          var c = this.grid[0][0].bounds;
8345          this.backBufferLonLat = { lon: c.left, lat: c.top };
8346          this.backBufferResolution = this.gridResolution;
8347      }
8348      for (var c = this.backBufferResolution / a, d = b.childNodes, e, f = d.length - 1; 0 <= f; --f)
8349          (e = d[f]), (e.style.top = ((c * e._i * e._h) | 0) + "px"), (e.style.left = ((c * e._j * e._w) | 0) + "px"), (e.style.width = Math.round(c * e._w) + "px"), (e.style.height = Math.round(c * e._h) + "px");
8350      a = this.getViewPortPxFromLonLat(this.backBufferLonLat, a);
8351      c = this.map.layerContainerOriginPx.y;
8352      b.style.left = Math.round(a.x - this.map.layerContainerOriginPx.x) + "px";
8353      b.style.top = Math.round(a.y - c) + "px";
8354  },
8355  createBackBuffer: function () {
8356      var a;
8357      if (0 < this.grid.length) {
8358          a = document.createElement("div");
8359          a.id = this.div.id + "_bb";
8360          a.className = "olBackBuffer";
8361          a.style.position = "absolute";
8362          var b = this.map;
8363          a.style.zIndex = "resize" === this.transitionEffect ? this.getZIndex() - 1 : b.Z_INDEX_BASE.BaseLayer - (b.getNumLayers() - b.getLayerIndex(this));
8364          for (var b = 0, c = this.grid.length; b < c; b++)
8365              for (var d = 0, e = this.grid[b].length; d < e; d++) {
8366                  var f = this.grid[b][d],
8367                      g = this.grid[b][d].createBackBuffer();
8368                  g && ((g._i = b), (g._j = d), (g._w = f.size.w), (g._h = f.size.h), (g.id = f.id + "_bb"), a.appendChild(g));
8369              }
8370      }
8371      return a;
8372  },
8373  removeBackBuffer: function () {
8374      if (this._transitionElement) {
8375          for (var a = this.transitionendEvents.length - 1; 0 <= a; --a) OpenLayers.Event.stopObserving(this._transitionElement, this.transitionendEvents[a], this._removeBackBuffer);
8376          delete this._transitionElement;
8377      }
8378      this.backBuffer &&
8379          (this.backBuffer.parentNode && this.backBuffer.parentNode.removeChild(this.backBuffer),
8380          (this.backBufferResolution = this.backBuffer = null),
8381          null !== this.backBufferTimerId && (window.clearTimeout(this.backBufferTimerId), (this.backBufferTimerId = null)));
8382  },
8383  moveByPx: function (a, b) {
8384      this.singleTile || this.moveGriddedTiles();
8385  },
8386  setTileSize: function (a) {
8387      this.singleTile && ((a = this.map.getSize()), (a.h = parseInt(a.h * this.ratio, 10)), (a.w = parseInt(a.w * this.ratio, 10)));
8388      OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this, [a]);
8389  },
8390  getTilesBounds: function () {
8391      var a = null,
8392          b = this.grid.length;
8393      if (b)
8394          var a = this.grid[b - 1][0].bounds,
8395              b = this.grid[0].length * a.getWidth(),
8396              c = this.grid.length * a.getHeight(),
8397              a = new OpenLayers.Bounds(a.left, a.bottom, a.left + b, a.bottom + c);
8398      return a;
8399  },
8400  initSingleTile: function (a) {
8401      this.events.triggerEvent("retile");
8402      var b = a.getCenterLonLat(),
8403          c = a.getWidth() * this.ratio;
8404      a = a.getHeight() * this.ratio;
8405      b = new OpenLayers.Bounds(b.lon - c / 2, b.lat - a / 2, b.lon + c / 2, b.lat + a / 2);
8406      c = this.map.getLayerPxFromLonLat({ lon: b.left, lat: b.top });
8407      this.grid.length || (this.grid[0] = []);
8408      (a = this.grid[0][0]) ? a.moveTo(b, c) : ((a = this.addTile(b, c)), this.addTileMonitoringHooks(a), a.draw(), (this.grid[0][0] = a));
8409      this.removeExcessTiles(1, 1);
8410      this.gridResolution = this.getServerResolution();
8411  },
8412  calculateGridLayout: function (a, b, c) {
8413      var d = c * this.tileSize.w;
8414      c *= this.tileSize.h;
8415      var e = Math.floor((a.left - b.lon) / d) - this.buffer,
8416          f = this.rowSign;
8417      a = Math[~f ? "floor" : "ceil"]((f * (b.lat - a.top + c)) / c) - this.buffer * f;
8418      return { tilelon: d, tilelat: c, startcol: e, startrow: a };
8419  },
8420  getTileOrigin: function () {
8421      var a = this.tileOrigin;
8422      if (!a)
8423          var a = this.getMaxExtent(),
8424              b = { tl: ["left", "top"], tr: ["right", "top"], bl: ["left", "bottom"], br: ["right", "bottom"] }[this.tileOriginCorner],
8425              a = new OpenLayers.LonLat(a[b[0]], a[b[1]]);
8426      return a;
8427  },
8428  getTileBoundsForGridIndex: function (a, b) {
8429      var c = this.getTileOrigin(),
8430          d = this.gridLayout,
8431          e = d.tilelon,
8432          f = d.tilelat,
8433          g = d.startcol,
8434          d = d.startrow,
8435          h = this.rowSign;
8436      return new OpenLayers.Bounds(c.lon + (g + b) * e, c.lat - (d + a * h) * f * h, c.lon + (g + b + 1) * e, c.lat - (d + (a - 1) * h) * f * h);
8437  },
8438  initGriddedTiles: function (a) {
8439      this.events.triggerEvent("retile");
8440      var b = this.map.getSize(),
8441          c = this.getTileOrigin(),
8442          d = this.map.getResolution(),
8443          e = this.getServerResolution(),
8444          f = d / e,
8445          d = this.tileSize.w / f,
8446          f = this.tileSize.h / f,
8447          g = Math.ceil(b.h / f) + 2 * this.buffer + 1,
8448          b = Math.ceil(b.w / d) + 2 * this.buffer + 1;
8449      this.gridLayout = e = this.calculateGridLayout(a, c, e);
8450      var c = e.tilelon,
8451          h = e.tilelat,
8452          e = this.map.layerContainerOriginPx.x,
8453          k = this.map.layerContainerOriginPx.y,
8454          l = this.getTileBoundsForGridIndex(0, 0),
8455          m = this.map.getViewPortPxFromLonLat(new OpenLayers.LonLat(l.left, l.top));
8456      m.x = Math.round(m.x) - e;
8457      m.y = Math.round(m.y) - k;
8458      var e = [],
8459          k = this.map.getCenter(),
8460          n = 0;
8461      do {
8462          var p = this.grid[n];
8463          p || ((p = []), this.grid.push(p));
8464          var q = 0;
8465          do {
8466              var l = this.getTileBoundsForGridIndex(n, q),
8467                  r = m.clone();
8468              r.x += q * Math.round(d);
8469              r.y += n * Math.round(f);
8470              var s = p[q];
8471              s ? s.moveTo(l, r, !1) : ((s = this.addTile(l, r)), this.addTileMonitoringHooks(s), p.push(s));
8472              r = l.getCenterLonLat();
8473              e.push({ tile: s, distance: Math.pow(r.lon - k.lon, 2) + Math.pow(r.lat - k.lat, 2) });
8474              q += 1;
8475          } while (l.right <= a.right + c * this.buffer || q < b);
8476          n += 1;
8477      } while (l.bottom >= a.bottom - h * this.buffer || n < g);
8478      this.removeExcessTiles(n, q);
8479      this.gridResolution = d = this.getServerResolution();
8480      e.sort(function (a, b) {
8481          return a.distance - b.distance;
8482      });
8483      a = 0;
8484      for (d = e.length; a < d; ++a) e[a].tile.draw();
8485  },
8486  getMaxExtent: function () {
8487      return this.maxExtent;
8488  },
8489  addTile: function (a, b) {
8490      var c = new this.tileClass(this, b, a, null, this.tileSize, this.tileOptions);
8491      this.events.triggerEvent("addtile", { tile: c });
8492      return c;
8493  },
8494  addTileMonitoringHooks: function (a) {
8495      a.onLoadStart = function () {
8496          !1 === this.loading && ((this.loading = !0), this.events.triggerEvent("loadstart"));
8497          this.events.triggerEvent("tileloadstart", { tile: a });
8498          this.numLoadingTiles++;
8499          !this.singleTile && this.backBuffer && this.gridResolution === this.backBufferResolution && OpenLayers.Element.addClass(a.getTile(), "olTileReplacing");
8500      };
8501      a.onLoadEnd = function (b) {
8502          this.numLoadingTiles--;
8503          b = "unload" === b.type;
8504          this.events.triggerEvent("tileloaded", { tile: a, aborted: b });
8505          if (!this.singleTile && !b && this.backBuffer && this.gridResolution === this.backBufferResolution) {
8506              var c = a.getTile();
8507              if ("none" === OpenLayers.Element.getStyle(c, "display")) {
8508                  var d = document.getElementById(a.id + "_bb");
8509                  d && d.parentNode.removeChild(d);
8510              }
8511              OpenLayers.Element.removeClass(c, "olTileReplacing");
8512          }
8513          if (0 === this.numLoadingTiles) {
8514              if (this.backBuffer)
8515                  if (0 === this.backBuffer.childNodes.length) this.removeBackBuffer();
8516                  else {
8517                      this._transitionElement = b ? this.div.lastChild : a.imgDiv;
8518                      b = this.transitionendEvents;
8519                      for (c = b.length - 1; 0 <= c; --c) OpenLayers.Event.observe(this._transitionElement, b[c], this._removeBackBuffer);
8520                      this.backBufferTimerId = window.setTimeout(this._removeBackBuffer, this.removeBackBufferDelay);
8521                  }
8522              this.loading = !1;
8523              this.events.triggerEvent("loadend");
8524          }
8525      };
8526      a.onLoadError = function () {
8527          this.events.triggerEvent("tileerror", { tile: a });
8528      };
8529      a.events.on({ loadstart: a.onLoadStart, loadend: a.onLoadEnd, unload: a.onLoadEnd, loaderror: a.onLoadError, scope: this });
8530  },
8531  removeTileMonitoringHooks: function (a) {
8532      a.unload();
8533      a.events.un({ loadstart: a.onLoadStart, loadend: a.onLoadEnd, unload: a.onLoadEnd, loaderror: a.onLoadError, scope: this });
8534  },
8535  moveGriddedTiles: function () {
8536      for (var a = this.buffer + 1; ; ) {
8537          var b = this.grid[0][0],
8538              c = b.position.x + this.map.layerContainerOriginPx.x,
8539              b = b.position.y + this.map.layerContainerOriginPx.y,
8540              d = this.getServerResolution() / this.map.getResolution(),
8541              d = { w: Math.round(this.tileSize.w * d), h: Math.round(this.tileSize.h * d) };
8542          if (c > -d.w * (a - 1)) this.shiftColumn(!0, d);
8543          else if (c < -d.w * a) this.shiftColumn(!1, d);
8544          else if (b > -d.h * (a - 1)) this.shiftRow(!0, d);
8545          else if (b < -d.h * a) this.shiftRow(!1, d);
8546          else break;
8547      }
8548  },
8549  shiftRow: function (a, b) {
8550      var c = this.grid,
8551          d = a ? 0 : c.length - 1,
8552          e = a ? -1 : 1;
8553      this.gridLayout.startrow += e * this.rowSign;
8554      for (var f = c[d], g = c[a ? "pop" : "shift"](), h = 0, k = g.length; h < k; h++) {
8555          var l = g[h],
8556              m = f[h].position.clone();
8557          m.y += b.h * e;
8558          l.moveTo(this.getTileBoundsForGridIndex(d, h), m);
8559      }
8560      c[a ? "unshift" : "push"](g);
8561  },
8562  shiftColumn: function (a, b) {
8563      var c = this.grid,
8564          d = a ? 0 : c[0].length - 1,
8565          e = a ? -1 : 1;
8566      this.gridLayout.startcol += e;
8567      for (var f = 0, g = c.length; f < g; f++) {
8568          var h = c[f],
8569              k = h[d].position.clone(),
8570              l = h[a ? "pop" : "shift"]();
8571          k.x += b.w * e;
8572          l.moveTo(this.getTileBoundsForGridIndex(f, d), k);
8573          h[a ? "unshift" : "push"](l);
8574      }
8575  },
8576  removeExcessTiles: function (a, b) {
8577      for (var c, d; this.grid.length > a; ) {
8578          var e = this.grid.pop();
8579          c = 0;
8580          for (d = e.length; c < d; c++) {
8581              var f = e[c];
8582              this.destroyTile(f);
8583          }
8584      }
8585      c = 0;
8586      for (d = this.grid.length; c < d; c++) for (; this.grid[c].length > b; ) (e = this.grid[c]), (f = e.pop()), this.destroyTile(f);
8587  },
8588  onMapResize: function () {
8589      this.singleTile && (this.clearGrid(), this.setTileSize());
8590  },
8591  getTileBounds: function (a) {
8592      var b = this.maxExtent,
8593          c = this.getResolution(),
8594          d = c * this.tileSize.w,
8595          c = c * this.tileSize.h,
8596          e = this.getLonLatFromViewPortPx(a);
8597      a = b.left + d * Math.floor((e.lon - b.left) / d);
8598      b = b.bottom + c * Math.floor((e.lat - b.bottom) / c);
8599      return new OpenLayers.Bounds(a, b, a + d, b + c);
8600  },
8601  CLASS_NAME: "OpenLayers.Layer.Grid",
8602});
8603OpenLayers.Format.ArcXML = OpenLayers.Class(OpenLayers.Format.XML, {
8604  fontStyleKeys: "antialiasing blockout font fontcolor fontsize fontstyle glowing interval outline printmode shadow transparency".split(" "),
8605  request: null,
8606  response: null,
8607  initialize: function (a) {
8608      this.request = new OpenLayers.Format.ArcXML.Request();
8609      this.response = new OpenLayers.Format.ArcXML.Response();
8610      if (a)
8611          if ("feature" == a.requesttype) {
8612              this.request.get_image = null;
8613              var b = this.request.get_feature.query;
8614              this.addCoordSys(b.featurecoordsys, a.featureCoordSys);
8615              this.addCoordSys(b.filtercoordsys, a.filterCoordSys);
8616              a.polygon
8617                  ? ((b.isspatial = !0), (b.spatialfilter.polygon = a.polygon))
8618                  : a.envelope && ((b.isspatial = !0), (b.spatialfilter.envelope = { minx: 0, miny: 0, maxx: 0, maxy: 0 }), this.parseEnvelope(b.spatialfilter.envelope, a.envelope));
8619          } else
8620              "image" == a.requesttype
8621                  ? ((this.request.get_feature = null),
8622                    (b = this.request.get_image.properties),
8623                    this.parseEnvelope(b.envelope, a.envelope),
8624                    this.addLayers(b.layerlist, a.layers),
8625                    this.addImageSize(b.imagesize, a.tileSize),
8626                    this.addCoordSys(b.featurecoordsys, a.featureCoordSys),
8627                    this.addCoordSys(b.filtercoordsys, a.filterCoordSys))
8628                  : (this.request = null);
8629      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
8630  },
8631  parseEnvelope: function (a, b) {
8632      b && 4 == b.length && ((a.minx = b[0]), (a.miny = b[1]), (a.maxx = b[2]), (a.maxy = b[3]));
8633  },
8634  addLayers: function (a, b) {
8635      for (var c = 0, d = b.length; c < d; c++) a.push(b[c]);
8636  },
8637  addImageSize: function (a, b) {
8638      null !== b && ((a.width = b.w), (a.height = b.h), (a.printwidth = b.w), (a.printheight = b.h));
8639  },
8640  addCoordSys: function (a, b) {
8641      "string" == typeof b ? ((a.id = parseInt(b)), (a.string = b)) : "object" == typeof b && null !== b.proj && ((a.id = b.proj.srsProjNumber), (a.string = b.proj.srsCode));
8642  },
8643  iserror: function (a) {
8644      var b = null;
8645      a ? ((a = OpenLayers.Format.XML.prototype.read.apply(this, [a])), (a = a.documentElement.getElementsByTagName("ERROR")), (b = null !== a && 0 < a.length)) : (b = "" !== this.response.error);
8646      return b;
8647  },
8648  read: function (a) {
8649      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
8650      var b = null;
8651      a && a.documentElement && (b = "ARCXML" == a.documentElement.nodeName ? a.documentElement : a.documentElement.getElementsByTagName("ARCXML")[0]);
8652      if (!b || "parsererror" === b.firstChild.nodeName) {
8653          var c, d;
8654          try {
8655              (c = a.firstChild.nodeValue), (d = a.firstChild.childNodes[1].firstChild.nodeValue);
8656          } catch (e) {}
8657          throw { message: "Error parsing the ArcXML request", error: c, source: d };
8658      }
8659      return this.parseResponse(b);
8660  },
8661  write: function (a) {
8662      a || (a = this.request);
8663      var b = this.createElementNS("", "ARCXML");
8664      b.setAttribute("version", "1.1");
8665      var c = this.createElementNS("", "REQUEST");
8666      if (null != a.get_image) {
8667          var d = this.createElementNS("", "GET_IMAGE");
8668          c.appendChild(d);
8669          var e = this.createElementNS("", "PROPERTIES");
8670          d.appendChild(e);
8671          a = a.get_image.properties;
8672          null != a.featurecoordsys && ((d = this.createElementNS("", "FEATURECOORDSYS")), e.appendChild(d), 0 === a.featurecoordsys.id ? d.setAttribute("string", a.featurecoordsys.string) : d.setAttribute("id", a.featurecoordsys.id));
8673          null != a.filtercoordsys && ((d = this.createElementNS("", "FILTERCOORDSYS")), e.appendChild(d), 0 === a.filtercoordsys.id ? d.setAttribute("string", a.filtercoordsys.string) : d.setAttribute("id", a.filtercoordsys.id));
8674          null != a.envelope &&
8675              ((d = this.createElementNS("", "ENVELOPE")),
8676              e.appendChild(d),
8677              d.setAttribute("minx", a.envelope.minx),
8678              d.setAttribute("miny", a.envelope.miny),
8679              d.setAttribute("maxx", a.envelope.maxx),
8680              d.setAttribute("maxy", a.envelope.maxy));
8681          d = this.createElementNS("", "IMAGESIZE");
8682          e.appendChild(d);
8683          d.setAttribute("height", a.imagesize.height);
8684          d.setAttribute("width", a.imagesize.width);
8685          if (a.imagesize.height != a.imagesize.printheight || a.imagesize.width != a.imagesize.printwidth) d.setAttribute("printheight", a.imagesize.printheight), d.setArrtibute("printwidth", a.imagesize.printwidth);
8686          null != a.background &&
8687              ((d = this.createElementNS("", "BACKGROUND")),
8688              e.appendChild(d),
8689              d.setAttribute("color", a.background.color.r + "," + a.background.color.g + "," + a.background.color.b),
8690              null !== a.background.transcolor && d.setAttribute("transcolor", a.background.transcolor.r + "," + a.background.transcolor.g + "," + a.background.transcolor.b));
8691          if (null != a.layerlist && 0 < a.layerlist.length)
8692              for (d = this.createElementNS("", "LAYERLIST"), e.appendChild(d), e = 0; e < a.layerlist.length; e++) {
8693                  var f = this.createElementNS("", "LAYERDEF");
8694                  d.appendChild(f);
8695                  f.setAttribute("id", a.layerlist[e].id);
8696                  f.setAttribute("visible", a.layerlist[e].visible);
8697                  if ("object" == typeof a.layerlist[e].query) {
8698                      var g = a.layerlist[e].query;
8699                      if (0 > g.where.length) continue;
8700                      var h = null,
8701                          h = "boolean" == typeof g.spatialfilter && g.spatialfilter ? this.createElementNS("", "SPATIALQUERY") : this.createElementNS("", "QUERY");
8702                      h.setAttribute("where", g.where);
8703                      "number" == typeof g.accuracy && 0 < g.accuracy && h.setAttribute("accuracy", g.accuracy);
8704                      "number" == typeof g.featurelimit && 2e3 > g.featurelimit && h.setAttribute("featurelimit", g.featurelimit);
8705                      "string" == typeof g.subfields && "#ALL#" != g.subfields && h.setAttribute("subfields", g.subfields);
8706                      "string" == typeof g.joinexpression && 0 < g.joinexpression.length && h.setAttribute("joinexpression", g.joinexpression);
8707                      "string" == typeof g.jointables && 0 < g.jointables.length && h.setAttribute("jointables", g.jointables);
8708                      f.appendChild(h);
8709                  }
8710                  "object" == typeof a.layerlist[e].renderer && this.addRenderer(f, a.layerlist[e].renderer);
8711              }
8712      } else
8713          null != a.get_feature &&
8714              ((d = this.createElementNS("", "GET_FEATURES")),
8715              d.setAttribute("outputmode", "newxml"),
8716              d.setAttribute("checkesc", "true"),
8717              a.get_feature.geometry ? d.setAttribute("geometry", a.get_feature.geometry) : d.setAttribute("geometry", "false"),
8718              a.get_feature.compact && d.setAttribute("compact", a.get_feature.compact),
8719              "number" == a.get_feature.featurelimit && d.setAttribute("featurelimit", a.get_feature.featurelimit),
8720              d.setAttribute("globalenvelope", "true"),
8721              c.appendChild(d),
8722              null != a.get_feature.layer && 0 < a.get_feature.layer.length && ((e = this.createElementNS("", "LAYER")), e.setAttribute("id", a.get_feature.layer), d.appendChild(e)),
8723              (a = a.get_feature.query),
8724              null != a &&
8725                  ((e = null),
8726                  (e = a.isspatial ? this.createElementNS("", "SPATIALQUERY") : this.createElementNS("", "QUERY")),
8727                  d.appendChild(e),
8728                  "number" == typeof a.accuracy && e.setAttribute("accuracy", a.accuracy),
8729                  null != a.featurecoordsys &&
8730                      ((d = this.createElementNS("", "FEATURECOORDSYS")), 0 == a.featurecoordsys.id ? d.setAttribute("string", a.featurecoordsys.string) : d.setAttribute("id", a.featurecoordsys.id), e.appendChild(d)),
8731                  null != a.filtercoordsys && ((d = this.createElementNS("", "FILTERCOORDSYS")), 0 === a.filtercoordsys.id ? d.setAttribute("string", a.filtercoordsys.string) : d.setAttribute("id", a.filtercoordsys.id), e.appendChild(d)),
8732                  0 < a.buffer && ((d = this.createElementNS("", "BUFFER")), d.setAttribute("distance", a.buffer), e.appendChild(d)),
8733                  a.isspatial &&
8734                      ((d = this.createElementNS("", "SPATIALFILTER")),
8735                      d.setAttribute("relation", a.spatialfilter.relation),
8736                      e.appendChild(d),
8737                      a.spatialfilter.envelope
8738                          ? ((f = this.createElementNS("", "ENVELOPE")),
8739                            f.setAttribute("minx", a.spatialfilter.envelope.minx),
8740                            f.setAttribute("miny", a.spatialfilter.envelope.miny),
8741                            f.setAttribute("maxx", a.spatialfilter.envelope.maxx),
8742                            f.setAttribute("maxy", a.spatialfilter.envelope.maxy),
8743                            d.appendChild(f))
8744                          : "object" == typeof a.spatialfilter.polygon && d.appendChild(this.writePolygonGeometry(a.spatialfilter.polygon))),
8745                  null != a.where && 0 < a.where.length && e.setAttribute("where", a.where)));
8746      b.appendChild(c);
8747      return OpenLayers.Format.XML.prototype.write.apply(this, [b]);
8748  },
8749  addGroupRenderer: function (a, b) {
8750      var c = this.createElementNS("", "GROUPRENDERER");
8751      a.appendChild(c);
8752      for (var d = 0; d < b.length; d++) this.addRenderer(c, b[d]);
8753  },
8754  addRenderer: function (a, b) {
8755      if (OpenLayers.Util.isArray(b)) this.addGroupRenderer(a, b);
8756      else {
8757          var c = this.createElementNS("", b.type.toUpperCase() + "RENDERER");
8758          a.appendChild(c);
8759          "VALUEMAPRENDERER" == c.tagName
8760              ? this.addValueMapRenderer(c, b)
8761              : "VALUEMAPLABELRENDERER" == c.tagName
8762              ? this.addValueMapLabelRenderer(c, b)
8763              : "SIMPLELABELRENDERER" == c.tagName
8764              ? this.addSimpleLabelRenderer(c, b)
8765              : "SCALEDEPENDENTRENDERER" == c.tagName && this.addScaleDependentRenderer(c, b);
8766      }
8767  },
8768  addScaleDependentRenderer: function (a, b) {
8769      ("string" != typeof b.lower && "number" != typeof b.lower) || a.setAttribute("lower", b.lower);
8770      ("string" != typeof b.upper && "number" != typeof b.upper) || a.setAttribute("upper", b.upper);
8771      this.addRenderer(a, b.renderer);
8772  },
8773  addValueMapLabelRenderer: function (a, b) {
8774      a.setAttribute("lookupfield", b.lookupfield);
8775      a.setAttribute("labelfield", b.labelfield);
8776      if ("object" == typeof b.exacts)
8777          for (var c = 0, d = b.exacts.length; c < d; c++) {
8778              var e = b.exacts[c],
8779                  f = this.createElementNS("", "EXACT");
8780              "string" == typeof e.value && f.setAttribute("value", e.value);
8781              "string" == typeof e.label && f.setAttribute("label", e.label);
8782              "string" == typeof e.method && f.setAttribute("method", e.method);
8783              a.appendChild(f);
8784              if ("object" == typeof e.symbol) {
8785                  var g = null;
8786                  "text" == e.symbol.type && (g = this.createElementNS("", "TEXTSYMBOL"));
8787                  if (null != g) {
8788                      for (var h = this.fontStyleKeys, k = 0, l = h.length; k < l; k++) {
8789                          var m = h[k];
8790                          e.symbol[m] && g.setAttribute(m, e.symbol[m]);
8791                      }
8792                      f.appendChild(g);
8793                  }
8794              }
8795          }
8796  },
8797  addValueMapRenderer: function (a, b) {
8798      a.setAttribute("lookupfield", b.lookupfield);
8799      if ("object" == typeof b.ranges)
8800          for (var c = 0, d = b.ranges.length; c < d; c++) {
8801              var e = b.ranges[c],
8802                  f = this.createElementNS("", "RANGE");
8803              f.setAttribute("lower", e.lower);
8804              f.setAttribute("upper", e.upper);
8805              a.appendChild(f);
8806              if ("object" == typeof e.symbol) {
8807                  var g = null;
8808                  "simplepolygon" == e.symbol.type && (g = this.createElementNS("", "SIMPLEPOLYGONSYMBOL"));
8809                  null != g &&
8810                      ("string" == typeof e.symbol.boundarycolor && g.setAttribute("boundarycolor", e.symbol.boundarycolor),
8811                      "string" == typeof e.symbol.fillcolor && g.setAttribute("fillcolor", e.symbol.fillcolor),
8812                      "number" == typeof e.symbol.filltransparency && g.setAttribute("filltransparency", e.symbol.filltransparency),
8813                      f.appendChild(g));
8814              }
8815          }
8816      else if ("object" == typeof b.exacts)
8817          for (c = 0, d = b.exacts.length; c < d; c++)
8818              (e = b.exacts[c]),
8819                  (f = this.createElementNS("", "EXACT")),
8820                  "string" == typeof e.value && f.setAttribute("value", e.value),
8821                  "string" == typeof e.label && f.setAttribute("label", e.label),
8822                  "string" == typeof e.method && f.setAttribute("method", e.method),
8823                  a.appendChild(f),
8824                  "object" == typeof e.symbol &&
8825                      ((g = null),
8826                      "simplemarker" == e.symbol.type && (g = this.createElementNS("", "SIMPLEMARKERSYMBOL")),
8827                      null != g &&
8828                          ("string" == typeof e.symbol.antialiasing && g.setAttribute("antialiasing", e.symbol.antialiasing),
8829                          "string" == typeof e.symbol.color && g.setAttribute("color", e.symbol.color),
8830                          "string" == typeof e.symbol.outline && g.setAttribute("outline", e.symbol.outline),
8831                          "string" == typeof e.symbol.overlap && g.setAttribute("overlap", e.symbol.overlap),
8832                          "string" == typeof e.symbol.shadow && g.setAttribute("shadow", e.symbol.shadow),
8833                          "number" == typeof e.symbol.transparency && g.setAttribute("transparency", e.symbol.transparency),
8834                          "string" == typeof e.symbol.usecentroid && g.setAttribute("usecentroid", e.symbol.usecentroid),
8835                          "number" == typeof e.symbol.width && g.setAttribute("width", e.symbol.width),
8836                          f.appendChild(g)));
8837  },
8838  addSimpleLabelRenderer: function (a, b) {
8839      a.setAttribute("field", b.field);
8840      for (var c = "featureweight howmanylabels labelbufferratio labelpriorities labelweight linelabelposition rotationalangles".split(" "), d = 0, e = c.length; d < e; d++) {
8841          var f = c[d];
8842          b[f] && a.setAttribute(f, b[f]);
8843      }
8844      if ("text" == b.symbol.type) {
8845          var g = b.symbol,
8846              h = this.createElementNS("", "TEXTSYMBOL");
8847          a.appendChild(h);
8848          c = this.fontStyleKeys;
8849          d = 0;
8850          for (e = c.length; d < e; d++) (f = c[d]), g[f] && h.setAttribute(f, b[f]);
8851      }
8852  },
8853  writePolygonGeometry: function (a) {
8854      if (!(a instanceof OpenLayers.Geometry.Polygon)) throw { message: "Cannot write polygon geometry to ArcXML with an " + a.CLASS_NAME + " object.", geometry: a };
8855      for (var b = this.createElementNS("", "POLYGON"), c = 0, d = a.components.length; c < d; c++) {
8856          for (var e = a.components[c], f = this.createElementNS("", "RING"), g = 0, h = e.components.length; g < h; g++) {
8857              var k = e.components[g],
8858                  l = this.createElementNS("", "POINT");
8859              l.setAttribute("x", k.x);
8860              l.setAttribute("y", k.y);
8861              f.appendChild(l);
8862          }
8863          b.appendChild(f);
8864      }
8865      return b;
8866  },
8867  parseResponse: function (a) {
8868      "string" == typeof a && (a = new OpenLayers.Format.XML().read(a));
8869      var b = new OpenLayers.Format.ArcXML.Response(),
8870          c = a.getElementsByTagName("ERROR");
8871      if (null != c && 0 < c.length) b.error = this.getChildValue(c, "Unknown error.");
8872      else {
8873          c = a.getElementsByTagName("RESPONSE");
8874          if (null == c || 0 == c.length) return (b.error = "No RESPONSE tag found in ArcXML response."), b;
8875          var d = c[0].firstChild.nodeName;
8876          "#text" == d && (d = c[0].firstChild.nextSibling.nodeName);
8877          if ("IMAGE" == d)
8878              (c = a.getElementsByTagName("ENVELOPE")),
8879                  (a = a.getElementsByTagName("OUTPUT")),
8880                  null == c || 0 == c.length
8881                      ? (b.error = "No ENVELOPE tag found in ArcXML response.")
8882                      : null == a || 0 == a.length
8883                      ? (b.error = "No OUTPUT tag found in ArcXML response.")
8884                      : ((c = this.parseAttributes(c[0])), (d = this.parseAttributes(a[0])), (b.image = "string" == typeof d.type ? { envelope: c, output: { type: d.type, data: this.getChildValue(a[0]) } } : { envelope: c, output: d }));
8885          else if ("FEATURES" == d) {
8886              if (((a = c[0].getElementsByTagName("FEATURES")), (c = a[0].getElementsByTagName("FEATURECOUNT")), (b.features.featurecount = c[0].getAttribute("count")), 0 < b.features.featurecount))
8887                  for (c = a[0].getElementsByTagName("ENVELOPE"), b.features.envelope = this.parseAttributes(c[0], "number"), a = a[0].getElementsByTagName("FEATURE"), c = 0; c < a.length; c++) {
8888                      for (var d = new OpenLayers.Feature.Vector(), e = a[c].getElementsByTagName("FIELD"), f = 0; f < e.length; f++) {
8889                          var g = e[f].getAttribute("name"),
8890                              h = e[f].getAttribute("value");
8891                          d.attributes[g] = h;
8892                      }
8893                      e = a[c].getElementsByTagName("POLYGON");
8894                      if (0 < e.length) {
8895                          e = e[0].getElementsByTagName("RING");
8896                          f = [];
8897                          for (g = 0; g < e.length; g++) {
8898                              h = [];
8899                              h.push(this.parsePointGeometry(e[g]));
8900                              for (var k = e[g].getElementsByTagName("HOLE"), l = 0; l < k.length; l++) h.push(this.parsePointGeometry(k[l]));
8901                              f.push(new OpenLayers.Geometry.Polygon(h));
8902                          }
8903                          d.geometry = 1 == f.length ? f[0] : new OpenLayers.Geometry.MultiPolygon(f);
8904                      }
8905                      b.features.feature.push(d);
8906                  }
8907          } else b.error = "Unidentified response type.";
8908      }
8909      return b;
8910  },
8911  parseAttributes: function (a, b) {
8912      for (var c = {}, d = 0; d < a.attributes.length; d++) c[a.attributes[d].nodeName] = "number" == b ? parseFloat(a.attributes[d].nodeValue) : a.attributes[d].nodeValue;
8913      return c;
8914  },
8915  parsePointGeometry: function (a) {
8916      var b = [],
8917          c = a.getElementsByTagName("COORDS");
8918      if (0 < c.length)
8919          for (a = this.getChildValue(c[0]), a = a.split(/;/), c = 0; c < a.length; c++) {
8920              var d = a[c].split(/ /);
8921              b.push(new OpenLayers.Geometry.Point(d[0], d[1]));
8922          }
8923      else if (((a = a.getElementsByTagName("POINT")), 0 < a.length)) for (c = 0; c < a.length; c++) b.push(new OpenLayers.Geometry.Point(parseFloat(a[c].getAttribute("x")), parseFloat(a[c].getAttribute("y"))));
8924      return new OpenLayers.Geometry.LinearRing(b);
8925  },
8926  CLASS_NAME: "OpenLayers.Format.ArcXML",
8927});
8928OpenLayers.Format.ArcXML.Request = OpenLayers.Class({
8929  initialize: function (a) {
8930      return OpenLayers.Util.extend(this, {
8931          get_image: {
8932              properties: {
8933                  background: null,
8934                  draw: !0,
8935                  envelope: { minx: 0, miny: 0, maxx: 0, maxy: 0 },
8936                  featurecoordsys: { id: 0, string: "", datumtransformid: 0, datumtransformstring: "" },
8937                  filtercoordsys: { id: 0, string: "", datumtransformid: 0, datumtransformstring: "" },
8938                  imagesize: { height: 0, width: 0, dpi: 96, printheight: 0, printwidth: 0, scalesymbols: !1 },
8939                  layerlist: [],
8940                  output: { baseurl: "", legendbaseurl: "", legendname: "", legendpath: "", legendurl: "", name: "", path: "", type: "jpg", url: "" },
8941              },
8942          },
8943          get_feature: {
8944              layer: "",
8945              query: {
8946                  isspatial: !1,
8947                  featurecoordsys: { id: 0, string: "", datumtransformid: 0, datumtransformstring: "" },
8948                  filtercoordsys: { id: 0, string: "", datumtransformid: 0, datumtransformstring: "" },
8949                  buffer: 0,
8950                  where: "",
8951                  spatialfilter: { relation: "envelope_intersection", envelope: null },
8952              },
8953          },
8954          environment: { separators: { cs: " ", ts: ";" } },
8955          layer: [],
8956          workspaces: [],
8957      });
8958  },
8959  CLASS_NAME: "OpenLayers.Format.ArcXML.Request",
8960});
8961OpenLayers.Format.ArcXML.Response = OpenLayers.Class({
8962  initialize: function (a) {
8963      return OpenLayers.Util.extend(this, { image: { envelope: null, output: "" }, features: { featurecount: 0, envelope: null, feature: [] }, error: "" });
8964  },
8965  CLASS_NAME: "OpenLayers.Format.ArcXML.Response",
8966});
8967(function () {
8968  function a() {
8969      this._object = f && !k ? new f() : new window.ActiveXObject("Microsoft.XMLHTTP");
8970      this._listeners = [];
8971  }
8972  function b() {
8973      return new a();
8974  }
8975  function c(a) {
8976      b.onreadystatechange && b.onreadystatechange.apply(a);
8977      a.dispatchEvent({ type: "readystatechange", bubbles: !1, cancelable: !1, timeStamp: new Date() + 0 });
8978  }
8979  function d(a) {
8980      try {
8981          a.responseText = a._object.responseText;
8982      } catch (b) {}
8983      try {
8984          var c;
8985          var d = a._object,
8986              e = d.responseXML,
8987              f = d.responseText;
8988          h && f && e && !e.documentElement && d.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/) && ((e = new window.ActiveXObject("Microsoft.XMLDOM")), (e.async = !1), (e.validateOnParse = !1), e.loadXML(f));
8989          c = e && ((h && 0 != e.parseError) || !e.documentElement || (e.documentElement && "parsererror" == e.documentElement.tagName)) ? null : e;
8990          a.responseXML = c;
8991      } catch (g) {}
8992      try {
8993          a.status = a._object.status;
8994      } catch (k) {}
8995      try {
8996          a.statusText = a._object.statusText;
8997      } catch (u) {}
8998  }
8999  function e(a) {
9000      a._object.onreadystatechange = new window.Function();
9001  }
9002  var f = window.XMLHttpRequest,
9003      g = !!window.controllers,
9004      h = window.document.all && !window.opera,
9005      k = h && window.navigator.userAgent.match(/MSIE 7.0/);
9006  b.prototype = a.prototype;
9007  g && f.wrapped && (b.wrapped = f.wrapped);
9008  b.UNSENT = 0;
9009  b.OPENED = 1;
9010  b.HEADERS_RECEIVED = 2;
9011  b.LOADING = 3;
9012  b.DONE = 4;
9013  b.prototype.readyState = b.UNSENT;
9014  b.prototype.responseText = "";
9015  b.prototype.responseXML = null;
9016  b.prototype.status = 0;
9017  b.prototype.statusText = "";
9018  b.prototype.priority = "NORMAL";
9019  b.prototype.onreadystatechange = null;
9020  b.onreadystatechange = null;
9021  b.onopen = null;
9022  b.onsend = null;
9023  b.onabort = null;
9024  b.prototype.open = function (a, f, k, p, q) {
9025      delete this._headers;
9026      3 > arguments.length && (k = !0);
9027      this._async = k;
9028      var r = this,
9029          s = this.readyState,
9030          t;
9031      h &&
9032          k &&
9033          ((t = function () {
9034              s != b.DONE && (e(r), r.abort());
9035          }),
9036          window.attachEvent("onunload", t));
9037      b.onopen && b.onopen.apply(this, arguments);
9038      4 < arguments.length ? this._object.open(a, f, k, p, q) : 3 < arguments.length ? this._object.open(a, f, k, p) : this._object.open(a, f, k);
9039      this.readyState = b.OPENED;
9040      c(this);
9041      this._object.onreadystatechange = function () {
9042          if (!g || k)
9043              (r.readyState = r._object.readyState),
9044                  d(r),
9045                  r._aborted ? (r.readyState = b.UNSENT) : (r.readyState == b.DONE && (delete r._data, e(r), h && k && window.detachEvent("onunload", t)), s != r.readyState && c(r), (s = r.readyState));
9046      };
9047  };
9048  b.prototype.send = function (a) {
9049      b.onsend && b.onsend.apply(this, arguments);
9050      arguments.length || (a = null);
9051      a && a.nodeType && ((a = window.XMLSerializer ? new window.XMLSerializer().serializeToString(a) : a.xml), this._headers["Content-Type"] || this._object.setRequestHeader("Content-Type", "application/xml"));
9052      this._data = a;
9053      a: if ((this._object.send(this._data), g && !this._async)) for (this.readyState = b.OPENED, d(this); this.readyState < b.DONE; ) if ((this.readyState++, c(this), this._aborted)) break a;
9054  };
9055  b.prototype.abort = function () {
9056      b.onabort && b.onabort.apply(this, arguments);
9057      this.readyState > b.UNSENT && (this._aborted = !0);
9058      this._object.abort();
9059      e(this);
9060      this.readyState = b.UNSENT;
9061      delete this._data;
9062  };
9063  b.prototype.getAllResponseHeaders = function () {
9064      return this._object.getAllResponseHeaders();
9065  };
9066  b.prototype.getResponseHeader = function (a) {
9067      return this._object.getResponseHeader(a);
9068  };
9069  b.prototype.setRequestHeader = function (a, b) {
9070      this._headers || (this._headers = {});
9071      this._headers[a] = b;
9072      return this._object.setRequestHeader(a, b);
9073  };
9074  b.prototype.addEventListener = function (a, b, c) {
9075      for (var d = 0, e; (e = this._listeners[d]); d++) if (e[0] == a && e[1] == b && e[2] == c) return;
9076      this._listeners.push([a, b, c]);
9077  };
9078  b.prototype.removeEventListener = function (a, b, c) {
9079      for (var d = 0, e; (e = this._listeners[d]) && (e[0] != a || e[1] != b || e[2] != c); d++);
9080      e && this._listeners.splice(d, 1);
9081  };
9082  b.prototype.dispatchEvent = function (a) {
9083      a = {
9084          type: a.type,
9085          target: this,
9086          currentTarget: this,
9087          eventPhase: 2,
9088          bubbles: a.bubbles,
9089          cancelable: a.cancelable,
9090          timeStamp: a.timeStamp,
9091          stopPropagation: function () {},
9092          preventDefault: function () {},
9093          initEvent: function () {},
9094      };
9095      "readystatechange" == a.type && this.onreadystatechange && (this.onreadystatechange.handleEvent || this.onreadystatechange).apply(this, [a]);
9096      for (var b = 0, c; (c = this._listeners[b]); b++) c[0] != a.type || c[2] || (c[1].handleEvent || c[1]).apply(this, [a]);
9097  };
9098  b.prototype.toString = function () {
9099      return "[object XMLHttpRequest]";
9100  };
9101  b.toString = function () {
9102      return "[XMLHttpRequest]";
9103  };
9104  window.Function.prototype.apply ||
9105      (window.Function.prototype.apply = function (a, b) {
9106          b || (b = []);
9107          a.__func = this;
9108          a.__func(b[0], b[1], b[2], b[3], b[4]);
9109          delete a.__func;
9110      });
9111  OpenLayers.Request || (OpenLayers.Request = {});
9112  OpenLayers.Request.XMLHttpRequest = b;
9113})();
9114OpenLayers.ProxyHost = "";
9115OpenLayers.Request || (OpenLayers.Request = {});
9116OpenLayers.Util.extend(OpenLayers.Request, {
9117  DEFAULT_CONFIG: {
9118      method: "GET",
9119      url: window.location.href,
9120      async: !0,
9121      user: void 0,
9122      password: void 0,
9123      params: null,
9124      proxy: OpenLayers.ProxyHost,
9125      headers: {},
9126      data: null,
9127      callback: function () {},
9128      success: null,
9129      failure: null,
9130      scope: null,
9131  },
9132  URL_SPLIT_REGEX: /([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,
9133  events: new OpenLayers.Events(this),
9134  makeSameOrigin: function (a, b) {
9135      var c = 0 !== a.indexOf("http"),
9136          d = !c && a.match(this.URL_SPLIT_REGEX);
9137      if (d) {
9138          var e = window.location,
9139              c = d[1] == e.protocol && d[3] == e.hostname,
9140              d = d[4],
9141              e = e.port;
9142          if ((80 != d && "" != d) || ("80" != e && "" != e)) c = c && d == e;
9143      }
9144      c || (b && (a = "function" == typeof b ? b(a) : b + encodeURIComponent(a)));
9145      return a;
9146  },
9147  issue: function (a) {
9148      var b = OpenLayers.Util.extend(this.DEFAULT_CONFIG, { proxy: OpenLayers.ProxyHost });
9149      a = a || {};
9150      a.headers = a.headers || {};
9151      a = OpenLayers.Util.applyDefaults(a, b);
9152      a.headers = OpenLayers.Util.applyDefaults(a.headers, b.headers);
9153      var b = !1,
9154          c;
9155      for (c in a.headers) a.headers.hasOwnProperty(c) && "x-requested-with" === c.toLowerCase() && (b = !0);
9156      !1 === b && (a.headers["X-Requested-With"] = "XMLHttpRequest");
9157      var d = new OpenLayers.Request.XMLHttpRequest(),
9158          e = OpenLayers.Util.urlAppend(a.url, OpenLayers.Util.getParameterString(a.params || {})),
9159          e = OpenLayers.Request.makeSameOrigin(e, a.proxy);
9160      d.open(a.method, e, a.async, a.user, a.password);
9161      for (var f in a.headers) d.setRequestHeader(f, a.headers[f]);
9162      var g = this.events,
9163          h = this;
9164      d.onreadystatechange = function () {
9165          d.readyState == OpenLayers.Request.XMLHttpRequest.DONE && !1 !== g.triggerEvent("complete", { request: d, config: a, requestUrl: e }) && h.runCallbacks({ request: d, config: a, requestUrl: e });
9166      };
9167      !1 === a.async
9168          ? d.send(a.data)
9169          : window.setTimeout(function () {
9170                0 !== d.readyState && d.send(a.data);
9171            }, 0);
9172      return d;
9173  },
9174  runCallbacks: function (a) {
9175      var b = a.request,
9176          c = a.config,
9177          d = c.scope ? OpenLayers.Function.bind(c.callback, c.scope) : c.callback,
9178          e;
9179      c.success && (e = c.scope ? OpenLayers.Function.bind(c.success, c.scope) : c.success);
9180      var f;
9181      c.failure && (f = c.scope ? OpenLayers.Function.bind(c.failure, c.scope) : c.failure);
9182      "file:" == OpenLayers.Util.createUrlObject(c.url).protocol && b.responseText && (b.status = 200);
9183      d(b);
9184      if (!b.status || (200 <= b.status && 300 > b.status)) this.events.triggerEvent("success", a), e && e(b);
9185      b.status && (200 > b.status || 300 <= b.status) && (this.events.triggerEvent("failure", a), f && f(b));
9186  },
9187  GET: function (a) {
9188      a = OpenLayers.Util.extend(a, { method: "GET" });
9189      return OpenLayers.Request.issue(a);
9190  },
9191  POST: function (a) {
9192      a = OpenLayers.Util.extend(a, { method: "POST" });
9193      a.headers = a.headers ? a.headers : {};
9194      "CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers) || (a.headers["Content-Type"] = "application/xml");
9195      return OpenLayers.Request.issue(a);
9196  },
9197  PUT: function (a) {
9198      a = OpenLayers.Util.extend(a, { method: "PUT" });
9199      a.headers = a.headers ? a.headers : {};
9200      "CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers) || (a.headers["Content-Type"] = "application/xml");
9201      return OpenLayers.Request.issue(a);
9202  },
9203  DELETE: function (a) {
9204      a = OpenLayers.Util.extend(a, { method: "DELETE" });
9205      return OpenLayers.Request.issue(a);
9206  },
9207  HEAD: function (a) {
9208      a = OpenLayers.Util.extend(a, { method: "HEAD" });
9209      return OpenLayers.Request.issue(a);
9210  },
9211  OPTIONS: function (a) {
9212      a = OpenLayers.Util.extend(a, { method: "OPTIONS" });
9213      return OpenLayers.Request.issue(a);
9214  },
9215});
9216OpenLayers.Layer.ArcIMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
9217  DEFAULT_PARAMS: { ClientVersion: "9.2", ServiceName: "" },
9218  featureCoordSys: "4326",
9219  filterCoordSys: "4326",
9220  layers: null,
9221  async: !0,
9222  name: "ArcIMS",
9223  isBaseLayer: !0,
9224  DEFAULT_OPTIONS: { tileSize: new OpenLayers.Size(512, 512), featureCoordSys: "4326", filterCoordSys: "4326", layers: null, isBaseLayer: !0, async: !0, name: "ArcIMS" },
9225  initialize: function (a, b, c) {
9226      this.tileSize = new OpenLayers.Size(512, 512);
9227      this.params = OpenLayers.Util.applyDefaults({ ServiceName: c.serviceName }, this.DEFAULT_PARAMS);
9228      this.options = OpenLayers.Util.applyDefaults(c, this.DEFAULT_OPTIONS);
9229      OpenLayers.Layer.Grid.prototype.initialize.apply(this, [a, b, this.params, c]);
9230      this.transparent && (this.isBaseLayer || (this.isBaseLayer = !1), "image/jpeg" == this.format && (this.format = OpenLayers.Util.alphaHack() ? "image/gif" : "image/png"));
9231      null === this.options.layers && (this.options.layers = []);
9232  },
9233  getURL: function (a) {
9234      var b = "";
9235      a = this.adjustBounds(a);
9236      a = new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options, { requesttype: "image", envelope: a.toArray(), tileSize: this.tileSize }));
9237      a = new OpenLayers.Request.POST({ url: this.getFullRequestString(), data: a.write(), async: !1 });
9238      null != a && ((b = a.responseXML), (b && b.documentElement) || (b = a.responseText), (b = new OpenLayers.Format.ArcXML().read(b)), (b = this.getUrlOrImage(b.image.output)));
9239      return b;
9240  },
9241  getURLasync: function (a, b, c) {
9242      a = this.adjustBounds(a);
9243      a = new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options, { requesttype: "image", envelope: a.toArray(), tileSize: this.tileSize }));
9244      OpenLayers.Request.POST({
9245          url: this.getFullRequestString(),
9246          async: !0,
9247          data: a.write(),
9248          callback: function (a) {
9249              var e = a.responseXML;
9250              (e && e.documentElement) || (e = a.responseText);
9251              a = new OpenLayers.Format.ArcXML().read(e);
9252              b.call(c, this.getUrlOrImage(a.image.output));
9253          },
9254          scope: this,
9255      });
9256  },
9257  getUrlOrImage: function (a) {
9258      var b = "";
9259      a.url ? (b = a.url) : a.data && (b = "data:image/" + a.type + ";base64," + a.data);
9260      return b;
9261  },
9262  setLayerQuery: function (a, b) {
9263      for (var c = 0; c < this.options.layers.length; c++)
9264          if (a == this.options.layers[c].id) {
9265              this.options.layers[c].query = b;
9266              return;
9267          }
9268      this.options.layers.push({ id: a, visible: !0, query: b });
9269  },
9270  getFeatureInfo: function (a, b, c) {
9271      var d = c.buffer || 1,
9272          e = c.callback || function () {},
9273          f = c.scope || window,
9274          g = {};
9275      OpenLayers.Util.extend(g, this.options);
9276      g.requesttype = "feature";
9277      a instanceof OpenLayers.LonLat ? ((g.polygon = null), (g.envelope = [a.lon - d, a.lat - d, a.lon + d, a.lat + d])) : a instanceof OpenLayers.Geometry.Polygon && ((g.envelope = null), (g.polygon = a));
9278      var h = new OpenLayers.Format.ArcXML(g);
9279      OpenLayers.Util.extend(h.request.get_feature, c);
9280      h.request.get_feature.layer = b.id;
9281      "number" == typeof b.query.accuracy
9282          ? (h.request.get_feature.query.accuracy = b.query.accuracy)
9283          : ((a = this.map.getCenter()), (c = this.map.getViewPortPxFromLonLat(a)), c.x++, (c = this.map.getLonLatFromPixel(c)), (h.request.get_feature.query.accuracy = c.lon - a.lon));
9284      h.request.get_feature.query.where = b.query.where;
9285      h.request.get_feature.query.spatialfilter.relation = "area_
9285intersection";
9286      OpenLayers.Request.POST({
9287          url: this.getFullRequestString({ CustomService: "Query" }),
9288          data: h.write(),
9289          callback: function (a) {
9290              a = h.parseResponse(a.responseText);
9291              h.iserror() ? e.call(f, null) : e.call(f, a.features);
9292          },
9293      });
9294  },
9295  clone: function (a) {
9296      null == a && (a = new OpenLayers.Layer.ArcIMS(this.name, this.url, this.getOptions()));
9297      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
9298  },
9299  CLASS_NAME: "OpenLayers.Layer.ArcIMS",
9300});
9301OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
9302  slideFactor: 50,
9303  slideRatio: null,
9304  buttons: null,
9305  position: null,
9306  initialize: function (a) {
9307      this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X, OpenLayers.Control.PanZoom.Y);
9308      OpenLayers.Control.prototype.initialize.apply(this, arguments);
9309  },
9310  destroy: function () {
9311      this.map && this.map.events.unregister("buttonclick", this, this.onButtonClick);
9312      this.removeButtons();
9313      this.position = this.buttons = null;
9314      OpenLayers.Control.prototype.destroy.apply(this, arguments);
9315  },
9316  setMap: function (a) {
9317      OpenLayers.Control.prototype.setMap.apply(this, arguments);
9318      this.map.events.register("buttonclick", this, this.onButtonClick);
9319  },
9320  draw: function (a) {
9321      OpenLayers.Control.prototype.draw.apply(this, arguments);
9322      a = this.position;
9323      this.buttons = [];
9324      var b = { w: 18, h: 18 },
9325          c = new OpenLayers.Pixel(a.x + b.w / 2, a.y);
9326      this._addButton("panup", "north-mini.png", c, b);
9327      a.y = c.y + b.h;
9328      this._addButton("panleft", "west-mini.png", a, b);
9329      this._addButton("panright", "east-mini.png", a.add(b.w, 0), b);
9330      this._addButton("pandown", "south-mini.png", c.add(0, 2 * b.h), b);
9331      this._addButton("zoomin", "zoom-plus-mini.png", c.add(0, 3 * b.h + 5), b);
9332      this._addButton("zoomworld", "zoom-world-mini.png", c.add(0, 4 * b.h + 5), b);
9333      this._addButton("zoomout", "zoom-minus-mini.png", c.add(0, 5 * b.h + 5), b);
9334      return this.div;
9335  },
9336  _addButton: function (a, b, c, d) {
9337      b = OpenLayers.Util.getImageLocation(b);
9338      c = OpenLayers.Util.createAlphaImageDiv(this.id + "_" + a, c, d, b, "absolute");
9339      c.style.cursor = "pointer";
9340      this.div.appendChild(c);
9341      c.action = a;
9342      c.className = "olButton";
9343      this.buttons.push(c);
9344      return c;
9345  },
9346  _removeButton: function (a) {
9347      this.div.removeChild(a);
9348      OpenLayers.Util.removeItem(this.buttons, a);
9349  },
9350  removeButtons: function () {
9351      for (var a = this.buttons.length - 1; 0 <= a; --a) this._removeButton(this.buttons[a]);
9352  },
9353  onButtonClick: function (a) {
9354      switch (a.buttonElement.action) {
9355          case "panup":
9356              this.map.pan(0, -this.getSlideFactor("h"));
9357              break;
9358          case "pandown":
9359              this.map.pan(0, this.getSlideFactor("h"));
9360              break;
9361          case "panleft":
9362              this.map.pan(-this.getSlideFactor("w"), 0);
9363              break;
9364          case "panright":
9365              this.map.pan(this.getSlideFactor("w"), 0);
9366              break;
9367          case "zoomin":
9368              this.map.zoomIn();
9369              break;
9370          case "zoomout":
9371              this.map.zoomOut();
9372              break;
9373          case "zoomworld":
9374              this.map.zoomToMaxExtent();
9375      }
9376  },
9377  getSlideFactor: function (a) {
9378      return this.slideRatio ? this.map.getSize()[a] * this.slideRatio : this.slideFactor;
9379  },
9380  CLASS_NAME: "OpenLayers.Control.PanZoom",
9381});
9382OpenLayers.Control.PanZoom.X = 4;
9383OpenLayers.Control.PanZoom.Y = 4;
9384OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
9385  zoomStopWidth: 18,
9386  zoomStopHeight: 11,
9387  slider: null,
9388  sliderEvents: null,
9389  zoombarDiv: null,
9390  zoomWorldIcon: !1,
9391  panIcons: !0,
9392  forceFixedZoomLevel: !1,
9393  mouseDragStart: null,
9394  deltaY: null,
9395  zoomStart: null,
9396  destroy: function () {
9397      this._removeZoomBar();
9398      this.map.events.un({ changebaselayer: this.redraw, updatesize: this.redraw, scope: this });
9399      OpenLayers.Control.PanZoom.prototype.destroy.apply(this, arguments);
9400      delete this.mouseDragStart;
9401      delete this.zoomStart;
9402  },
9403  setMap: function (a) {
9404      OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
9405      this.map.events.on({ changebaselayer: this.redraw, updatesize: this.redraw, scope: this });
9406  },
9407  redraw: function () {
9408      null != this.div && (this.removeButtons(), this._removeZoomBar());
9409      this.draw();
9410  },
9411  draw: function (a) {
9412      OpenLayers.Control.prototype.draw.apply(this, arguments);
9413      a = this.position.clone();
9414      this.buttons = [];
9415      var b = { w: 18, h: 18 };
9416      if (this.panIcons) {
9417          var c = new OpenLayers.Pixel(a.x + b.w / 2, a.y),
9418              d = b.w;
9419          this.zoomWorldIcon && (c = new OpenLayers.Pixel(a.x + b.w, a.y));
9420          this._addButton("panup", "north-mini.png", c, b);
9421          a.y = c.y + b.h;
9422          this._addButton("panleft", "west-mini.png", a, b);
9423          this.zoomWorldIcon && (this._addButton("zoomworld", "zoom-world-mini.png", a.add(b.
9423w, 0), b), (d *= 2));
9424          this._addButton("panright", "east-mini.png", a.add(d, 0), b);
9425          this._addButton("pandown", "south-mini.png", c.add(0, 2 * b.h), b);
9426          this._addButton("zoomin", "zoom-plus-mini.png", c.add(0, 3 * b.h + 5), b);
9427          c = this._addZoomBar(c.add(0, 4 * b.h + 5));
9428          this._addButton("zoomout", "zoom-minus-mini.png", c, b);
9429      } else
9430          this._addButton("zoomin", "zoom-plus-mini.png", a, b),
9431              (c = this._addZoomBar(a.add(0, b.h))),
9432              this._addButton("zoomout", "zoom-minus-mini.png", c, b),
9433              this.zoomWorldIcon && ((c = c.add(0, b.h + 3)), this._addButton("zoomworld", "zoom-world-mini.png", c, b));
9434      return this.div;
9435  },
9436  _addZoomBar: function (a) {
9437      var b = OpenLayers.Util.getImageLocation("slider.png"),
9438          c = this.id + "_" + this.map.id,
9439          d = this.map.getMinZoom(),
9440          e = this.map.getNumZoomLevels() - 1 - this.map.getZoom(),
9441          e = OpenLayers.Util.createAlphaImageDiv(c, a.add(-1, e * this.zoomStopHeight), { w: 20, h: 9 }, b, "absolute");
9442      e.style.cursor = "move";
9443      this.slider = e;
9444      this.sliderEvents = new OpenLayers.Events(this, e, null, !0, { includeXY: !0 });
9445      this.sliderEvents.on({ touchstart: this.zoomBarDown, touchmove: this.zoomBarDrag, touchend: this.zoomBarUp, mousedown: this.zoomBarDown, mousemove: this.zoomBarDrag, mouseup: this.zoomBarUp });
9446      var f = { w: this.zoomStopWidth, h: this.zoomStopHeight * (this.map.getNumZoomLevels() - d) },
9447          b = OpenLayers.Util.getImageLocation("zoombar.png"),
9448          c = null;
9449      OpenLayers.Util.alphaHack()
9450          ? ((c = this.id + "_" + this.map.id), (c = OpenLayers.Util.createAlphaImageDiv(c, a, { w: f.w, h: this.zoomStopHeight }, b, "absolute", null, "crop")), (c.style.height = f.h + "px"))
9451          : (c = OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar" + this.map.id, a, f, b));
9452      c.style.cursor = "pointer";
9453      c.className = "olButton";
9454      this.zoombarDiv = c;
9455      this.div.appendChild(c);
9456      this.startTop = parseInt(c.style.top);
9457      this.div.appendChild(e);
9458      this.map.events.register("zoomend", this, this.moveZoomBar);
9459      return (a = a.add(0, this.zoomStopHeight * (this.map.getNumZoomLevels() - d)));
9460  },
9461  _removeZoomBar: function () {
9462      this.sliderEvents.un({ touchstart: this.zoomBarDown, touchmove: this.zoomBarDrag, touchend: this.zoomBarUp, mousedown: this.zoomBarDown, mousemove: this.zoomBarDrag, mouseup: this.zoomBarUp });
9463      this.sliderEvents.destroy();
9464      this.div.removeChild(this.zoombarDiv);
9465      this.zoombarDiv = null;
9466      this.div.removeChild(this.slider);
9467      this.slider = null;
9468      this.map.events.unregister("zoomend", this, this.moveZoomBar);
9469  },
9470  onButtonClick: function (a) {
9471      OpenLayers.Control.PanZoom.prototype.onButtonClick.apply(this, arguments);
9472      if (a.buttonElement === this.zoombarDiv) {
9473          var b = a.buttonXY.y / this.zoomStopHeight;
9474          if (this.forceFixedZoomLevel || !this.map.fractionalZoom) b = Math.floor(b);
9475          b = this.map.getNumZoomLevels() - 1 - b;
9476          b = Math.min(Math.max(b, 0), this.map.getNumZoomLevels() - 1);
9477          this.map.zoomTo(b);
9478      }
9479  },
9480  passEventToSlider: function (a) {
9481      this.sliderEvents.handleBrowserEvent(a);
9482  },
9483  zoomBarDown: function (a) {
9484      if (OpenLayers.Event.isLeftClick(a) || OpenLayers.Event.isSingleTouch(a))
9485          this.map.events.on({ touchmove: this.passEventToSlider, mousemove: this.passEventToSlider, mouseup: this.passEventToSlider, scope: this }),
9486              (this.mouseDragStart = a.xy.clone()),
9487              (this.zoomStart = a.xy.clone()),
9488              (this.div.style.cursor = "move"),
9489              (this.zoombarDiv.offsets = null),
9490              OpenLayers.Event.stop(a);
9491  },
9492  zoomBarDrag: function (a) {
9493      if (null != this.mouseDragStart) {
9494          var b = this.mouseDragStart.y - a.xy.y,
9495              c = OpenLayers.Util.pagePosition(this.zoombarDiv);
9496          0 < a.clientY - c[1] && a.clientY - c[1] < parseInt(this.zoombarDiv.style.height) - 2 && ((b = parseInt(this.slider.style.top) - b), (this.slider.style.top = b + "px"), (this.mouseDragStart = a.xy.clone()));
9497          this.deltaY = this.zoomStart.y - a.xy.y;
9498          OpenLayers.Event.stop(a);
9499      }
9500  },
9501  zoomBarUp: function (a) {
9502      if ((OpenLayers.Event.isLeftClick(a) || "touchend" === a.type) && this.mouseDragStart) {
9503          this.div.style.cursor = "";
9504          this.map.events.un({ touchmove: this.passEventToSlider, mouseup: this.passEventToSlider, mousemove: this.passEventToSlider, scope: this });
9505          var b = this.map.zoom;
9506          !this.forceFixedZoomLevel && this.map.fractionalZoom
9507              ? ((b += this.deltaY / this.zoomStopHeight), (b = Math.min(Math.max(b, 0), this.map.getNumZoomLevels() - 1)))
9508              : ((b += this.deltaY / this.zoomStopHeight), (b = Math.max(Math.round(b), 0)));
9509          this.map.zoomTo(b);
9510          this.zoomStart = this.mouseDragStart = null;
9511          this.deltaY = 0;
9512          OpenLayers.Event.stop(a);
9513      }
9514  },
9515  moveZoomBar: function () {
9516      var a = (this.map.getNumZoomLevels() - 1 - this.map.getZoom()) * this.zoomStopHeight + this.startTop + 1;
9517      this.slider.style.top = a + "px";
9518  },
9519  CLASS_NAME: "OpenLayers.Control.PanZoomBar",
9520});
9521OpenLayers.Format.WFSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { defaultVersion: "1.1.0", CLASS_NAME: "OpenLayers.Format.WFSCapabilities" });
9522OpenLayers.Format.WFSCapabilities.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
9523  namespaces: { wfs: "http://www.opengis.net/wfs", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance", ows: "http://www.opengis.net/ows" },
9524  errorProperty: "featureTypeList",
9525  defaultPrefix: "wfs",
9526  read: function (a) {
9527      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
9528      a && 9 == a.nodeType && (a = a.documentElement);
9529      var b = {};
9530      this.readNode(a, b);
9531      return b;
9532  },
9533  readers: {
9534      wfs: {
9535          WFS_Capabilities: function (a, b) {
9536              this.readChildNodes(a, b);
9537          },
9538          FeatureTypeList: function (a, b) {
9539              b.featureTypeList = { featureTypes: [] };
9540              this.readChildNodes(a, b.featureTypeList);
9541          },
9542          FeatureType: function (a, b) {
9543              var c = {};
9544              this.readChildNodes(a, c);
9545              b.featureTypes.push(c);
9546          },
9547          Name: function (a, b) {
9548              var c = this.getChildValue(a);
9549              c && ((c = c.split(":")), (b.name = c.pop()), 0 < c.length && (b.featureNS = this.lookupNamespaceURI(a, c[0])));
9550          },
9551          Title: function (a, b) {
9552              var c = this.getChildValue(a);
9553              c && (b.title = c);
9554          },
9555          Abstract: function (a, b) {
9556              var c = this.getChildValue(a);
9557              c && (b["abstract"] = c);
9558          },
9559      },
9560  },
9561  CLASS_NAME: "OpenLayers.Format.WFSCapabilities.v1",
9562});
9563OpenLayers.Format.WFSCapabilities.v1_1_0 = OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1, {
9564  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
9565  readers: {
9566      wfs: OpenLayers.Util.applyDefaults(
9567          {
9568              DefaultSRS: function (a, b) {
9569                  var c = this.getChildValue(a);
9570                  c && (b.srs = c);
9571              },
9572          },
9573          OpenLayers.Format.WFSCapabilities.v1.prototype.readers.wfs
9574      ),
9575      ows: OpenLayers.Format.OWSCommon.v1.prototype.readers.ows,
9576  },
9577  CLASS_NAME: "OpenLayers.Format.WFSCapabilities.v1_1_0",
9578});
9579OpenLayers.Layer.Image = OpenLayers.Class(OpenLayers.Layer, {
9580  isBaseLayer: !0,
9581  url: null,
9582  extent: null,
9583  size: null,
9584  tile: null,
9585  aspectRatio: null,
9586  initialize: function (a, b, c, d, e) {
9587      this.url = b;
9588      this.maxExtent = this.extent = c;
9589      this.size = d;
9590      OpenLayers.Layer.prototype.initialize.apply(this, [a, e]);
9591      this.aspectRatio = this.extent.getHeight() / this.size.h / (this.extent.getWidth() / this.size.w);
9592  },
9593  destroy: function () {
9594      this.tile && (this.removeTileMonitoringHooks(this.tile), this.tile.destroy(), (this.tile = null));
9595      OpenLayers.Layer.prototype.destroy.apply(this, arguments);
9596  },
9597  clone: function (a) {
9598      null == a && (a = new OpenLayers.Layer.Image(this.name, this.url, this.extent, this.size, this.getOptions()));
9599      return (a = OpenLayers.Layer.prototype.clone.apply(this, [a]));
9600  },
9601  setMap: function (a) {
9602      null == this.options.maxResolution && (this.options.maxResolution = (this.aspectRatio * this.extent.getWidth()) / this.size.w);
9603      OpenLayers.Layer.prototype.setMap.apply(this, arguments);
9604  },
9605  moveTo: function (a, b, c) {
9606      OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
9607      var d = null == this.tile;
9608      if (b || d) {
9609          this.setTileSize();
9610          var e = this.map.getLayerPxFromLonLat({ lon: this.extent.left, lat: this.extent.top });
9611          d ? ((this.tile = new OpenLayers.Tile.Image(this, e, this.extent, null, this.tileSize)), this.addTileMonitoringHooks(this.tile)) : ((this.tile.size = this.tileSize.clone()), (this.tile.position = e.clone()));
9612          this.tile.draw();
9613      }
9614  },
9615  setTileSize: function () {
9616      var a = this.extent.getWidth() / this.map.getResolution(),
9617          b = this.extent.getHeight() / this.map.getResolution();
9618      this.tileSize = new OpenLayers.Size(a, b);
9619  },
9620  addTileMonitoringHooks: function (a) {
9621      a.onLoadStart = function () {
9622          this.events.triggerEvent("loadstart");
9623      };
9624      a.events.register("loadstart", this, a.onLoadStart);
9625      a.onLoadEnd = function () {
9626          this.events.triggerEvent("loadend");
9627      };
9628      a.events.register("loadend", this, a.onLoadEnd);
9629      a.events.register("unload", this, a.onLoadEnd);
9630  },
9631  removeTileMonitoringHooks: function (a) {
9632      a.unload();
9633      a.events.un({ loadstart: a.onLoadStart, loadend: a.onLoadEnd, unload: a.onLoadEnd, scope: this });
9634  },
9635  setUrl: function (a) {
9636      this.url = a;
9637      this.tile.draw();
9638  },
9639  getURL: function (a) {
9640      return this.url;
9641  },
9642  CLASS_NAME: "OpenLayers.Layer.Image",
9643});
9644OpenLayers.Strategy = OpenLayers.Class({
9645  layer: null,
9646  options: null,
9647  active: null,
9648  autoActivate: !0,
9649  autoDestroy: !0,
9650  initialize: function (a) {
9651      OpenLayers.Util.extend(this, a);
9652      this.options = a;
9653      this.active = !1;
9654  },
9655  destroy: function () {
9656      this.deactivate();
9657      this.options = this.layer = null;
9658  },
9659  setLayer: function (a) {
9660      this.layer = a;
9661  },
9662  activate: function () {
9663      return this.active ? !1 : (this.active = !0);
9664  },
9665  deactivate: function () {
9666      return this.active ? ((this.active = !1), !0) : !1;
9667  },
9668  CLASS_NAME: "OpenLayers.Strategy",
9669});
9670OpenLayers.Strategy.Save = OpenLayers.Class(OpenLayers.Strategy, {
9671  events: null,
9672  auto: !1,
9673  timer: null,
9674  initialize: function (a) {
9675      OpenLayers.Strategy.prototype.initialize.apply(this, [a]);
9676      this.events = new OpenLayers.Events(this);
9677  },
9678  activate: function () {
9679      var a = OpenLayers.Strategy.prototype.activate.call(this);
9680      if (a && this.auto)
9681          if ("number" === typeof this.auto) this.timer = window.setInterval(OpenLayers.Function.bind(this.save, this), 1e3 * this.auto);
9682          else this.layer.events.on({ featureadded: this.triggerSave, afterfeaturemodified: this.triggerSave, scope: this });
9683      return a;
9684  },
9685  deactivate: function () {
9686      var a = OpenLayers.Strategy.prototype.deactivate.call(this);
9687      a && this.auto && ("number" === typeof this.auto ? window.clearInterval(this.timer) : this.layer.events.un({ featureadded: this.triggerSave, afterfeaturemodified: this.triggerSave, scope: this }));
9688      return a;
9689  },
9690  triggerSave: function (a) {
9691      var b = a.feature;
9692      (b.state !== OpenLayers.State.INSERT && b.state !== OpenLayers.State.UPDATE && b.state !== OpenLayers.State.DELETE) || this.save([a.feature]);
9693  },
9694  save: function (a) {
9695      a || (a = this.layer.features);
9696      this.events.triggerEvent("start", { features: a });
9697      var b = this.layer.projection,
9698          c = this.layer.map.getProjectionObject();
9699      if (!c.equals(b)) {
9700          for (var d = a.length, e = Array(d), f, g, h = 0; h < d; ++h) (f = a[h]), (g = f.clone()), (g.fid = f.fid), (g.state = f.state), f.url && (g.url = f.url), (g._original = f), g.geometry.transform(c, b), (e[h] = g);
9701          a = e;
9702      }
9703      this.layer.protocol.commit(a, { callback: this.onCommit, scope: this });
9704  },
9705  onCommit: function (a) {
9706      var b = { response: a };
9707      if (a.success()) {
9708          for (var c = a.reqFeatures, d, e = [], f = a.insertIds || [], g = 0, h = 0, k = c.length; h < k; ++h)
9709              if (((d = c[h]), (d = d._original || d), (a = d.state))) a == OpenLayers.State.DELETE ? e.push(d) : a == OpenLayers.State.INSERT && ((d.fid = f[g]), 
9709++g), (d.state = null);
9710          0 < e.length && this.layer.destroyFeatures(e);
9711          this.events.triggerEvent("success", b);
9712      } else this.events.triggerEvent("fail", b);
9713  },
9714  CLASS_NAME: "OpenLayers.Strategy.Save",
9715});
9716OpenLayers.Events.featureclick = OpenLayers.Class({
9717  cache: null,
9718  map: null,
9719  provides: ["featureclick", "nofeatureclick", "featureover", "featureout"],
9720  initialize: function (a) {
9721      this.target = a;
9722      if (a.object instanceof OpenLayers.Map) this.setMap(a.object);
9723      else if (a.object instanceof OpenLayers.Layer.Vector)
9724          a.object.map
9725              ? this.setMap(a.object.map)
9726              : a.object.events.register("added", this, function (b) {
9727                    this.setMap(a.object.map);
9728                });
9729      else throw "Listeners for '" + this.provides.join("', '") + "' events can only be registered for OpenLayers.Layer.Vector or OpenLayers.Map instances";
9730      for (var b = this.provides.length - 1; 0 <= b; --b) a.extensions[this.provides[b]] = !0;
9731  },
9732  setMap: function (a) {
9733      this.map = a;
9734      this.cache = {};
9735      a.events.register("mousedown", this, this.start, { extension: !0 });
9736      a.events.register("mouseup", this, this.onClick, { extension: !0 });
9737      a.events.register("touchstart", this, this.start, { extension: !0 });
9738      a.events.register("touchmove", this, this.cancel, { extension: !0 });
9739      a.events.register("touchend", this, this.onClick, { extension: !0 });
9740      a.events.register("mousemove", this, this.onMousemove, { extension: !0 });
9741  },
9742  start: function (a) {
9743      this.startEvt = a;
9744  },
9745  cancel: function (a) {
9746      delete this.startEvt;
9747  },
9748  onClick: function (a) {
9749      if (this.startEvt && ("touchend" === a.type || OpenLayers.Event.isLeftClick(a))) {
9750          a = this.getFeatures(this.startEvt);
9751          delete this.startEvt;
9752          for (var b, c, d = {}, e = 0, f = a.length; e < f && ((b = a[e]), (c = b.layer), (d[c.id] = !0), (b = this.triggerEvent("featureclick", { feature: b })), !1 !== b); ++e);
9753          e = 0;
9754          for (f = this.map.layers.length; e < f; ++e) (c = this.map.layers[e]), c instanceof OpenLayers.Layer.Vector && !d[c.id] && this.triggerEvent("nofeatureclick", { layer: c });
9755      }
9756  },
9757  onMousemove: function (a) {
9758      delete this.startEvt;
9759      var b = this.getFeatures(a),
9760          c = {};
9761      a = [];
9762      for (var d, e = 0, f = b.length; e < f; ++e) (d = b[e]), (c[d.id] = d), this.cache[d.id] || a.push(d);
9763      var b = [],
9764          g;
9765      for (g in this.cache) (d = this.cache[g]), d.layer && d.layer.map ? c[d.id] || b.push(d) : delete this.cache[g];
9766      e = 0;
9767      for (f = a.length; e < f && ((d = a[e]), (this.cache[d.id] = d), (g = this.triggerEvent("featureover", { feature: d })), !1 !== g); ++e);
9768      e = 0;
9769      for (f = b.length; e < f && ((d = b[e]), delete this.cache[d.id], (g = this.triggerEvent("featureout", { feature: d })), !1 !== g); ++e);
9770  },
9771  triggerEvent: function (a, b) {
9772      var c = b.feature ? b.feature.layer : b.layer,
9773          d = this.target.object;
9774      if (d instanceof OpenLayers.Map || d === c) return this.target.triggerEvent(a, b);
9775  },
9776  getFeatures: function (a) {
9777      var b = a.clientX,
9778          c = a.clientY,
9779          d = [],
9780          e = [],
9781          f = [],
9782          g,
9783          h,
9784          k,
9785          l;
9786      for (l = this.map.layers.length - 1; 0 <= l; --l)
9787          if (((g = this.map.layers[l]), "none" !== g.div.style.display))
9788              if (g.renderer instanceof OpenLayers.Renderer.Elements) {
9789                  if (g instanceof OpenLayers.Layer.Vector)
9790                      for (h = document.elementFromPoint(b, c); h && h._featureId; ) (k = g.getFeatureById(h._featureId)) ? (d.push(k), (h.style.display = "none"), e.push(h), (h = document.elementFromPoint(b, c))) : (h = !1);
9791                  f.push(g);
9792                  g.div.style.display = "none";
9793              } else g.renderer instanceof OpenLayers.Renderer.Canvas && (k = g.renderer.getFeatureIdFromEvent(a)) && (d.push(k), f.push(g));
9794      l = 0;
9795      for (a = e.length; l < a; ++l) e[l].style.display = "";
9796      for (l = f.length - 1; 0 <= l; --l) f[l].div.style.display = "block";
9797      return d;
9798  },
9799  destroy: function () {
9800      for (var a = this.provides.length - 1; 0 <= a; --a) delete this.target.extensions[this.provides[a]];
9801      this.map.events.un({ mousemove: this.onMousemove, mousedown: this.start, mouseup: this.onClick, touchstart: this.start, touchmove: this.cancel, touchend: this.onClick, scope: this });
9802      delete this.cache;
9803      delete this.map;
9804      delete this.target;
9805  },
9806});
9807OpenLayers.Events.nofeatureclick = OpenLayers.Events.featureclick;
9808OpenLayers.Events.featureover = OpenLayers.Events.featureclick;
9809OpenLayers.Events.featureout = OpenLayers.Events.featureclick;
9810OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, {
9811  defaultDesc: "No description available",
9812  extractWaypoints: !0,
9813  extractTracks: !0,
9814  extractRoutes: !0,
9815  extractAttributes: !0,
9816  namespaces: { gpx: "http://www.topografix.com/GPX/1/1", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
9817  schemaLocation: "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",
9818  creator: "OpenLayers",
9819  initialize: function (a) {
9820      this.externalProjection = new OpenLayers.Projection("EPSG:4326");
9821      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
9822  },
9823  read: function (a) {
9824      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
9825      var b = [];
9826      if (this.extractTracks)
9827          for (var c = a.getElementsByTagName("trk"), d = 0, e = c.length; d < e; d++) {
9828              var f = {};
9829              this.extractAttributes && (f = this.parseAttributes(c[d]));
9830              for (var g = this.getElementsByTagNameNS(c[d], c[d].namespaceURI, "trkseg"), h = 0, k = g.length; h < k; h++) {
9831                  var l = this.extractSegment(g[h], "trkpt");
9832                  b.push(new OpenLayers.Feature.Vector(l, f));
9833              }
9834          }
9835      if (this.extractRoutes)
9836          for (e = a.getElementsByTagName("rte"), c = 0, d = e.length; c < d; c++)
9837              (f = {}), this.extractAttributes && (f = this.parseAttributes(e[c])), (g = this.extractSegment(e[c], "rtept")), b.push(new OpenLayers.Feature.Vector(g, f));
9838      if (this.extractWaypoints)
9839          for (a = a.getElementsByTagName("wpt"), c = 0, e = a.length; c < e; c++)
9840              (f = {}), this.extractAttributes && (f = this.parseAttributes(a[c])), (d = new OpenLayers.Geometry.Point(a[c].getAttribute("lon"), a[c].getAttribute("lat"))), b.push(new OpenLayers.Feature.Vector(d, f));
9841      if (this.internalProjection && this.externalProjection) for (f = 0, a = b.length; f < a; f++) b[f].geometry.transform(this.externalProjection, this.internalProjection);
9842      return b;
9843  },
9844  extractSegment: function (a, b) {
9845      for (var c = this.getElementsByTagNameNS(a, a.namespaceURI, b), d = [], e = 0, f = c.length; e < f; e++) d.push(new OpenLayers.Geometry.Point(c[e].getAttribute("lon"), c[e].getAttribute("lat")));
9846      return new OpenLayers.Geometry.LineString(d);
9847  },
9848  parseAttributes: function (a) {
9849      var b = {};
9850      a = a.firstChild;
9851      for (var c, d; a; )
9852          1 == a.nodeType && a.firstChild && ((c = a.firstChild), 3 == c.nodeType || 4 == c.nodeType) && ((d = a.prefix ? a.nodeName.split(":")[1] : a.nodeName), "trkseg" != d && "rtept" != d && (b[d] = c.nodeValue)), (a = a.nextSibling);
9853      return b;
9854  },
9855  write: function (a, b) {
9856      a = OpenLayers.Util.isArray(a) ? a : [a];
9857      var c = this.createElementNS(this.namespaces.gpx, "gpx");
9858      c.setAttribute("version", "1.1");
9859      c.setAttribute("creator", this.creator);
9860      this.setAttributes(c, { "xsi:schemaLocation": this.schemaLocation });
9861      b && "object" == typeof b && c.appendChild(this.buildMetadataNode(b));
9862      for (var d = 0, e = a.length; d < e; d++) c.appendChild(this.buildFeatureNode(a[d]));
9863      return OpenLayers.Format.XML.prototype.write.apply(this, [c]);
9864  },
9865  buildMetadataNode: function (a) {
9866      for (var b = ["name", "desc", "author"], c = this.createElementNS(this.namespaces.gpx, "metadata"), d = 0; d < b.length; d++) {
9867          var e = b[d];
9868          if (a[e]) {
9869              var f = this.createElementNS(this.namespaces.gpx, e);
9870              f.appendChild(this.createTextNode(a[e]));
9871              c.appendChild(f);
9872          }
9873      }
9874      return c;
9875  },
9876  buildFeatureNode: function (a) {
9877      var b = a.geometry,
9878          b = b.clone();
9879      this.internalProjection && this.externalProjection && b.transform(this.internalProjection, this.externalProjection);
9880      if ("OpenLayers.Geometry.Point" == b.CLASS_NAME) {
9881          var c = this.buildWptNode(b);
9882          this.appendAttributesNode(c, a);
9883          return c;
9884      }
9885      c = this.createElementNS(this.namespaces.gpx, "trk");
9886      this.appendAttributesNode(c, a);
9887      a = this.buildTrkSegNode(b);
9888      a = OpenLayers.Util.isArray(a) ? a : [a];
9889      for (var b = 0, d = a.length; b < d; b++) c.appendChild(a[b]);
9890      return c;
9891  },
9892  buildTrkSegNode: function (a) {
9893      var b, c, d, e;
9894      if ("OpenLayers.Geometry.LineString" == a.CLASS_NAME || "OpenLayers.Geometry.LinearRing" == a.CLASS_NAME) {
9895          b = this.createElementNS(this.namespaces.gpx, "trkseg");
9896          c = 0;
9897          for (d = a.components.length; c < d; c++) (e = a.components[c]), b.appendChild(this.buildTrkPtNode(e));
9898          return b;
9899      }
9900      b = [];
9901      c = 0;
9902      for (d = a.components.length; c < d; c++) b.push(this.buildTrkSegNode(a.components[c]));
9903      return b;
9904  },
9905  buildTrkPtNode: function (a) {
9906      var b = this.createElementNS(this.namespaces.gpx, "trkpt");
9907      b.setAttribute("lon", a.x);
9908      b.setAttribute("lat", a.y);
9909      return b;
9910  },
9911  buildWptNode: function (a) {
9912      var b = this.createElementNS(this.namespaces.gpx, "wpt");
9913      b.setAttribute("lon", a.x);
9914      b.setAttribute("lat", a.y);
9915      return b;
9916  },
9917  appendAttributesNode: function (a, b) {
9918      var c = this.createElementNS(this.namespaces.gpx, "name");
9919      c.appendChild(this.createTextNode(b.attributes.name || b.id));
9920      a.appendChild(c);
9921      c = this.createElementNS(this.namespaces.gpx, "desc");
9922      c.appendChild(this.createTextNode(b.attributes.description || this.defaultDesc));
9923      a.appendChild(c);
9924  },
9925  CLASS_NAME: "OpenLayers.Format.GPX",
9926});
9927OpenLayers.Format.WMSDescribeLayer = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { defaultVersion: "1.1.1", CLASS_NAME: "OpenLayers.Format.WMSDescribeLayer" });
9928OpenLayers.Format.WMSDescribeLayer.v1_1_1 = OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer, {
9929  initialize: function (a) {
9930      OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this, [a]);
9931  },
9932  read: function (a) {
9933      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
9934      for (var b = a.documentElement.childNodes, c = { layerDescriptions: [] }, d, e, f = 0; f < b.length; ++f)
9935          if (((d = b[f]), (e = d.nodeName), "LayerDescription" == e)) {
9936              e = d.getAttribute("name");
9937              var g = "",
9938                  h = "",
9939                  k = "";
9940              d.getAttribute("owsType")
9941                  ? ((g = d.getAttribute("owsType")), (h = d.getAttribute("owsURL")))
9942                  : "" != d.getAttribute("wfs")
9943                  ? ((g = "WFS"), (h = d.getAttribute("wfs")))
9944                  : "" != d.getAttribute("wcs") && ((g = "WCS"), (h = d.getAttribute("wcs")));
9945              d = d.getElementsByTagName("Query");
9946              0 < d.length && ((k = d[0].getAttribute("typeName")) || (k = d[0].getAttribute("typename")));
9947              d = { layerName: e, owsType: g, owsURL: h, typeName: k };
9948              c.layerDescriptions.push(d);
9949              c.length = c.layerDescriptions.length;
9950              c[c.length - 1] = d;
9951          } else if ("ServiceException" == e) return { error: new OpenLayers.Format.OGCExceptionReport().read(a) };
9952      return c;
9953  },
9954  CLASS_NAME: "OpenLayers.Format.WMSDescribeLayer.v1_1_1",
9955});
9956OpenLayers.Format.WMSDescribeLayer.v1_1_0 = OpenLayers.Format.WMSDescribeLayer.v1_1_1;
9957OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
9958  isBaseLayer: !0,
9959  sphericalMercator: !1,
9960  zoomOffset: 0,
9961  serverResolutions: null,
9962  initialize: function (a, b, c) {
9963      if ((c && c.sphericalMercator) || this.sphericalMercator) c = OpenLayers.Util.extend({ projection: "EPSG:900913", numZoomLevels: 19 }, c);
9964      OpenLayers.Layer.Grid.prototype.initialize.apply(this, [a || this.name, b || this.url, {}, c]);
9965  },
9966  clone: function (a) {
9967      null == a && (a = new OpenLayers.Layer.XYZ(this.name, this.url, this.getOptions()));
9968      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
9969  },
9970  getURL: function (a) {
9971      a = this.getXYZ(a);
9972      var b = this.url;
9973      OpenLayers.Util.isArray(b) && (b = this.selectUrl("" + a.x + a.y + a.z, b));
9974      return OpenLayers.String.format(b, a);
9975  },
9976  getXYZ: function (a) {
9977      var b = this.getServerResolution(),
9978          c = Math.round((a.left - this.maxExtent.left) / (b * this.tileSize.w));
9979      a = Math.round((this.maxExtent.top - a.top) / (b * this.tileSize.h));
9980      b = this.getServerZoom();
9981      if (this.wrapDateLine)
9982          var d = Math.pow(2, b),
9983              c = ((c % d) + d) % d;
9984      return { x: c, y: a, z: b };
9985  },
9986  setMap: function (a) {
9987      OpenLayers.Layer.Grid.prototype.setMap.apply(this, arguments);
9988      this.tileOrigin || (this.tileOrigin = new OpenLayers.LonLat(this.maxExtent.left, this.maxExtent.bottom));
9989  },
9990  CLASS_NAME: "OpenLayers.Layer.XYZ",
9991});
9992OpenLayers.Layer.OSM = OpenLayers.Class(OpenLayers.Layer.XYZ, {
9993  name: "OpenStreetMap",
9994  url: ["http://a.tile.openstreetmap.org/${z}/${x}/${y}.png", "http://b.tile.openstreetmap.org/${z}/${x}/${y}.png", "http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"],
9995  attribution: "&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",
9996  sphericalMercator: !0,
9997  wrapDateLine: !0,
9998  tileOptions: null,
9999  initialize: function (a, b, c) {
10000      OpenLayers.Layer.XYZ.prototype.initialize.apply(this, arguments);
10001      this.tileOptions = OpenLayers.Util.extend({ crossOriginKeyword: "anonymous" }, this.options && this.options.tileOptions);
10002  },
10003  clone: function (a) {
10004      null == a && (a = new OpenLayers.Layer.OSM(this.name, this.url, this.getOptions()));
10005      return (a = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [a]));
10006  },
10007  CLASS_NAME: "OpenLayers.Layer.OSM",
10008});
10009OpenLayers.Renderer = OpenLayers.Class({
10010  container: null,
10011  root: null,
10012  extent: null,
10013  locked: !1,
10014  size: null,
10015  resolution: null,
10016  map: null,
10017  featureDx: 0,
10018  initialize: function (a, b) {
10019      this.container = OpenLayers.Util.getElement(a);
10020      OpenLayers.Util.extend(this, b);
10021  },
10022  destroy: function () {
10023      this.map = this.resolution = this.size = this.extent = this.container = null;
10024  },
10025  supported: function () {
10026      return !1;
10027  },
10028  setExtent: function (a, b) {
10029      this.extent = a.clone();
10030      if (this.map.baseLayer && this.map.baseLayer.wrapDateLine) {
10031          var c = a.getWidth() / this.map.getExtent().getWidth();
10032          a = a.scale(1 / c);
10033          this.extent = a.wrapDateLine(this.map.getMaxExtent()).scale(c);
10034      }
10035      b && (this.resolution = null);
10036      return !0;
10037  },
10038  setSize: function (a) {
10039      this.size = a.clone();
10040      this.resolution = null;
10041  },
10042  getResolution: function () {
10043      return (this.resolution = this.resolution || this.map.getResolution());
10044  },
10045  drawFeature: function (a, b) {
10046      null == b && (b = a.style);
10047      if (a.geometry) {
10048          var c = a.geometry.getBounds();
10049          if (c) {
10050              var d;
10051              this.map.baseLayer && this.map.baseLayer.wrapDateLine && (d = this.map.getMaxExtent());
10052              c.intersectsBounds(this.extent, { worldBounds: d }) ? this.calculateFeatureDx(c, d) : (b = { display: "none" });
10053              c = this.drawGeometry(a.geometry, b, a.id);
10054              if ("none" != b.display && b.label && !1 !== c) {
10055                  d = a.geometry.getCentroid();
10056                  if (b.labelXOffset || b.labelYOffset) {
10057                      var e = isNaN(b.labelXOffset) ? 0 : b.labelXOffset,
10058                          f = isNaN(b.labelYOffset) ? 0 : b.labelYOffset,
10059                          g = this.getResolution();
10060                      d.move(e * g, f * g);
10061                  }
10062                  this.drawText(a.id, b, d);
10063              } else this.removeText(a.id);
10064              return c;
10065          }
10066      }
10067  },
10068  calculateFeatureDx: function (a, b) {
10069      this.featureDx = 0;
10070      if (b) {
10071          var c = b.getWidth();
10072          this.featureDx = Math.round(((a.left + a.right) / 2 - (this.extent.left + this.extent.right) / 2) / c) * c;
10073      }
10074  },
10075  drawGeometry: function (a, b, c) {},
10076  drawText: function (a, b, c) {},
10077  removeText: function (a) {},
10078  clear: function () {},
10079  getFeatureIdFromEvent: function (a) {},
10080  eraseFeatures: function (a) {
10081      OpenLayers.Util.isArray(a) || (a = [a]);
10082      for (var b = 0, c = a.length; b < c; ++b) {
10083          var d = a[b];
10084          this.eraseGeometry(d.geometry, d.id);
10085          this.removeText(d.id);
10086      }
10087  },
10088  eraseGeometry: function (a, b) {},
10089  moveRoot: function (a) {},
10090  getRenderLayerId: function () {
10091      return this.container.id;
10092  },
10093  applyDefaultSymbolizer: function (a) {
10094      var b = OpenLayers.Util.extend({}, OpenLayers.Renderer.defaultSymbolizer);
10095      !1 === a.stroke && (delete b.strokeWidth, delete b.strokeColor);
10096      !1 === a.fill && delete b.fillColor;
10097      OpenLayers.Util.extend(b, a);
10098      return b;
10099  },
10100  CLASS_NAME: "OpenLayers.Renderer",
10101});
10102OpenLayers.Renderer.defaultSymbolizer = { fillColor: "#000000", strokeColor: "#000000", strokeWidth: 2, fillOpacity: 1, strokeOpacity: 1, pointRadius: 0, labelAlign: "cm" };
10103OpenLayers.Renderer.symbol = {
10104  star: [350, 75, 379, 161, 469, 161, 397, 215, 423, 301, 350, 250, 277, 301, 303, 215, 231, 161, 321, 161, 350, 75],
10105  cross: [4, 0, 6, 0, 6, 4, 10, 4, 10, 6, 6, 6, 6, 10, 4, 10, 4, 6, 0, 6, 0, 4, 4, 4, 4, 0],
10106  x: [0, 0, 25, 0, 50, 35, 75, 0, 100, 0, 65, 50, 100, 100, 75, 100, 50, 65, 25, 100, 0, 100, 35, 50, 0, 0],
10107  square: [0, 0, 0, 1, 1, 1, 1, 0, 0, 0],
10108  triangle: [0, 10, 10, 10, 5, 0, 0, 10],
10109};
10110OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
10111  hitDetection: !0,
10112  hitOverflow: 0,
10113  canvas: null,
10114  features: null,
10115  pendingRedraw: !1,
10116  cachedSymbolBounds: {},
10117  initialize: function (a, b) {
10118      OpenLayers.Renderer.prototype.initialize.apply(this, arguments);
10119      this.root = document.createElement("canvas");
10120      this.container.appendChild(this.root);
10121      this.canvas = this.root.getContext("2d");
10122      this.features = {};
10123      this.hitDetection && ((this.hitCanvas = document.createElement("canvas")), (this.hitContext = this.hitCanvas.getContext("2d")));
10124  },
10125  setExtent: function () {
10126      OpenLayers.Renderer.prototype.setExtent.apply(this, arguments);
10127      return !1;
10128  },
10129  eraseGeometry: function (a, b) {
10130      this.eraseFeatures(this.features[b][0]);
10131  },
10132  supported: function () {
10133      return OpenLayers.CANVAS_SUPPORTED;
10134  },
10135  setSize: function (a) {
10136      this.size = a.clone();
10137      var b = this.root;
10138      b.style.width = a.w + "px";
10139      b.style.height = a.h + "px";
10140      b.width = a.w;
10141      b.height = a.h;
10142      this.resolution = null;
10143      this.hitDetection && ((b = this.hitCanvas), (b.style.width = a.w + "px"), (b.style.height = a.h + "px"), (b.width = a.w), (b.height = a.h));
10144  },
10145  drawFeature: function (a, b) {
10146      var c;
10147      if (a.geometry) {
10148          b = this.applyDefaultSymbolizer(b || a.style);
10149          c = a.geometry.getBounds();
10150          var d;
10151          this.map.baseLayer && this.map.baseLayer.wrapDateLine && (d = this.map.getMaxExtent());
10152          d = c && c.intersectsBounds(this.extent, { worldBounds: d });
10153          (c = "none" !== b.display && !!c && d) ? (this.features[a.id] = [a, b]) : delete this.features[a.id];
10154          this.pendingRedraw = !0;
10155      }
10156      this.pendingRedraw && !this.locked && (this.redraw(), (this.pendingRedraw = !1));
10157      return c;
10158  },
10159  drawGeometry: function (a, b, c) {
10160      var d = a.CLASS_NAME;
10161      if ("OpenLayers.Geometry.Collection" == d || "OpenLayers.Geometry.MultiPoint" == d || "OpenLayers.Geometry.MultiLineString" == d || "OpenLayers.Geometry.MultiPolygon" == d)
10162          for (d = 0; d < a.components.length; d++) this.drawGeometry(a.components[d], b, c);
10163      else
10164          switch (a.CLASS_NAME) {
10165              case "OpenLayers.Geometry.Point":
10166                  this.drawPoint(a, b, c);
10167                  break;
10168              case "OpenLayers.Geometry.LineString":
10169                  this.drawLineString(a, b, c);
10170                  break;
10171              case "OpenLayers.Geometry.LinearRing":
10172                  this.drawLinearRing(a, b, c);
10173                  break;
10174              case "OpenLayers.Geometry.Polygon":
10175                  this.drawPolygon(a, b, c);
10176          }
10177  },
10178  drawExternalGraphic: function (a, b, c) {
10179      var d = new Image(),
10180          e = b.title || b.graphicTitle;
10181      e && (d.title = e);
10182      var f = b.graphicWidth || b.graphicHeight,
10183          g = b.graphicHeight || b.graphicWidth,
10184          f = f ? f : 2 * b.pointRadius,
10185          g = g ? g : 2 * b.pointRadius,
10186          h = void 0 != b.graphicXOffset ? b.graphicXOffset : -(0.5 * f),
10187          k = void 0 != b.graphicYOffset ? b.graphicYOffset : -(0.5 * g),
10188          l = b.graphicOpacity || b.fillOpacity;
10189      d.onload = OpenLayers.Function.bind(function () {
10190          if (this.features[c]) {
10191              var b = this.getLocalXY(a),
10192                  e = b[0],
10193                  b = b[1];
10194              if (!isNaN(e) && !isNaN(b)) {
10195                  var e = (e + h) | 0,
10196                      b = (b + k) | 0,
10197                      p = this.canvas;
10198                  p.globalAlpha = l;
10199                  var q = OpenLayers.Renderer.Canvas.drawImageScaleFactor || (Ope
10199nLayers.Renderer.Canvas.drawImageScaleFactor = /android 2.1/.test(navigator.userAgent.toLowerCase()) ? 320 / window.screen.width : 1);
10200                  p.drawImage(d, e * q, b * q, f * q, g * q);
10201                  this.hitDetection && (this.setHitContextStyle("fill", c), this.hitContext.fillRect(e, b, f, g));
10202              }
10203          }
10204      }, this);
10205      d.src = b.externalGraphic;
10206  },
10207  drawNamedSymbol: function (a, b, c) {
10208      var d, e, f, g;
10209      f = Math.PI / 180;
10210      var h = OpenLayers.Renderer.symbol[b.graphicName];
10211      if (!h) throw Error(b.graphicName + " is not a valid symbol name");
10212      if (!(!h.length || 2 > h.length || ((a = this.getLocalXY(a)), (e = a[0]), (g = a[1]), isNaN(e) || isNaN(g)))) {
10213          this.canvas.lineCap = "round";
10214          this.canvas.lineJoin = "round";
10215          this.hitDetection && ((this.hitContext.lineCap = "round"), (this.hitContext.lineJoin = "round"));
10216          if (b.graphicName in this.cachedSymbolBounds) d = this.cachedSymbolBounds[b.graphicName];
10217          else {
10218              d = new OpenLayers.Bounds();
10219              for (a = 0; a < h.length; a += 2) d.extend(new OpenLayers.LonLat(h[a], h[a + 1]));
10220              this.cachedSymbolBounds[b.graphicName] = d;
10221          }
10222          this.canvas.save();
10223          this.hitDetection && this.hitContext.save();
10224          this.canvas.translate(e, g);
10225          this.hitDetection && this.hitContext.translate(e, g);
10226          a = f * b.rotation;
10227          isNaN(a) || (this.canvas.rotate(a), this.hitDetection && this.hitContext.rotate(a));
10228          f = (2 * b.pointRadius) / Math.max(d.getWidth(), d.getHeight());
10229          this.canvas.scale(f, f);
10230          this.hitDetection && this.hitContext.scale(f, f);
10231          a = d.getCenterLonLat().lon;
10232          d = d.getCenterLonLat().lat;
10233          this.canvas.translate(-a, -d);
10234          this.hitDetection && this.hitContext.translate(-a, -d);
10235          g = b.strokeWidth;
10236          b.strokeWidth = g / f;
10237          if (!1 !== b.fill) {
10238              this.setCanvasStyle("fill", b);
10239              this.canvas.beginPath();
10240              for (a = 0; a < h.length; a += 2) (d = h[a]), (e = h[a + 1]), 0 == a && this.canvas.moveTo(d, e), this.canvas.lineTo(d, e);
10241              this.canvas.closePath();
10242              this.canvas.fill();
10243              if (this.hitDetection) {
10244                  this.setHitContextStyle("fill", c, b);
10245                  this.hitContext.beginPath();
10246                  for (a = 0; a < h.length; a += 2) (d = h[a]), (e = h[a + 1]), 0 == a && this.canvas.moveTo(d, e), this.hitContext.lineTo(d, e);
10247                  this.hitContext.closePath();
10248                  this.hitContext.fill();
10249              }
10250          }
10251          if (!1 !== b.stroke) {
10252              this.setCanvasStyle("stroke", b);
10253              this.canvas.beginPath();
10254              for (a = 0; a < h.length; a += 2) (d = h[a]), (e = h[a + 1]), 0 == a && this.canvas.moveTo(d, e), this.canvas.lineTo(d, e);
10255              this.canvas.closePath();
10256              this.canvas.stroke();
10257              if (this.hitDetection) {
10258                  this.setHitContextStyle("stroke", c, b, f);
10259                  this.hitContext.beginPath();
10260                  for (a = 0; a < h.length; a += 2) (d = h[a]), (e = h[a + 1]), 0 == a && this.hitContext.moveTo(d, e), this.hitContext.lineTo(d, e);
10261                  this.hitContext.closePath();
10262                  this.hitContext.stroke();
10263              }
10264          }
10265          b.strokeWidth = g;
10266          this.canvas.restore();
10267          this.hitDetection && this.hitContext.restore();
10268          this.setCanvasStyle("reset");
10269      }
10270  },
10271  setCanvasStyle: function (a, b) {
10272      "fill" === a
10273          ? ((this.canvas.globalAlpha = b.fillOpacity), (this.canvas.fillStyle = b.fillColor))
10274          : "stroke" === a
10275          ? ((this.canvas.globalAlpha = b.strokeOpacity), (this.canvas.strokeStyle = b.strokeColor), (this.canvas.lineWidth = b.strokeWidth))
10276          : ((this.canvas.globalAlpha = 0), (this.canvas.lineWidth = 1));
10277  },
10278  featureIdToHex: function (a) {
10279      a = Number(a.split("_").pop()) + 1;
10280      16777216 <= a && ((this.hitOverflow = a - 16777215), (a = (a % 16777216) + 1));
10281      a = "000000" + a.toString(16);
10282      var b = a.length;
10283      return (a = "#" + a.substring(b - 6, b));
10284  },
10285  setHitContextStyle: function (a, b, c, d) {
10286      b = this.featureIdToHex(b);
10287      "fill" == a
10288          ? ((this.hitContext.globalAlpha = 1), (this.hitContext.fillStyle = b))
10289          : "stroke" == a
10290          ? ((this.hitContext.globalAlpha = 1), (this.hitContext.strokeStyle = b), "undefined" === typeof d ? (this.hitContext.lineWidth = c.strokeWidth + 2) : isNaN(d) || (this.hitContext.lineWidth = c.strokeWidth + 2 / d))
10291          : ((this.hitContext.globalAlpha = 0), (this.hitContext.lineWidth = 1));
10292  },
10293  drawPoint: function (a, b, c) {
10294      if (!1 !== b.graphic)
10295          if (b.externalGraphic) this.drawExternalGraphic(a, b, c);
10296          else if (b.graphicName && "circle" != b.graphicName) this.drawNamedSymbol(a, b, c);
10297          else {
10298              var d = this.getLocalXY(a);
10299              a = d[0];
10300              d = d[1];
10301              if (!isNaN(a) && !isNaN(d)) {
10302                  var e = 2 * Math.PI,
10303                      f = b.pointRadius;
10304                  !1 !== b.fill &&
10305                      (this.setCanvasStyle("fill", b),
10306                      this.canvas.beginPath(),
10307                      this.canvas.arc(a, d, f, 0, e, !0),
10308                      this.canvas.fill(),
10309                      this.hitDetection && (this.setHitContextStyle("fill", c, b), this.hitContext.beginPath(), this.hitContext.arc(a, d, f, 0, e, !0), this.hitContext.fill()));
10310                  !1 !== b.stroke &&
10311                      (this.setCanvasStyle("stroke", b),
10312                      this.canvas.beginPath(),
10313                      this.canvas.arc(a, d, f, 0, e, !0),
10314                      this.canvas.stroke(),
10315                      this.hitDetection && (this.setHitContextStyle("stroke", c, b), this.hitContext.beginPath(), this.hitContext.arc(a, d, f, 0, e, !0), this.hitContext.stroke()),
10316                      this.setCanvasStyle("reset"));
10317              }
10318          }
10319  },
10320  drawLineString: function (a, b, c) {
10321      b = OpenLayers.Util.applyDefaults({ fill: !1 }, b);
10322      this.drawLinearRing(a, b, c);
10323  },
10324  drawLinearRing: function (a, b, c) {
10325      !1 !== b.fill && (this.setCanvasStyle("fill", b), this.renderPath(this.canvas, a, b, c, "fill"), this.hitDetection && (this.setHitContextStyle("fill", c, b), this.renderPath(this.hitContext, a, b, c, "fill")));
10326      !1 !== b.stroke && (this.setCanvasStyle("stroke", b), this.renderPath(this.canvas, a, b, c, "stroke"), this.hitDetection && (this.setHitContextStyle("stroke", c, b), this.renderPath(this.hitContext, a, b, c, "stroke")));
10327      this.setCanvasStyle("reset");
10328  },
10329  renderPath: function (a, b, c, d, e) {
10330      b = b.components;
10331      c = b.length;
10332      a.beginPath();
10333      d = this.getLocalXY(b[0]);
10334      var f = d[1];
10335      if (!isNaN(d[0]) && !isNaN(f)) {
10336          a.moveTo(d[0], d[1]);
10337          for (d = 1; d < c; ++d) (f = this.getLocalXY(b[d])), a.lineTo(f[0], f[1]);
10338          "fill" === e ? a.fill() : a.stroke();
10339      }
10340  },
10341  drawPolygon: function (a, b, c) {
10342      a = a.components;
10343      var d = a.length;
10344      this.drawLinearRing(a[0], b, c);
10345      for (var e = 1; e < d; ++e)
10346          (this.canvas.globalCompositeOperation = "destination-out"),
10347              this.hitDetection && (this.hitContext.globalCompositeOperation = "destination-out"),
10348              this.drawLinearRing(a[e], OpenLayers.Util.applyDefaults({ stroke: !1, fillOpacity: 1 }, b), c),
10349              (this.canvas.globalCompositeOperation = "source-over"),
10350              this.hitDetection && (this.hitContext.globalCompositeOperation = "source-over"),
10351              this.drawLinearRing(a[e], OpenLayers.Util.applyDefaults({ fill: !1 }, b), c);
10352  },
10353  drawText: function (a, b) {
10354      var c = this.getLocalXY(a);
10355      this.setCanvasStyle("reset");
10356      this.canvas.fillStyle = b.fontColor;
10357      this.canvas.globalAlpha = b.fontOpacity || 1;
10358      var d = [b.fontStyle ? b.fontStyle : "normal", "normal", b.fontWeight ? b.fontWeight : "normal", b.fontSize ? b.fontSize : "1em", b.fontFamily ? b.fontFamily : "sans-serif"].join(" "),
10359          e = b.label.split("\n"),
10360          f = e.length;
10361      if (this.canvas.fillText) {
10362          this.canvas.font = d;
10363          this.canvas.textAlign = OpenLayers.Renderer.Canvas.LABEL_ALIGN[b.labelAlign[0]] || "center";
10364          this.canvas.textBaseline = OpenLayers.Renderer.Canvas.LABEL_ALIGN[b.labelAlign[1]] || "middle";
10365          var g = OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[1]];
10366          null == g && (g = -0.5);
10367          d = this.canvas.measureText("Mg").height || this.canvas.measureText("xx").width;
10368          c[1] += d * g * (f - 1);
10369          for (g = 0; g < f; g++)
10370              b.labelOutlineWidth &&
10371                  (this.canvas.save(),
10372                  (this.canvas.globalAlpha = b.labelOutlineOpacity || b.fontOpacity || 1),
10373                  (this.canvas.strokeStyle = b.labelOutlineColor),
10374                  (this.canvas.lineWidth = b.labelOutlineWidth),
10375                  this.canvas.strokeText(e[g], c[0], c[1] + d * g + 1),
10376                  this.canvas.restore()),
10377                  this.canvas.fillText(e[g], c[0], c[1] + d * g);
10378      } else if (this.canvas.mozDrawText) {
10379          this.canvas.mozTextStyle = d;
10380          var h = OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[0]];
10381          null == h && (h = -0.5);
10382          g = OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[1]];
10383          null == g && (g = -0.5);
10384          d = this.canvas.mozMeasureText("xx");
10385          c[1] += d * (1 + g * f);
10386          for (g = 0; g < f; g++) {
10387              var k = c[0] + h * this.canvas.mozMeasureText(e[g]),
10388                  l = c[1] + g * d;
10389              this.canvas.translate(k, l);
10390              this.canvas.mozDrawText(e[g]);
10391              this.canvas.translate(-k, -l);
10392          }
10393      }
10394      this.setCanvasStyle("reset");
10395  },
10396  getLocalXY: function (a) {
10397      var b = this.getResolution(),
10398          c = this.extent;
10399      return [(a.x - this.featureDx) / b + -c.left / b, c.top / b - a.y / b];
10400  },
10401  clear: function () {
10402      var a = this.root.height,
10403          b = this.root.width;
10404      this.canvas.clearRect(0, 0, b, a);
10405      this.features = {};
10406      this.hitDetection && this.hitContext.clearRect(0, 0, b, a);
10407  },
10408  getFeatureIdFromEvent: function (a) {
10409      var b;
10410      if (this.hitDetection && "none" !== this.root.style.display && !this.map.dragging && ((a = a.xy), (a = this.hitContext.getImageData(a.x | 0, a.y | 0, 1, 1).data), 255 === a[3] && (a = a[2] + 256 * (a[1] + 256 * a[0])))) {
10411          a = "OpenLayers_Feature_Vector_" + (a - 1 + this.hitOverflow);
10412          try {
10413              b = this.features[a][0];
10414          } catch (c) {}
10415      }
10416      return b;
10417  },
10418  eraseFeatures: function (a) {
10419      OpenLayers.Util.isArray(a) || (a = [a]);
10420      for (var b = 0; b < a.length; ++b) delete this.features[a[b].id];
10421      this.redraw();
10422  },
10423  redraw: function () {
10424      if (!this.locked) {
10425          var a = this.root.height,
10426              b = this.root.width;
10427          this.canvas.clearRect(0, 0, b, a);
10428          this.hitDetection && this.hitContext.clearRect(0, 0, b, a);
10429          var a = [],
10430              c,
10431              d,
10432              e = this.map.baseLayer && this.map.baseLayer.wrapDateLine && this.map.getMaxExtent(),
10433              f;
10434          for (f in this.features)
10435              this.features.hasOwnProperty(f) && ((b = this.features[f][0]), (c = b.geometry), this.calculateFeatureDx(c.getBounds(), e), (d = this.features[f][1]), this.drawGeometry(c, d, b.id), d.label && a.push([b, d]));
10436          b = 0;
10437          for (c = a.length; b < c; ++b) (f = a[b]), this.drawText(f[0].geometry.getCentroid(), f[1]);
10438      }
10439  },
10440  CLASS_NAME: "OpenLayers.Renderer.Canvas",
10441});
10442OpenLayers.Renderer.Canvas.LABEL_ALIGN = { l: "left", r: "right", t: "top", b: "bottom" };
10443OpenLayers.Renderer.Canvas.LABEL_FACTOR = { l: 0, r: -1, t: 0, b: -1 };
10444OpenLayers.Renderer.Canvas.drawImageScaleFactor = null;
10445OpenLayers.Format.OSM = OpenLayers.Class(OpenLayers.Format.XML, {
10446  checkTags: !1,
10447  interestingTagsExclude: null,
10448  areaTags: null,
10449  initialize: function (a) {
10450      var b = { interestingTagsExclude: "source source_ref source:ref history attribution created_by".split(" "), areaTags: "area building leisure tourism ruins historic landuse military natural sport".split(" ") },
10451          b = OpenLayers.Util.extend(b, a),
10452          c = {};
10453      for (a = 0; a < b.interestingTagsExclude.length; a++) c[b.interestingTagsExclude[a]] = !0;
10454      b.interestingTagsExclude = c;
10455      c = {};
10456      for (a = 0; a < b.areaTags.length; a++) c[b.areaTags[a]] = !0;
10457      b.areaTags = c;
10458      this.externalProjection = new OpenLayers.Projection("EPSG:4326");
10459      OpenLayers.Format.XML.prototype.initialize.apply(this, [b]);
10460  },
10461  read: function (a) {
10462      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
10463      var b = this.getNodes(a),
10464          c = this.getWays(a);
10465      a = Array(c.length);
10466      for (var d = 0; d < c.length; d++) {
10467          for (var e = Array(c[d].nodes.length), f = this.isWayArea(c[d]) ? 1 : 0, g = 0; g < c[d].nodes.length; g++) {
10468              var h = b[c[d].nodes[g]],
10469                  k = new OpenLayers.Geometry.Point(h.lon, h.lat);
10470              k.osm_id = parseInt(c[d].nodes[g]);
10471              e[g] = k;
10472              h.used = !0;
10473          }
10474          h = null;
10475          h = f ? new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(e)) : new OpenLayers.Geometry.LineString(e);
10476          this.internalProjection && this.externalProjection && h.transform(this.externalProjection, this.internalProjection);
10477          e = new OpenLayers.Feature.Vector(h, c[d].tags);
10478          e.osm_id = parseInt(c[d].id);
10479          e.fid = "way." + e.osm_id;
10480          a[d] = e;
10481      }
10482      for (var l in b) {
10483          h = b[l];
10484          if (!h.used || this.checkTags) {
10485              c = null;
10486              if (this.checkTags) {
10487                  c = this.getTags(h.node, !0);
10488                  if (h.used && !c[1]) continue;
10489                  c = c[0];
10490              } else c = this.getTags(h.node);
10491              e = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(h.lon, h.lat), c);
10492              this.internalProjection && this.externalProjection && e.geometry.transform(this.externalProjection, this.internalProjection);
10493              e.osm_id = parseInt(l);
10494              e.fid = "node." + e.osm_id;
10495              a.push(e);
10496          }
10497          h.node = null;
10498      }
10499      return a;
10500  },
10501  getNodes: function (a) {
10502      a = a.getElementsByTagName("node");
10503      for (var b = {}, c = 0; c < a.length; c++) {
10504          var d = a[c],
10505              e = d.getAttribute("id");
10506          b[e] = { lat: d.getAttribute("lat"), lon: d.getAttribute("lon"), node: d };
10507      }
10508      return b;
10509  },
10510  getWays: function (a) {
10511      a = a.getElementsByTagName("way");
10512      for (var b = [], c = 0; c < a.length; c++) {
10513          var d = a[c],
10514              e = { id: d.getAttribute("id") };
10515          e.tags = this.getTags(d);
10516          d = d.getElementsByTagName("nd");
10517          e.nodes = Array(d.length);
10518          for (var f = 0; f < d.length; f++) e.nodes[f] = d[f].getAttribute("ref");
10519          b.push(e);
10520      }
10521      return b;
10522  },
10523  getTags: function (a, b) {
10524      for (var c = a.getElementsByTagName("tag"), d = {}, e = !1, f = 0; f < c.length; f++) {
10525          var g = c[f].getAttribute("k");
10526          d[g] = c[f].getAttribute("v");
10527          b && (this.interestingTagsExclude[g] || (e = !0));
10528      }
10529      return b ? [d, e] : d;
10530  },
10531  isWayArea: function (a) {
10532      var b = !1,
10533          c = !1;
10534      a.nodes[0] == a.nodes[a.nodes.length - 1] && (b = !0);
10535      if (this.checkTags)
10536          for (var d in a.tags)
10537              if (this.areaTags[d]) {
10538                  c = !0;
10539                  break;
10540              }
10541      return b && (this.checkTags ? c : !0);
10542  },
10543  write: function (a) {
10544      OpenLayers.Util.isArray(a) || (a = [a]);
10545      this.osm_id = 1;
10546      this.created_nodes = {};
10547      var b = this.createElementNS(null, "osm");
10548      b.setAttribute("version", "0.5");
10549      b.setAttribute("generator", "OpenLayers " + OpenLayers.VERSION_NUMBER);
10550      for (var c = a.length - 1; 0 <= c; c--) for (var d = this.createFeatureNodes(a[c]), e = 0; e < d.length; e++) b.appendChild(d[e]);
10551      return OpenLayers.Format.XML.prototype.write.apply(this, [b]);
10552  },
10553  createFeatureNodes: function (a) {
10554      var b = [],
10555          c = a.geometry.CLASS_NAME,
10556          c = c.substring(c.lastIndexOf(".") + 1),
10557          c = c.toLowerCase();
10558      (c = this.createXML[c]) && (b = c.apply(this, [a]));
10559      return b;
10560  },
10561  createXML: {
10562      point: function (a) {
10563          var b = null,
10564              c = a.geometry ? a.geometry : a;
10565          this.internalProjection && this.externalProjection && ((c = c.clone()), c.transform(this.internalProjection, this.externalProjection));
10566          var d = !1;
10567          a.osm_id ? ((b = a.osm_id), this.created_nodes[b] && (d = !0)) : ((b = -this.osm_id), this.osm_id++);
10568          var e = d ? this.created_nodes[b] : this.createElementNS(null, "node");
10569          this.created_nodes[b] = e;
10570          e.setAttribute("id", b);
10571          e.setAttribute("lon", c.x);
10572          e.setAttribute("lat", c.y);
10573          a.attributes && this.serializeTags(a, e);
10574          this.setState(a, e);
10575          return d ? [] : [e];
10576      },
10577      linestring: function (a) {
10578          var b,
10579              c = [],
10580              d = a.geometry;
10581          a.osm_id ? (b = a.osm_id) : ((b = -this.osm_id), this.osm_id++);
10582          var e = this.createElementNS(null, "way");
10583          e.setAttribute("id", b);
10584          for (b = 0; b < d.components.length; b++) {
10585              var f = this.createXML.point.apply(this, [d.components[b]]);
10586              if (f.length) {
10587                  var f = f[0],
10588                      g = f.getAttribute("id");
10589                  c.push(f);
10590              } else (g = d.components[b].osm_id), (f = this.created_nodes[g]);
10591              this.setState(a, f);
10592              f = this.createElementNS(null, "nd");
10593              f.setAttribute("ref", g);
10594              e.appendChild(f);
10595          }
10596          this.serializeTags(a, e);
10597          c.push(e);
10598          return c;
10599      },
10600      polygon: function (a) {
10601          var b = OpenLayers.Util.extend({ area: "yes" }, a.attributes),
10602              b = new OpenLayers.Feature.Vector(a.geometry.components[0], b);
10603          b.osm_id = a.osm_id;
10604          return this.createXML.linestring.apply(this, [b]);
10605      },
10606  },
10607  serializeTags: function (a, b) {
10608      for (var c in a.attributes) {
10609          var d = this.createElementNS(null, "tag");
10610          d.setAttribute("k", c);
10611          d.setAttribute("v", a.attributes[c]);
10612          b.appendChild(d);
10613      }
10614  },
10615  setState: function (a, b) {
10616      if (a.state) {
10617          var c = null;
10618          switch (a.state) {
10619              case OpenLayers.State.UPDATE:
10620              case OpenLayers.State.DELETE:
10621                  c = "delete";
10622          }
10623          c && b.setAttribute("action", c);
10624      }
10625  },
10626  CLASS_NAME: "OpenLayers.Format.OSM",
10627});
10628OpenLayers.Handler.Keyboard = OpenLayers.Class(OpenLayers.Handler, {
10629  KEY_EVENTS: ["keydown", "keyup"],
10630  eventListener: null,
10631  observeElement: null,
10632  initialize: function (a, b, c) {
10633      OpenLayers.Handler.prototype.initialize.apply(this, arguments);
10634      this.eventListener = OpenLayers.Function.bindAsEventListener(this.handleKeyEvent, this);
10635  },
10636  destroy: function () {
10637      this.deactivate();
10638      this.eventListener = null;
10639      OpenLayers.Handler.prototype.destroy.apply(this, arguments);
10640  },
10641  activate: function () {
10642      if (OpenLayers.Handler.prototype.activate.apply(this, arguments)) {
10643          this.observeElement = this.observeElement || document;
10644          for (var a = 0, b = this.KEY_EVENTS.length; a < b; a++) OpenLayers.Event.observe(this.observeElement, this.KEY_EVENTS[a], this.eventListener);
10645          return !0;
10646      }
10647      return !1;
10648  },
10649  deactivate: function () {
10650      var a = !1;
10651      if (OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
10652          for (var a = 0, b = this.KEY_EVENTS.length; a < b; a++) OpenLayers.Event.stopObserving(this.observeElement, this.KEY_EVENTS[a], this.eventListener);
10653          a = !0;
10654      }
10655      return a;
10656  },
10657  handleKeyEvent: function (a) {
10658      this.checkModifiers(a) && this.callback(a.type, [a]);
10659  },
10660  CLASS_NAME: "OpenLayers.Handler.Keyboard",
10661});
10662OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
10663  documentDrag: !1,
10664  geometryTypes: null,
10665  clickout: !0,
10666  toggle: !0,
10667  standalone: !1,
10668  layer: null,
10669  feature: null,
10670  vertex: null,
10671  vertices: null,
10672  virtualVertices: null,
10673  handlers: null,
10674  deleteCodes: null,
10675  virtualStyle: null,
10676  vertexRenderIntent: null,
10677  mode: null,
10678  createVertices: !0,
10679  modified: !1,
10680  radiusHandle: null,
10681  dragHandle: null,
10682  onModificationStart: function () {},
10683  onModification: function () {},
10684  onModificationEnd: function () {},
10685  initialize: function (a, b) {
10686      b = b || {};
10687      this.layer = a;
10688      this.vertices = [];
10689      this.virtualVertices = [];
10690      this.virtualStyle = OpenLayers.Util.extend({}, this.layer.style || this.layer.styleMap.createSymbolizer(null, b.vertexRenderIntent));
10691      this.virtualStyle.fillOpacity = 0.3;
10692      this.virtualStyle.strokeOpacity = 0.3;
10693      this.deleteCodes = [46, 68];
10694      this.mode = OpenLayers.Control.ModifyFeature.RESHAPE;
10695      OpenLayers.Control.prototype.initialize.apply(this, [b]);
10696      OpenLayers.Util.isArray(this.deleteCodes) || (this.deleteCodes = [this.deleteCodes]);
10697      var c = { documentDrag: this.documentDrag, stopDown: !1 };
10698      this.handlers = {
10699          keyboard: new OpenLayers.Handler.Keyboard(this, { keydown: this.handleKeypress }),
10700          drag: new OpenLayers.Handler.Drag(
10701              this,
10702              {
10703                  down: function (a) {
10704                      this.vertex = null;
10705                      (a = this.layer.getFeatureFromEvent(this.handlers.drag.evt)) ? this.dragStart(a) : this.clickout && (this._unselect = this.feature);
10706                  },
10707                  move: function (a) {
10708                      delete this._unselect;
10709                      this.vertex && this.dragVertex(this.vertex, a);
10710                  },
10711                  up: function () {
10712                      this.handlers.drag.stopDown = !1;
10713                      this._unselect && (this.unselectFeature(this._unselect), delete this._unselect);
10714                  },
10715                  done: function (a) {
10716                      this.vertex && this.dragComplete(this.vertex);
10717                  },
10718              },
10719              c
10720          ),
10721      };
10722  },
10723  destroy: function () {
10724      this.map && this.map.events.un({ removelayer: this.handleMapEvents, changelayer: this.handleMapEvents, scope: this });
10725      this.layer = null;
10726      OpenLayers.Control.prototype.destroy.apply(this, []);
10727  },
10728  activate: function () {
10729      this.moveLayerToTop();
10730      this.map.events.on({ removelayer: this.handleMapEvents, changelayer: this.handleMapEvents, scope: this });
10731      return this.handlers.keyboard.activate() && this.handlers.drag.activate() && OpenLayers.Control.prototype.activate.apply(this, arguments);
10732  },
10733  deactivate: function () {
10734      var a = !1;
10735      OpenLayers.Control.prototype.deactivate.apply(this, arguments) &&
10736          (this.moveLayerBack(),
10737          this.map.events.un({ removelayer: this.handleMapEvents, changelayer: this.handleMapEvents, scope: this }),
10738          this.layer.removeFeatures(this.vertices, { silent: !0 }),
10739          this.layer.removeFeatures(this.virtualVertices, { silent: !0 }),
10740          (this.vertices = []),
10741          this.handlers.drag.deactivate(),
10742          this.handlers.keyboard.deactivate(),
10743          (a = this.feature) && a.geometry && a.layer && this.unselectFeature(a),
10744          (a = !0));
10745      return a;
10746  },
10747  beforeSelectFeature: function (a) {
10748      return this.layer.events.triggerEvent("beforefeaturemodified", { feature: a });
10749  },
10750  selectFeature: function (a) {
10751      if (!(this.feature === a || (this.geometryTypes && -1 == OpenLayers.Util.indexOf(this.geometryTypes, a.geometry.CLASS_NAME)))) {
10752          !1 !== this.beforeSelectFeature(a) &&
10753              (this.feature && this.unselectFeature(this.feature),
10754              (this.feature = a),
10755              this.layer.selectedFeatures.push(a),
10756              this.layer.drawFeature(a, "select"),
10757              (this.modified = !1),
10758              this.resetVertices(),
10759              this.onModificationStart(this.feature));
10760          var b = a.modified;
10761          !a.geometry || (b && b.geometry) || (this._originalGeometry = a.geometry.clone());
10762      }
10763  },
10764  unselectFeature: function (a) {
10765      this.layer.removeFeatures(this.vertices, { silent: !0 });
10766      this.vertices = [];
10767      this.layer.destroyFeatures(this.virtualVertices, { silent: !0 });
10768      this.virtualVertices = [];
10769      this.dragHandle && (this.layer.destroyFeatures([this.dragHandle], { silent: !0 }), delete this.dragHandle);
10770      this.radiusHandle && (this.layer.destroyFeatures([this.radiusHandle], { silent: !0 }), delete this.radiusHandle);
10771      this.layer.drawFeature(this.feature, "default");
10772      this.feature = null;
10773      OpenLayers.Util.removeItem(this.layer.selectedFeatures, a);
10774      this.onModificationEnd(a);
10775      this.layer.events.triggerEvent("afterfeaturemodified", { feature: a, modified: this.modified });
10776      this.modified = !1;
10777  },
10778  dragStart: function (a) {
10779      var b = "OpenLayers.Geometry.Point" == a.geometry.CLASS_NAME;
10780      this.standalone || ((a._sketch || !b) && a._sketch) || (this.toggle && this.feature === a && (this._unselect = a), this.selectFeature(a));
10781      if (a._sketch || b) (this.vertex = a), (this.handlers.drag.stopDown = !0);
10782  },
10783  dragVertex: function (a, b) {
10784      var c = this.map.getLonLatFromViewPortPx(b),
10785          d = a.geometry;
10786      d.move(c.lon - d.x, c.lat - d.y);
10787      this.modified = !0;
10788      "OpenLayers.Geometry.Point" == this.feature.geometry.CLASS_NAME
10789          ? this.layer.events.triggerEvent("vertexmodified", { vertex: a.geometry, feature: this.feature, pixel: b })
10790          : (a._index
10791                ? (a.geometry.parent.addComponent(a.geometry, a._index), delete a._index, OpenLayers.Util.removeItem(this.virtualVertices, a), this.vertices.push(a))
10792                : a == this.dragHandle
10793                ? (this.layer.removeFeatures(this.vertices, { silent: !0 }), (this.vertices = []), this.radiusHandle && (this.layer.destroyFeatures([this.radiusHandle], { silent: !0 }), (this.radiusHandle = null)))
10794                : a !== this.radiusHandle && this.layer.events.triggerEvent("vertexmodified", { vertex: a.geometry, feature: this.feature, pixel: b }),
10795            0 < this.virtualVertices.length && (this.layer.destroyFeatures(this.virtualVertices, { silent: !0 }), (this.virtualVertices = [])),
10796            this.layer.drawFeature(this.feature, this.standalone ? void 0 : "select"));
10797      this.layer.drawFeature(a);
10798  },
10799  dragComplete: function (a) {
10800      this.resetVertices();
10801      this.setFeatureState();
10802      this.onModification(this.feature);
10803      this.layer.events.triggerEvent("featuremodified", { feature: this.feature });
10804  },
10805  setFeatureState: function () {
10806      if (this.feature.state != OpenLayers.State.INSERT && this.feature.state != OpenLayers.State.DELETE && ((this.feature.state = OpenLayers.State.UPDATE), this.modified && this._originalGeometry)) {
10807          var a = this.feature;
10808          a.modified = OpenLayers.Util.extend(a.modified, { geometry: this._originalGeometry });
10809          delete this._originalGeometry;
10810      }
10811  },
10812  resetVertices: function () {
10813      0 < this.vertices.length && (this.layer.removeFeatures(this.vertices, { silent: !0 }), (this.vertices = []));
10814      0 < this.virtualVertices.length && (this.layer.removeFeatures(this.virtualVertices, { silent: !0 }), (this.virtualVertices = []));
10815      this.dragHandle && (this.layer.destroyFeatures([this.dragHandle], { silent: !0 }), (this.dragHandle = null));
10816      this.radiusHandle && (this.layer.destroyFeatures([this.radiusHandle], { silent: !0 }), (this.radiusHandle = null));
10817      this.feature &&
10818          "OpenLayers.Geometry.Point" != this.feature.geometry.CLASS_NAME &&
10819          (this.mode & OpenLayers.Control.ModifyFeature.DRAG && this.collectDragHandle(),
10820          this.mode & (OpenLayers.Control.ModifyFeature.ROTATE | OpenLayers.Control.ModifyFeature.RESIZE) && this.collectRadiusHandle(),
10821          this.mode & OpenLayers.Control.ModifyFeature.RESHAPE && (this.mode & OpenLayers.Control.ModifyFeature.RESIZE || this.collectVertices()));
10822  },
10823  handleKeypress: function (a) {
10824      var b = a.keyCode;
10825      this.feature &&
10826          -1 != OpenLayers.Util.indexOf(this.deleteCodes, b) &&
10827          (b = this.layer.getFeatureFromEvent(this.handlers.drag.evt)) &&
10828          -1 != OpenLayers.Util.indexOf(this.vertices, b) &&
10829          !this.handlers.drag.dragging &&
10830          b.geometry.parent &&
10831          (b.geometry.parent.removeComponent(b.geometry),
10832          this.layer.events.triggerEvent("vertexremoved", { vertex: b.geometry, feature: this.feature, pixel: a.xy }),
10833          this.layer.drawFeature(this.feature, this.standalone ? void 0 : "select"),
10834          (this.modified = !0),
10835          this.resetVertices(),
10836          this.setFeatureState(),
10837          this.onModification(this.feature),
10838          this.layer.events.triggerEvent("featuremodified", { feature: this.feature }));
10839  },
10840  collectVertices: function () {
10841      function a(c) {
10842          var d, e, f;
10843          if ("OpenLayers.Geometry.Point" == c.CLASS_NAME) (e = new OpenLayers.Feature.Vector(c)), (e._sketch = !0), (e.renderIntent = b.vertexRenderIntent), b.vertices.push(e);
10844          else {
10845              f = c.components.length;
10846              "OpenLayers.Geometry.LinearRing" == c.CLASS_NAME && (f -= 1);
10847              for (d = 0; d < f; ++d) (e = c.components[d]), "OpenLayers.Geometry.Point" == e.CLASS_NAME ? ((e = new OpenLayers.Feature.Vector(e)), (e._sketch = !0), (e.renderIntent = b.vertexRenderIntent), b.vertices.push(e)) : a(e);
10848              if (b.createVertices && "OpenLayers.Geometry.MultiPoint" != c.
10848CLASS_NAME)
10849                  for (d = 0, f = c.components.length; d < f - 1; ++d) {
10850                      e = c.components[d];
10851                      var g = c.components[d + 1];
10852                      "OpenLayers.Geometry.Point" == e.CLASS_NAME &&
10853                          "OpenLayers.Geometry.Point" == g.CLASS_NAME &&
10854                          ((e = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point((e.x + g.x) / 2, (e.y + g.y) / 2), null, b.virtualStyle)),
10855                          (e.geometry.parent = c),
10856                          (e._index = d + 1),
10857                          (e._sketch = !0),
10858                          b.virtualVertices.push(e));
10859                  }
10860          }
10861      }
10862      this.vertices = [];
10863      this.virtualVertices = [];
10864      var b = this;
10865      a.call(this, this.feature.geometry);
10866      this.layer.addFeatures(this.virtualVertices, { silent: !0 });
10867      this.layer.addFeatures(this.vertices, { silent: !0 });
10868  },
10869  collectDragHandle: function () {
10870      var a = this.feature.geometry,
10871          b = a.getBounds().getCenterLonLat(),
10872          b = new OpenLayers.Geometry.Point(b.lon, b.lat),
10873          c = new OpenLayers.Feature.Vector(b);
10874      b.move = function (b, c) {
10875          OpenLayers.Geometry.Point.prototype.move.call(this, b, c);
10876          a.move(b, c);
10877      };
10878      c._sketch = !0;
10879      this.dragHandle = c;
10880      this.dragHandle.renderIntent = this.vertexRenderIntent;
10881      this.layer.addFeatures([this.dragHandle], { silent: !0 });
10882  },
10883  collectRadiusHandle: function () {
10884      var a = this.feature.geometry,
10885          b = a.getBounds(),
10886          c = b.getCenterLonLat(),
10887          d = new OpenLayers.Geometry.Point(c.lon, c.lat),
10888          b = new OpenLayers.Geometry.Point(b.right, b.bottom),
10889          c = new OpenLayers.Feature.Vector(b),
10890          e = this.mode & OpenLayers.Control.ModifyFeature.RESIZE,
10891          f = this.mode & OpenLayers.Control.ModifyFeature.RESHAPE,
10892          g = this.mode & OpenLayers.Control.ModifyFeature.ROTATE;
10893      b.move = function (b, c) {
10894          OpenLayers.Geometry.Point.prototype.move.call(this, b, c);
10895          var l = this.x - d.x,
10896              m = this.y - d.y,
10897              n = l - b,
10898              p = m - c;
10899          if (g) {
10900              var q = Math.atan2(p, n),
10901                  q = Math.atan2(m, l) - q,
10902                  q = q * (180 / Math.PI);
10903              a.rotate(q, d);
10904          }
10905          if (e) {
10906              var r;
10907              f ? ((m /= p), (r = l / n / m)) : ((n = Math.sqrt(n * n + p * p)), (m = Math.sqrt(l * l + m * m) / n));
10908              a.resize(m, d, r);
10909          }
10910      };
10911      c._sketch = !0;
10912      this.radiusHandle = c;
10913      this.radiusHandle.renderIntent = this.vertexRenderIntent;
10914      this.layer.addFeatures([this.radiusHandle], { silent: !0 });
10915  },
10916  setMap: function (a) {
10917      this.handlers.drag.setMap(a);
10918      OpenLayers.Control.prototype.setMap.apply(this, arguments);
10919  },
10920  handleMapEvents: function (a) {
10921      ("removelayer" != a.type && "order" != a.property) || this.moveLayerToTop();
10922  },
10923  moveLayerToTop: function () {
10924      var a = Math.max(this.map.Z_INDEX_BASE.Feature - 1, this.layer.getZIndex()) + 1;
10925      this.layer.setZIndex(a);
10926  },
10927  moveLayerBack: function () {
10928      var a = this.layer.getZIndex() - 1;
10929      a >= this.map.Z_INDEX_BASE.Feature ? this.layer.setZIndex(a) : this.map.setLayerZIndex(this.layer, this.map.getLayerIndex(this.layer));
10930  },
10931  CLASS_NAME: "OpenLayers.Control.ModifyFeature",
10932});
10933OpenLayers.Control.ModifyFeature.RESHAPE = 1;
10934OpenLayers.Control.ModifyFeature.RESIZE = 2;
10935OpenLayers.Control.ModifyFeature.ROTATE = 4;
10936OpenLayers.Control.ModifyFeature.DRAG = 8;
10937OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
10938  key: null,
10939  serverResolutions: [
10940      156543.03390625,
10941      78271.516953125,
10942      39135.7584765625,
10943      19567.87923828125,
10944      9783.939619140625,
10945      4891.9698095703125,
10946      2445.9849047851562,
10947      1222.9924523925781,
10948      611.4962261962891,
10949      305.74811309814453,
10950      152.87405654907226,
10951      76.43702827453613,
10952      38.218514137268066,
10953      19.109257068634033,
10954      9.554628534317017,
10955      4.777314267158508,
10956      2.388657133579254,
10957      1.194328566789627,
10958      0.5971642833948135,
10959      0.29858214169740677,
10960      0.14929107084870338,
10961      0.07464553542435169,
10962  ],
10963  attributionTemplate:
10964      '<span class="olBingAttribution ${type}"><div><a target="_blank" href="http://www.bing.com/maps/"><img src="${logo}" /></a></div>${copyrights}<a style="white-space: nowrap" target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a></span>',
10965  metadata: null,
10966  protocolRegex: /^http:/i,
10967  type: "Road",
10968  culture: "en-US",
10969  metadataParams: null,
10970  tileOptions: null,
10971  protocol: ~window.location.href.indexOf("http") ? "" : "http:",
10972  initialize: function (a) {
10973      a = OpenLayers.Util.applyDefaults({ sphericalMercator: !0 }, a);
10974      OpenLayers.Layer.XYZ.prototype.initialize.apply(this, [a.name || "Bing " + (a.type || this.type), null, a]);
10975      this.tileOptions = OpenLayers.Util.extend({ crossOriginKeyword: "anonymous" }, this.options.tileOptions);
10976      this.loadMetadata();
10977  },
10978  loadMetadata: function () {
10979      this._callbackId = "_callback_" + this.id.replace(/\./g, "_");
10980      window[this._callbackId] = OpenLayers.Function.bind(OpenLayers.Layer.Bing.processMetadata, this);
10981      var a = OpenLayers.Util.applyDefaults({ key: this.key, jsonp: this._callbackId, include: "ImageryProviders" }, this.metadataParams),
10982          a = this.protocol + "//dev.virtualearth.net/REST/v1/Imagery/Metadata/" + this.type + "?" + OpenLayers.Util.getParameterString(a),
10983          b = document.createElement("script");
10984      b.type = "text/javascript";
10985      b.src = a;
10986      b.id = this._callbackId;
10987      document.getElementsByTagName("head")[0].appendChild(b);
10988  },
10989  initLayer: function () {
10990      var a = this.metadata.resourceSets[0].resources[0],
10991          b = a.imageUrl.replace("{quadkey}", "${quadkey}"),
10992          b = b.replace("{culture}", this.culture),
10993          b = b.replace(this.protocolRegex, this.protocol);
10994      this.url = [];
10995      for (var c = 0; c < a.imageUrlSubdomains.length; ++c) this.url.push(b.replace("{subdomain}", a.imageUrlSubdomains[c]));
10996      this.addOptions({ maxResolution: Math.min(this.serverResolutions[a.zoomMin], this.maxResolution || Number.POSITIVE_INFINITY), numZoomLevels: Math.min(a.zoomMax + 1 - a.zoomMin, this.numZoomLevels) }, !0);
10997      this.isBaseLayer || this.redraw();
10998      this.updateAttribution();
10999  },
11000  getURL: function (a) {
11001      if (this.url) {
11002          var b = this.getXYZ(a);
11003          a = b.x;
11004          for (var c = b.y, b = b.z, d = [], e = b; 0 < e; --e) {
11005              var f = "0",
11006                  g = 1 << (e - 1);
11007              0 != (a & g) && f++;
11008              0 != (c & g) && (f++, f++);
11009              d.push(f);
11010          }
11011          d = d.join("");
11012          a = this.selectUrl("" + a + c + b, this.url);
11013          return OpenLayers.String.format(a, { quadkey: d });
11014      }
11015  },
11016  updateAttribution: function () {
11017      var a = this.metadata;
11018      if (a.resourceSets && this.map && this.map.center) {
11019          var b = a.resourceSets[0].resources[0],
11020              c = this.map.getExtent().transform(this.map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326")),
11021              d = b.imageryProviders || [],
11022              e = OpenLayers.Util.indexOf(this.serverResolutions, this.get
11022ServerResolution()),
11023              b = "",
11024              f,
11025              g,
11026              h,
11027              k,
11028              l,
11029              m,
11030              n;
11031          g = 0;
11032          for (h = d.length; g < h; ++g)
11033              for (f = d[g], k = 0, l = f.coverageAreas.length; k < l; ++k) (n = f.coverageAreas[k]), (m = OpenLayers.Bounds.fromArray(n.bbox, !0)), c.intersectsBounds(m) && e <= n.zoomMax && e >= n.zoomMin && (b += f.attribution + " ");
11034          a = a.brandLogoUri.replace(this.protocolRegex, this.protocol);
11035          this.attribution = OpenLayers.String.format(this.attributionTemplate, { type: this.type.toLowerCase(), logo: a, copyrights: b });
11036          this.map && this.map.events.triggerEvent("changelayer", { layer: this, property: "attribution" });
11037      }
11038  },
11039  setMap: function () {
11040      OpenLayers.Layer.XYZ.prototype.setMap.apply(this, arguments);
11041      this.map.events.register("moveend", this, this.updateAttribution);
11042  },
11043  clone: function (a) {
11044      null == a && (a = new OpenLayers.Layer.Bing(this.options));
11045      return (a = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [a]));
11046  },
11047  destroy: function () {
11048      this.map && this.map.events.unregister("moveend", this, this.updateAttribution);
11049      OpenLayers.Layer.XYZ.prototype.destroy.apply(this, arguments);
11050  },
11051  CLASS_NAME: "OpenLayers.Layer.Bing",
11052});
11053OpenLayers.Layer.Bing.processMetadata = function (a) {
11054  this.metadata = a;
11055  this.initLayer();
11056  a = document.getElementById(this._callbackId);
11057  a.parentNode.removeChild(a);
11058  window[this._callbackId] = void 0;
11059  delete this._callbackId;
11060};
11061OpenLayers.StyleMap = OpenLayers.Class({
11062  styles: null,
11063  extendDefault: !0,
11064  initialize: function (a, b) {
11065      this.styles = {
11066          default: new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),
11067          select: new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),
11068          temporary: new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),
11069          delete: new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"]),
11070      };
11071      if (a instanceof OpenLayers.Style) (this.styles["default"] = a), (this.styles.select = a), (this.styles.temporary = a), (this.styles["delete"] = a);
11072      else if ("object" == typeof a)
11073          for (var c in a)
11074              if (a[c] instanceof OpenLayers.Style) this.styles[c] = a[c];
11075              else if ("object" == typeof a[c]) this.styles[c] = new OpenLayers.Style(a[c]);
11076              else {
11077                  this.styles["default"] = new OpenLayers.Style(a);
11078                  this.styles.select = new OpenLayers.Style(a);
11079                  this.styles.temporary = new OpenLayers.Style(a);
11080                  this.styles["delete"] = new OpenLayers.Style(a);
11081                  break;
11082              }
11083      OpenLayers.Util.extend(this, b);
11084  },
11085  destroy: function () {
11086      for (var a in this.styles) this.styles[a].destroy();
11087      this.styles = null;
11088  },
11089  createSymbolizer: function (a, b) {
11090      a || (a = new OpenLayers.Feature.Vector());
11091      this.styles[b] || (b = "default");
11092      a.renderIntent = b;
11093      var c = {};
11094      this.extendDefault && "default" != b && (c = this.styles["default"].createSymbolizer(a));
11095      return OpenLayers.Util.extend(c, this.styles[b].createSymbolizer(a));
11096  },
11097  addUniqueValueRules: function (a, b, c, d) {
11098      var e = [],
11099          f;
11100      for (f in c) e.push(new OpenLayers.Rule({ symbolizer: c[f], context: d, filter: new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.EQUAL_TO, property: b, value: f }) }));
11101      this.styles[a].addRules(e);
11102  },
11103  CLASS_NAME: "OpenLayers.StyleMap",
11104});
11105OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
11106  isBaseLayer: !1,
11107  isFixed: !1,
11108  features: null,
11109  filter: null,
11110  selectedFeatures: null,
11111  unrenderedFeatures: null,
11112  reportError: !0,
11113  style: null,
11114  styleMap: null,
11115  strategies: null,
11116  protocol: null,
11117  renderers: ["SVG", "VML", "Canvas"],
11118  renderer: null,
11119  rendererOptions: null,
11120  geometryType: null,
11121  drawn: !1,
11122  ratio: 1,
11123  initialize: function (a, b) {
11124      OpenLayers.Layer.prototype.initialize.apply(this, arguments);
11125      (this.renderer && this.renderer.supported()) || this.assignRenderer();
11126      (this.renderer && this.renderer.supported()) || ((this.renderer = null), this.displayError());
11127      this.styleMap || (this.styleMap = new OpenLayers.StyleMap());
11128      this.features = [];
11129      this.selectedFeatures = [];
11130      this.unrenderedFeatures = {};
11131      if (this.strategies) for (var c = 0, d = this.strategies.length; c < d; c++) this.strategies[c].setLayer(this);
11132  },
11133  destroy: function () {
11134      if (this.strategies) {
11135          var a, b, c;
11136          b = 0;
11137          for (c = this.strategies.length; b < c; b++) (a = this.strategies[b]), a.autoDestroy && a.destroy();
11138          this.strategies = null;
11139      }
11140      this.protocol && (this.protocol.autoDestroy && this.protocol.destroy(), (this.protocol = null));
11141      this.destroyFeatures();
11142      this.unrenderedFeatures = this.selectedFeatures = this.features = null;
11143      this.renderer && this.renderer.destroy();
11144      this.drawn = this.geometryType = this.renderer = null;
11145      OpenLayers.Layer.prototype.destroy.apply(this, arguments);
11146  },
11147  clone: function (a) {
11148      null == a && (a = new OpenLayers.Layer.Vector(this.name, this.getOptions()));
11149      a = OpenLayers.Layer.prototype.clone.apply(this, [a]);
11150      for (var b = this.features, c = b.length, d = Array(c), e = 0; e < c; ++e) d[e] = b[e].clone();
11151      a.features = d;
11152      return a;
11153  },
11154  refresh: function (a) {
11155      this.calculateInRange() && this.visibility && this.events.triggerEvent("refresh", a);
11156  },
11157  assignRenderer: function () {
11158      for (var a = 0, b = this.renderers.length; a < b; a++) {
11159          var c = this.renderers[a];
11160          if ((c = "function" == typeof c ? c : OpenLayers.Renderer[c]) && c.prototype.supported()) {
11161              this.renderer = new c(this.div, this.rendererOptions);
11162              break;
11163          }
11164      }
11165  },
11166  displayError: function () {
11167      this.reportError && OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported", { renderers: this.renderers.join("\n") }));
11168  },
11169  setMap: function (a) {
11170      OpenLayers.Layer.prototype.setMap.apply(this, arguments);
11171      if (this.renderer) {
11172          this.renderer.map = this.map;
11173          var b = this.map.getSize();
11174          b.w *= this.ratio;
11175          b.h *= this.ratio;
11176          this.renderer.setSize(b);
11177      } else this.map.removeLayer(this);
11178  },
11179  afterAdd: function () {
11180      if (this.strategies) {
11181          var a, b, c;
11182          b = 0;
11183          for (c = this.strategies.length; b < c; b++) (a = this.strategies[b]), a.autoActivate && a.activate();
11184      }
11185  },
11186  removeMap: function (a) {
11187      this.drawn = !1;
11188      if (this.strategies) {
11189          var b, c;
11190          b = 0;
11191          for (c = this.strategies.length; b < c; b++) (a = this.strategies[b]), a.autoActivate && a.deactivate();
11192      }
11193  },
11194  onMapResize: function () {
11195      OpenLayers.Layer.prototype.onMapResize.apply(this, arguments);
11196      var a = this.map.getSize();
11197      a.w *= this.ratio;
11198      a.h *= this.ratio;
11199      this.renderer.setSize(a);
11200  },
11201  moveTo: function (a, b, c) {
11202      OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
11203      var d = !0;
11204      if (!c) {
11205          this.renderer.root.style.visibility = "hidden";
11206          var d = this.map.getSize(),
11207              e = d.w,
11208              d = d.h,
11209              e = (e / 2) * this.ratio - e / 2,
11210              d = (d / 2) * this.ratio - d / 2,
11211              e = e + this.map.layerContainerOriginPx.x,
11212              e = -Math.round(e),
11213              d = d + this.map.layerContainerOriginPx.y,
11214              d = -Math.round(d);
11215          this.div.style.left = e + "px";
11216          this.div.style.top = d + "px";
11217          e = this.map.getExtent().scale(this.ratio);
11218          d = this.renderer.setExtent(e, b);
11219          this.renderer.root.style.visibility = "visible";
11220          !0 === OpenLayers.IS_GECKO && (this.div.scrollLeft = this.div.scrollLeft);
11221          if (!b && d) for (var f in this.unrenderedFeatures) (e = this.unrenderedFeatures[f]), this.drawFeature(e);
11222      }
11223      if (!this.drawn || b || !d) for (this.drawn = !0, f = 0, d = this.features.length; f < d; f++) (this.renderer.locked = f !== d - 1), (e = this.features[f]), this.drawFeature(e);
11224  },
11225  display: function (a) {
11226      OpenLayers.Layer.prototype.display.apply(this, arguments);
11227      var b = this.div.style.display;
11228      b != this.renderer.root.style.display && (this.renderer.root.style.display = b);
11229  },
11230  addFeatures: function (a, b) {
11231      OpenLayers.Util.isArray(a) || (a = [a]);
11232      var c = !b || !b.silent;
11233      if (c) {
11234          var d = { features: a };
11235          if (!1 === this.events.triggerEvent("beforefeaturesadded", d)) return;
11236          a = d.features;
11237      }
11238      for (var d = [], e = 0, f = a.length; e < f; e++) {
11239          this.renderer.locked = e != a.length - 1 ? !0 : !1;
11240          var g = a[e];
11241          if (this.geometryType && !(g.geometry instanceof this.geometryType)) throw new TypeError("addFeatures: component should be an " + this.geometryType.prototype.CLASS_NAME);
11242          g.layer = this;
11243          !g.style && this.style && (g.style = OpenLayers.Util.extend({}, this.style));
11244          if (c) {
11245              if (!1 === this.events.triggerEvent("beforefeatureadded", { feature: g })) continue;
11246              this.preFeatureInsert(g);
11247          }
11248          d.push(g);
11249          this.features.push(g);
11250          this.drawFeature(g);
11251          c && (this.events.triggerEvent("featureadded", { feature: g }), this.onFeatureInsert(g));
11252      }
11253      c && this.events.triggerEvent("featuresadded", { features: d });
11254  },
11255  removeFeatures: function (a, b) {
11256      if (a && 0 !== a.length) {
11257          if (a === this.features) return this.removeAllFeatures(b);
11258          OpenLayers.Util.isArray(a) || (a = [a]);
11259          a === this.selectedFeatures && (a = a.slice());
11260          var c = !b || !b.silent;
11261          c && this.events.triggerEvent("beforefeaturesremoved", { features: a });
11262          for (var d = a.length - 1; 0 <= d; d--) {
11263              this.renderer.locked = 0 != d && a[d - 1].geometry ? !0 : !1;
11264              var e = a[d];
11265              delete this.unrenderedFeatures[e.id];
11266              c && this.events.triggerEvent("beforefeatureremoved", { feature: e });
11267              this.features = OpenLayers.Util.removeItem(this.features, e);
11268              e.layer = null;
11269              e.geometry && this.renderer.eraseFeatures(e);
11270              -1 != OpenLayers.Util.indexOf(this.selectedFeatures, e) && OpenLayers.Util.removeItem(this.selectedFeatures, e);
11271              c && this.events.triggerEvent("featureremoved", { feature: e });
11272          }
11273          c && this.events.triggerEvent("featuresremoved", { features: a });
11274      }
11275  },
11276  removeAllFeatures: function (a) {
11277      a = !a || !a.silent;
11278      var b = this.features;
11279      a && this.events.triggerEvent("beforefeaturesremoved", { features: b });
11280      for (var c, d = b.length - 1; 0 <= d; d--) (c = b[d]), a && this.events.triggerEvent("beforefeatureremoved", { feature: c }), (c.layer = null), a && this.events.triggerEvent("featureremoved", { feature: c });
11281      this.renderer.clear();
11282      this.features = [];
11283      this.unrenderedFeatures = {};
11284      this.selectedFeatures = [];
11285      a && this.events.triggerEvent("featuresremoved", { features: b });
11286  },
11287  destroyFeatures: function (a, b) {
11288      void 0 == a && (a = this.features);
11289      if (a) {
11290          this.removeFeatures(a, b);
11291          for (var c = a.length - 1; 0 <= c; c--) a[c].destroy();
11292      }
11293  },
11294  drawFeature: function (a, b) {
11295      if (this.drawn) {
11296          if ("object" != typeof b) {
11297              b || a.state !== OpenLayers.State.DELETE || (b = "delete");
11298              var c = b || a.renderIntent;
11299              (b = a.style || this.style) || (b = this.styleMap.createSymbolizer(a, c));
11300          }
11301          c = this.renderer.drawFeature(a, b);
11302          !1 === c || null === c ? (this.unrenderedFeatures[a.id] = a) : delete this.unrenderedFeatures[a.id];
11303      }
11304  },
11305  eraseFeatures: function (a) {
11306      this.renderer.eraseFeatures(a);
11307  },
11308  getFeatureFromEvent: function (a) {
11309      if (!this.renderer) throw Error("getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.");
11310      var b = null;
11311      (a = this.renderer.getFeatureIdFromEvent(a)) && (b = "string" === typeof a ? this.getFeatureById(a) : a);
11312      return b;
11313  },
11314  getFeatureBy: function (a, b) {
11315      for (var c = null, d = 0, e = this.features.length; d < e; ++d)
11316          if (this.features[d][a] == b) {
11317              c = this.features[d];
11318              break;
11319          }
11320      return c;
11321  },
11322  getFeatureById: function (a) {
11323      return this.getFeatureBy("id", a);
11324  },
11325  getFeatureByFid: function (a) {
11326      return this.getFeatureBy("fid", a);
11327  },
11328  getFeaturesByAttribute: function (a, b) {
11329      var c,
11330          d,
11331          e = this.features.length,
11332          f = [];
11333      for (c = 0; c < e; c++) (d = this.features[c]) && d.attributes && d.attributes[a] === b && f.push(d);
11334      return f;
11335  },
11336  onFeatureInsert: function (a) {},
11337  preFeatureInsert: function (a) {},
11338  getDataExtent: function () {
11339      var a = null,
11340          b = this.features;
11341      if (b && 0 < b.length) for (var c = null, d = 0, e = b.length; d < e; d++) if ((c = b[d].geometry)) null === a && (a = new OpenLayers.Bounds()), a.extend(c.getBounds());
11342      return a;
11343  },
11344  CLASS_NAME: "OpenLayers.Layer.Vector",
11345});
11346OpenLayers.Layer.PointGrid = OpenLayers.Class(OpenLayers.Layer.Vector, {
11347  dx: null,
11348  dy: null,
11349  ratio: 1.5,
11350  maxFeatures: 250,
11351  rotation: 0,
11352  origin: null,
11353  gridBounds: null,
11354  initialize: function (a) {
11355      a = a || {};
11356      OpenLayers.Layer.Vector.prototype.initialize.apply(this, [a.name, a]);
11357  },
11358  setMap: function (a) {
11359      OpenLayers.Layer.Vector.prototype.setMap.apply(this, arguments);
11360      a.events.register("moveend", this, this.onMoveEnd);
11361  },
11362  removeMap: function (a) {
11363      a.events.unregister("moveend", this, this.onMoveEnd);
11364      OpenLayers.Layer.Vector.prototype.removeMap.apply(this, arguments);
11365  },
11366  setRatio: function (a) {
11367      this.ratio = a;
11368      this.updateGrid(!0);
11369  },
11370  setMaxFeatures: function (a) {
11371      this.maxFeatures = a;
11372      this.updateGrid(!0);
11373  },
11374  setSpacing: function (a, b) {
11375      this.dx = a;
11376      this.dy = b || a;
11377      this.updateGrid(!0);
11378  },
11379  setOrigin: function (a) {
11380      this.origin = a;
11381      this.updateGrid(!0);
11382  },
11383  getOrigin: function () {
11384      this.origin || (this.origin = this.map.getExtent().getCenterLonLat());
11385      return this.origin;
11386  },
11387  setRotation: function (a) {
11388      this.rotation = a;
11389      this.updateGrid(!0);
11390  },
11391  onMoveEnd: function () {
11392      this.updateGrid();
11393  },
11394  getViewBounds: function () {
11395      var a = this.map.getExtent();
11396      if (this.rotation) {
11397          var b = this.getOrigin(),
11398              b = new OpenLayers.Geometry.Point(b.lon, b.lat),
11399              a = a.toGeometry();
11400          a.rotate(-this.rotation, b);
11401          a = a.getBounds();
11402      }
11403      return a;
11404  },
11405  updateGrid: function (a) {
11406      if (a || this.invalidBounds()) {
11407          var b = this.getViewBounds(),
11408              c = this.getOrigin();
11409          a = new OpenLayers.Geometry.Point(c.lon, c.lat);
11410          var d = b.getWidth(),
11411              e = b.getHeight(),
11412              f = d / e,
11413              g = Math.sqrt((this.dx * this.dy * this.maxFeatures) / f),
11414              d = Math.min(d * this.ratio, g * f),
11415              e = Math.min(e * this.ratio, g),
11416              b = b.getCenterLonLat();
11417          this.gridBounds = new OpenLayers.Bounds(b.lon - d / 2, b.lat - e / 2, b.lon + d / 2, b.lat + e / 2);
11418          for (
11419              var b = Math.floor(e / this.dy),
11420                  d = Math.floor(d / this.dx),
11421                  e = c.lon + this.dx * Math.ceil((this.gridBounds.left - c.lon) / this.dx),
11422                  c = c.lat + this.dy * Math.ceil((this.gridBounds.bottom - c.lat) / this.dy),
11423                  g = Array(b * d),
11424                  h,
11425                  k = 0;
11426              k < d;
11427              ++k
11428          )
11429              for (var f = e + k * this.dx, l = 0; l < b; ++l) (h = c + l * this.dy), (h = new OpenLayers.Geometry.Point(f, h)), this.rotation && h.rotate(this.rotation, a), (g[k * b + l] = new OpenLayers.Feature.Vector(h));
11430          this.destroyFeatures(this.features, { silent: !0 });
11431          this.addFeatures(g, { silent: !0 });
11432      }
11433  },
11434  invalidBounds: function () {
11435      return !this.gridBounds || !this.gridBounds.containsBounds(this.getViewBounds());
11436  },
11437  CLASS_NAME: "OpenLayers.Layer.PointGrid",
11438});
11439OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
11440  wheelListener: null,
11441  interval: 0,
11442  maxDelta: Number.POSITIVE_INFINITY,
11443  delta: 0,
11444  cumulative: !0,
11445  initialize: function (a, b, c) {
11446      OpenLayers.Handler.prototype.initialize.apply(this, arguments);
11447      this.wheelListener = OpenLayers.Function.bindAsEventListener(this.onWheelEvent, this);
11448  },
11449  destroy: function () {
11450      OpenLayers.Handler.prototype.destroy.apply(this, arguments);
11451      this.wheelListener = null;
11452  },
11453  onWheelEvent: function (a) {
11454      if (this.map && this.checkModifiers(a)) {
11455          for (var b = !1, c = !1, d = !1, e = OpenLayers.Event.element(a); null != e && !d && !b; ) {
11456              if (!b)
11457                  try {
11458                      var f,
11459                          b = ((f = e.currentStyle ? e.currentStyle.overflow : document.defaultView.getComputedStyle(e, null).getPropertyValue("overflow")) && "auto" == f) || "scroll" == f;
11460                  } catch (g) {}
11461              if (!c && ((c = OpenLayers.Element.hasClass(e, "olScrollable")), !c))
11462                  for (var d = 0, h = this.map.layers.length; d < h; d++) {
11463                      var k = this.map.layers[d];
11464                      if (e == k.div || e == k.pane) {
11465                          c = !0;
11466                          break;
11467                      }
11468                  }
11469              d = e == this.map.div;
11470              e = e.parentNode;
11471          }
11472          if (!b && d) {
11473              if (c)
11474                  if (
11475                      ((b = 0),
11476                      a.wheelDelta ? ((b = a.wheelDelta), 0 === b % 160 && (b *= 0.75), (b /= 120)) : a.detail && (b = -(a.detail / Math.abs(a.detail))),
11477                      (this.delta += b),
11478                      window.clearTimeout(this._timeoutId),
11479                      this.interval && Math.abs(this.delta) < this.maxDelta)
11480                  ) {
11481                      var l = OpenLayers.Util.extend({}, a);
11482                      this._timeoutId = window.setTimeout(
11483                          OpenLayers.Function.bind(function () {
11484                              this.wheelZoom(l);
11485                          }, this),
11486                          this.interval
11487                      );
11488                  } else this.wheelZoom(a);
11489              OpenLayers.Event.stop(a);
11490          }
11491      }
11492  },
11493  wheelZoom: function (a) {
11494      var b = this.delta;
11495      this.delta = 0;
11496      b && ((a.xy = this.map.events.getMousePosition(a)), 0 > b ? this.callback("down", [a, this.cumulative ? Math.max(-this.maxDelta, b) : -1]) : this.callback("up", [a, this.cumulative ? Math.min(this.maxDelta, b) : 1]));
11497  },
11498  activate: function (a) {
11499      if (OpenLayers.Handler.prototype.activate.apply(this, arguments)) {
11500          var b = this.wheelListener;
11501          OpenLayers.Event.observe(window, "DOMMouseScroll", b);
11502          OpenLayers.Event.observe(window, "mousewheel", b);
11503          OpenLayers.Event.observe(document, "mousewheel", b);
11504          return !0;
11505      }
11506      return !1;
11507  },
11508  deactivate: function (a) {
11509      if (OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
11510          var b = this.wheelListener;
11511          OpenLayers.Event.stopObserving(window, "DOMMouseScroll", b);
11512          OpenLayers.Event.stopObserving(window, "mousewheel", b);
11513          OpenLayers.Event.stopObserving(document, "mousewheel", b);
11514          return !0;
11515      }
11516      return !1;
11517  },
11518  CLASS_NAME: "OpenLayers.Handler.MouseWheel",
11519});
11520OpenLayers.Symbolizer = OpenLayers.Class({
11521  zIndex: 0,
11522  initialize: function (a) {
11523      OpenLayers.Util.extend(this, a);
11524  },
11525  clone: function () {
11526      return new (eval(this.CLASS_NAME))(OpenLayers.Util.extend({}, this));
11527  },
11528  CLASS_NAME: "OpenLayers.Symbolizer",
11529});
11530OpenLayers.Symbolizer.Raster = OpenLayers.Class(OpenLayers.Symbolizer, {
11531  initialize: function (a) {
11532      OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
11533  },
11534  CLASS_NAME: "OpenLayers.Symbolizer.Raster",
11535});
11536OpenLayers.Rule = OpenLayers.Class({
11537  id: null,
11538  name: null,
11539  title: null,
11540  description: null,
11541  context: null,
11542  filter: null,
11543  elseFilter: !1,
11544  symbolizer: null,
11545  symbolizers: null,
11546  minScaleDenominator: null,
11547  maxScaleDenominator: null,
11548  initialize: function (a) {
11549      this.symbolizer = {};
11550      OpenLayers.Util.extend(this, a);
11551      this.symbolizers && delete this.symbolizer;
11552      this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
11553  },
11554  destroy: function () {
11555      for (var a in this.symbolizer) this.symbolizer[a] = null;
11556      this.symbolizer = null;
11557      delete this.symbolizers;
11558  },
11559  evaluate: function (a) {
11560      var b = this.getContext(a),
11561          c = !0;
11562      if (this.minScaleDenominator || this.maxScaleDenominator) var d = a.layer.map.getScale();
11563      this.minScaleDenominator && (c = d >= OpenLayers.Style.createLiteral(this.minScaleDenominator, b));
11564      c && this.maxScaleDenominator && (c = d < OpenLayers.Style.createLiteral(this.maxScaleDenominator, b));
11565      c && this.filter && (c = "OpenLayers.Filter.FeatureId" == this.filter.CLASS_NAME ? this.filter.evaluate(a) : this.filter.evaluate(b));
11566      return c;
11567  },
11568  getContext: function (a) {
11569      var b = this.context;
11570      b || (b = a.attributes || a.data);
11571      "function" == typeof this.context && (b = this.context(a));
11572      return b;
11573  },
11574  clone: function () {
11575      var a = OpenLayers.Util.extend({}, this);
11576      if (this.symbolizers) {
11577          var b = this.symbolizers.length;
11578          a.symbolizers = Array(b);
11579          for (var c = 0; c < b; ++c) a.symbolizers[c] = this.symbolizers[c].clone();
11580      } else {
11581          a.symbolizer = {};
11582          for (var d in this.symbolizer) (b = this.symbolizer[d]), (c = typeof b), "object" === c ? (a.symbolizer[d] = OpenLayers.Util.extend({}, b)) : "string" === c && (a.symbolizer[d] = b);
11583      }
11584      a.filter = this.filter && this.filter.clone();
11585      a.context = this.context && OpenLayers.Util.extend({}, this.context);
11586      return new OpenLayers.Rule(a);
11587  },
11588  CLASS_NAME: "OpenLayers.Rule",
11589});
11590OpenLayers.Format.SLD = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { profile: null, defaultVersion: "1.0.0", stringifyOutput: !0, namedLayersAsArray: !1, CLASS_NAME: "OpenLayers.Format.SLD" });
11591OpenLayers.Symbolizer.Polygon = OpenLayers.Class(OpenLayers.Symbolizer, {
11592  initialize: function (a) {
11593      OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
11594  },
11595  CLASS_NAME: "OpenLayers.Symbolizer.Polygon",
11596});
11597OpenLayers.Format.GML.v2 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
11598  schemaLocation: "http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",
11599  initialize: function (a) {
11600      OpenLayers.Format.GML.Base.prototype.initialize.apply(this, [a]);
11601  },
11602  readers: {
11603      gml: OpenLayers.Util.applyDefaults(
11604          {
11605              outerBoundaryIs: function (a, b) {
11606                  var c = {};
11607                  this.readChildNodes(a, c);
11608                  b.outer = c.components[0];
11609              },
11610              innerBoundaryIs: function (a, b) {
11611                  var c = {};
11612                  this.readChildNodes(a, c);
11613                  b.inner.push(c.components[0]);
11614              },
11615              Box: function (a, b) {
11616                  var c = {};
11617                  this.readChildNodes(a, c);
11618                  b.components || (b.components = []);
11619                  var d = c.points[0],
11620                      c = c.points[1];
11621                  b.components.push(new OpenLayers.Bounds(d.x, d.y, c.x, c.y));
11622              },
11623          },
11624          OpenLayers.Format.GML.Base.prototype.readers.gml
11625      ),
11626      feature: OpenLayers.Format.GML.Base.prototype.readers.feature,
11627      wfs: OpenLayers.Format.GML.Base.prototype.readers.wfs,
11628  },
11629  write: function (a) {
11630      var b;
11631      b = OpenLayers.Util.isArray(a) ? "wfs:FeatureCollection" : "gml:featureMember";
11632      a = this.writeNode(b, a);
11633      this.setAttributeNS(a, this.namespaces.xsi, "xsi:schemaLocation", this.schemaLocation);
11634      return OpenLayers.Format.XML.prototype.write.apply(this, [a]);
11635  },
11636  writers: {
11637      gml: OpenLayers.Util.applyDefaults(
11638          {
11639              Point: function (a) {
11640                  var b = this.createElementNSPlus("gml:Point");
11641                  this.writeNode("coordinates", [a], b);
11642                  return b;
11643              },
11644              coordinates: function (a) {
11645                  for (var b = a.length, c = Array(b), d, e = 0; e < b; ++e) (d = a[e]), (c[e] = this.xy ? d.x + "," + d.y : d.y + "," + d.x), void 0 != d.z && (c[e] += "," + d.z);
11646                  return this.createElementNSPlus("gml:coordinates", { attributes: { decimal
11646: ".", cs: ",", ts: " " }, value: 1 == b ? c[0] : c.join(" ") });
11647              },
11648              LineString: function (a) {
11649                  var b = this.createElementNSPlus("gml:LineString");
11650                  this.writeNode("coordinates", a.components, b);
11651                  return b;
11652              },
11653              Polygon: function (a) {
11654                  var b = this.createElementNSPlus("gml:Polygon");
11655                  this.writeNode("outerBoundaryIs", a.components[0], b);
11656                  for (var c = 1; c < a.components.length; ++c) this.writeNode("innerBoundaryIs", a.components[c], b);
11657                  return b;
11658              },
11659              outerBoundaryIs: function (a) {
11660                  var b = this.createElementNSPlus("gml:outerBoundaryIs");
11661                  this.writeNode("LinearRing", a, b);
11662                  return b;
11663              },
11664              innerBoundaryIs: function (a) {
11665                  var b = this.createElementNSPlus("gml:innerBoundaryIs");
11666                  this.writeNode("LinearRing", a, b);
11667                  return b;
11668              },
11669              LinearRing: function (a) {
11670                  var b = this.createElementNSPlus("gml:LinearRing");
11671                  this.writeNode("coordinates", a.components, b);
11672                  return b;
11673              },
11674              Box: function (a) {
11675                  var b = this.createElementNSPlus("gml:Box");
11676                  this.writeNode(
11677                      "coordinates",
11678                      [
11679                          { x: a.left, y: a.bottom },
11680                          { x: a.right, y: a.top },
11681                      ],
11682                      b
11683                  );
11684                  this.srsName && b.setAttribute("srsName", this.srsName);
11685                  return b;
11686              },
11687          },
11688          OpenLayers.Format.GML.Base.prototype.writers.gml
11689      ),
11690      feature: OpenLayers.Format.GML.Base.prototype.writers.feature,
11691      wfs: OpenLayers.Format.GML.Base.prototype.writers.wfs,
11692  },
11693  CLASS_NAME: "OpenLayers.Format.GML.v2",
11694});
11695OpenLayers.Format.Filter.v1_0_0 = OpenLayers.Class(OpenLayers.Format.GML.v2, OpenLayers.Format.Filter.v1, {
11696  VERSION: "1.0.0",
11697  schemaLocation: "http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",
11698  initialize: function (a) {
11699      OpenLayers.Format.GML.v2.prototype.initialize.apply(this, [a]);
11700  },
11701  readers: {
11702      ogc: OpenLayers.Util.applyDefaults(
11703          {
11704              PropertyIsEqualTo: function (a, b) {
11705                  var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.EQUAL_TO });
11706                  this.readChildNodes(a, c);
11707                  b.filters.push(c);
11708              },
11709              PropertyIsNotEqualTo: function (a, b) {
11710                  var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.NOT_EQUAL_TO });
11711                  this.readChildNodes(a, c);
11712                  b.filters.push(c);
11713              },
11714              PropertyIsLike: function (a, b) {
11715                  var c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.LIKE });
11716                  this.readChildNodes(a, c);
11717                  var d = a.getAttribute("wildCard"),
11718                      e = a.getAttribute("singleChar"),
11719                      f = a.getAttribute("escape");
11720                  c.value2regex(d, e, f);
11721                  b.filters.push(c);
11722              },
11723          },
11724          OpenLayers.Format.Filter.v1.prototype.readers.ogc
11725      ),
11726      gml: OpenLayers.Format.GML.v2.prototype.readers.gml,
11727      feature: OpenLayers.Format.GML.v2.prototype.readers.feature,
11728  },
11729  writers: {
11730      ogc: OpenLayers.Util.applyDefaults(
11731          {
11732              PropertyIsEqualTo: function (a) {
11733                  var b = this.createElementNSPlus("ogc:PropertyIsEqualTo");
11734                  this.writeNode("PropertyName", a, b);
11735                  this.writeOgcExpression(a.value, b);
11736                  return b;
11737              },
11738              PropertyIsNotEqualTo: function (a) {
11739                  var b = this.createElementNSPlus("ogc:PropertyIsNotEqualTo");
11740                  this.writeNode("PropertyName", a, b);
11741                  this.writeOgcExpression(a.value, b);
11742                  return b;
11743              },
11744              PropertyIsLike: function (a) {
11745                  var b = this.createElementNSPlus("ogc:PropertyIsLike", { attributes: { wildCard: "*", singleChar: ".", escape: "!" } });
11746                  this.writeNode("PropertyName", a, b);
11747                  this.writeNode("Literal", a.regex2value(), b);
11748                  return b;
11749              },
11750              BBOX: function (a) {
11751                  var b = this.createElementNSPlus("ogc:BBOX");
11752                  a.property && this.writeNode("PropertyName", a, b);
11753                  var c = this.writeNode("gml:Box", a.value, b);
11754                  a.projection && c.setAttribute("srsName", a.projection);
11755                  return b;
11756              },
11757          },
11758          OpenLayers.Format.Filter.v1.prototype.writers.ogc
11759      ),
11760      gml: OpenLayers.Format.GML.v2.prototype.writers.gml,
11761      feature: OpenLayers.Format.GML.v2.prototype.writers.feature,
11762  },
11763  writeSpatial: function (a, b) {
11764      var c = this.createElementNSPlus("ogc:" + b);
11765      this.writeNode("PropertyName", a, c);
11766      if (a.value instanceof OpenLayers.Filter.Function) this.writeNode("Function", a.value, c);
11767      else {
11768          var d;
11769          d = a.value instanceof OpenLayers.Geometry ? this.writeNode("feature:_geometry", a.value).firstChild : this.writeNode("gml:Box", a.value);
11770          a.projection && d.setAttribute("srsName", a.projection);
11771          c.appendChild(d);
11772      }
11773      return c;
11774  },
11775  CLASS_NAME: "OpenLayers.Format.Filter.v1_0_0",
11776});
11777OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, OpenLayers.Format.WFST.v1, {
11778  version: "1.0.0",
11779  srsNameInQuery: !1,
11780  schemaLocations: { wfs: "http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" },
11781  initialize: function (a) {
11782      OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this, [a]);
11783      OpenLayers.Format.WFST.v1.prototype.initialize.apply(this, [a]);
11784  },
11785  readNode: function (a, b, c) {
11786      return OpenLayers.Format.GML.v2.prototype.readNode.apply(this, arguments);
11787  },
11788  readers: {
11789      wfs: OpenLayers.Util.applyDefaults(
11790          {
11791              WFS_TransactionResponse: function (a, b) {
11792                  b.insertIds = [];
11793                  b.success = !1;
11794                  this.readChildNodes(a, b);
11795              },
11796              InsertResult: function (a, b) {
11797                  var c = { fids: [] };
11798                  this.readChildNodes(a, c);
11799                  b.insertIds = b.insertIds.concat(c.fids);
11800              },
11801              TransactionResult: function (a, b) {
11802                  this.readChildNodes(a, b);
11803              },
11804              Status: function (a, b) {
11805                  this.readChildNodes(a, b);
11806              },
11807              SUCCESS: function (a, b) {
11808                  b.success = !0;
11809              },
11810          },
11811          OpenLayers.Format.WFST.v1.prototype.readers.wfs
11812      ),
11813      gml: OpenLayers.Format.GML.v2.prototype.readers.gml,
11814      feature: OpenLayers.Format.GML.v2.prototype.readers.feature,
11815      ogc: OpenLayers.Format.Filter.v1_0_0.prototype.readers.ogc,
11816  },
11817  writers: {
11818      wfs: OpenLayers.Util.applyDefaults(
11819          {
11820              Query: function (a) {
11821                  a = OpenLayers.Util.extend({ featureNS: this.featureNS, featurePrefix: this.featurePrefix, featureType: this.featureType, srsName: this.srsName, srsNameInQuery: this.srsNameInQuery }, a);
11822                  var b = a.featurePrefix,
11823                      c = this.createElementNSPlus("wfs:Query", { attributes: { typeName: (b ? b + ":" : "") + a.featureType } });
11824                  a.srsNameInQuery && a.srsName && c.setAttribute("srsName", a.srsName);
11825                  a.featureNS && c.setAttribute("xmlns:" + b, a.featureNS);
11826                  if (a.propertyNames) for (var b = 0, d = a.propertyNames.length; b < d; b++) this.writeNode("ogc:PropertyName", { property: a.propertyNames[b] }, c);
11827                  a.filter && (this.setFilterProperty(a.filter), this.writeNode("ogc:Filter", a.filter, c));
11828                  return c;
11829              },
11830          },
11831          OpenLayers.Format.WFST.v1.prototype.writers.wfs
11832      ),
11833      gml: OpenLayers.Format.GML.v2.prototype.writers.gml,
11834      feature: OpenLayers.Format.GML.v2.prototype.writers.feature,
11835      ogc: OpenLayers.Format.Filter.v1_0_0.prototype.writers.ogc,
11836  },
11837  CLASS_NAME: "OpenLayers.Format.WFST.v1_0_0",
11838});
11839OpenLayers.ElementsIndexer = OpenLayers.Class({
11840  maxZIndex: null,
11841  order: null,
11842  indices: null,
11843  compare: null,
11844  initialize: function (a) {
11845      this.compare = a ? OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER : OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;
11846      this.clear();
11847  },
11848  insert: function (a) {
11849      this.exists(a) && this.remove(a);
11850      var b = a.id;
11851      this.determineZIndex(a);
11852      for (var c = -1, d = this.order.length, e; 1 < d - c; ) (e = parseInt((c + d) / 2)), 0 < this.compare(this, a, OpenLayers.Util.getElement(this.order[e])) ? (c = e) : (d = e);
11853      this.order.splice(d, 0, b);
11854      this.indices[b] = this.getZIndex(a);
11855      return this.getNextElement(d);
11856  },
11857  remove: function (a) {
11858      a = a.id;
11859      var b = OpenLayers.Util.indexOf(this.order, a);
11860      0 <= b && (this.order.splice(b, 1), delete this.indices[a], (this.maxZIndex = 0 < this.order.length ? this.indices[this.order[this.order.length - 1]] : 0));
11861  },
11862  clear: function () {
11863      this.order = [];
11864      this.indices = {};
11865      this.maxZIndex = 0;
11866  },
11867  exists: function (a) {
11868      return null != this.indices[a.id];
11869  },
11870  getZIndex: function (a) {
11871      return a._style.graphicZIndex;
11872  },
11873  determineZIndex: function (a) {
11874      var b = a._style.graphicZIndex;
11875      null == b ? ((b = this.maxZIndex), (a._style.graphicZIndex = b)) : b > this.maxZIndex && (this.maxZIndex = b);
11876  },
11877  getNextElement: function (a) {
11878      a += 1;
11879      if (a < this.order.length) {
11880          var b = OpenLayers.Util.getElement(this.order[a]);
11881          void 0 == b && (b = this.getNextElement(a));
11882          return b;
11883      }
11884      return null;
11885  },
11886  CLASS_NAME: "OpenLayers.ElementsIndexer",
11887});
11888OpenLayers.ElementsIndexer.IndexingMethods = {
11889  Z_ORDER: function (a, b, c) {
11890      b = a.getZIndex(b);
11891      var d = 0;
11892      c && ((a = a.getZIndex(c)), (d = b - a));
11893      return d;
11894  },
11895  Z_ORDER_DRAWING_ORDER: function (a, b, c) {
11896      a = OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a, b, c);
11897      c && 0 == a && (a = 1);
11898      return a;
11899  },
11900  Z_ORDER_Y_ORDER: function (a, b, c) {
11901      a = OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a, b, c);
11902      c && 0 === a && ((b = c._boundsBottom - b._boundsBottom), (a = 0 === b ? 1 : b));
11903      return a;
11904  },
11905};
11906OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
11907  rendererRoot: null,
11908  root: null,
11909  vectorRoot: null,
11910  textRoot: null,
11911  xmlns: null,
11912  xOffset: 0,
11913  indexer: null,
11914  BACKGROUND_ID_SUFFIX: "_background",
11915  LABEL_ID_SUFFIX: "_label",
11916  LABEL_OUTLINE_SUFFIX: "_outline",
11917  initialize: function (a, b) {
11918      OpenLayers.Renderer.prototype.initialize.apply(this, arguments);
11919      this.rendererRoot = this.createRenderRoot();
11920      this.root = this.createRoot("_root");
11921      this.vectorRoot = this.createRoot("_vroot");
11922      this.textRoot = this.createRoot("_troot");
11923      this.root.appendChild(this.vectorRoot);
11924      this.root.appendChild(this.textRoot);
11925      this.rendererRoot.appendChild(this.root);
11926      this.container.appendChild(this.rendererRoot);
11927      b && (b.zIndexing || b.yOrdering) && (this.indexer = new OpenLayers.ElementsIndexer(b.yOrdering));
11928  },
11929  destroy: function () {
11930      this.clear();
11931      this.xmlns = this.root = this.rendererRoot = null;
11932      OpenLayers.Renderer.prototype.destroy.apply(this, arguments);
11933  },
11934  clear: function () {
11935      var a,
11936          b = this.vectorRoot;
11937      if (b) for (; (a = b.firstChild); ) b.removeChild(a);
11938      if ((b = this.textRoot)) for (; (a = b.firstChild); ) b.removeChild(a);
11939      this.indexer && this.indexer.clear();
11940  },
11941  setExtent: function (a, b) {
11942      var c = OpenLayers.Renderer.prototype.setExtent.apply(this, arguments),
11943          d = this.getResolution();
11944      if (this.map.baseLayer && this.map.baseLayer.wrapDateLine) {
11945          var e,
11946              f = a.getWidth() / this.map.getExtent().getWidth();
11947          a = a.scale(1 / f);
11948          f = this.map.getMaxExtent();
11949          f.right > a.left && f.right < a.right ? (e = !0) : f.left > a.left && f.left < a.right && (e = !1);
11950          if (e !== this.rightOfDateLine || b) (c = !1), (this.xOffset = !0 === e ? f.getWidth() / d : 0);
11951          this.rightOfDateLine = e;
11952      }
11953      return c;
11954  },
11955  getNodeType: function (a, b) {},
11956  drawGeometry: function (a, b, c) {
11957      var d = a.CLASS_NAME,
11958          e = !0;
11959      if ("OpenLayers.Geometry.Collection" == d || "OpenLayers.Geometry.MultiPoint" == d || "OpenLayers.Geometry.MultiLineString" == d || "OpenLayers.Geometry.MultiPolygon" == d) {
11960          for (var d = 0, f = a.components.length; d < f; d++) e = this.drawGeometry(a.components[d], b, c) && e;
11961          return e;
11962      }
11963      d = e = !1;
11964      "none" != b.display && (b.backgroundGraphic ? this.redrawBackgroun
11964dNode(a.id, a, b, c) : (d = !0), (e = this.redrawNode(a.id, a, b, c)));
11965      !1 == e && (b = document.getElementById(a.id)) && (b._style.backgroundGraphic && (d = !0), b.parentNode.removeChild(b));
11966      d && (b = document.getElementById(a.id + this.BACKGROUND_ID_SUFFIX)) && b.parentNode.removeChild(b);
11967      return e;
11968  },
11969  redrawNode: function (a, b, c, d) {
11970      c = this.applyDefaultSymbolizer(c);
11971      a = this.nodeFactory(a, this.getNodeType(b, c));
11972      a._featureId = d;
11973      a._boundsBottom = b.getBounds().bottom;
11974      a._geometryClass = b.CLASS_NAME;
11975      a._style = c;
11976      b = this.drawGeometryNode(a, b, c);
11977      if (!1 === b) return !1;
11978      a = b.node;
11979      this.indexer ? ((c = this.indexer.insert(a)) ? this.vectorRoot.insertBefore(a, c) : this.vectorRoot.appendChild(a)) : a.parentNode !== this.vectorRoot && this.vectorRoot.appendChild(a);
11980      this.postDraw(a);
11981      return b.complete;
11982  },
11983  redrawBackgroundNode: function (a, b, c, d) {
11984      c = OpenLayers.Util.extend({}, c);
11985      c.externalGraphic = c.backgroundGraphic;
11986      c.graphicXOffset = c.backgroundXOffset;
11987      c.graphicYOffset = c.backgroundYOffset;
11988      c.graphicZIndex = c.backgroundGraphicZIndex;
11989      c.graphicWidth = c.backgroundWidth || c.graphicWidth;
11990      c.graphicHeight = c.backgroundHeight || c.graphicHeight;
11991      c.backgroundGraphic = null;
11992      c.backgroundXOffset = null;
11993      c.backgroundYOffset = null;
11994      c.backgroundGraphicZIndex = null;
11995      return this.redrawNode(a + this.BACKGROUND_ID_SUFFIX, b, c, null);
11996  },
11997  drawGeometryNode: function (a, b, c) {
11998      c = c || a._style;
11999      var d = { isFilled: void 0 === c.fill ? !0 : c.fill, isStroked: void 0 === c.stroke ? !!c.strokeWidth : c.stroke },
12000          e;
12001      switch (b.CLASS_NAME) {
12002          case "OpenLayers.Geometry.Point":
12003              !1 === c.graphic && ((d.isFilled = !1), (d.isStroked = !1));
12004              e = this.drawPoint(a, b);
12005              break;
12006          case "OpenLayers.Geometry.LineString":
12007              d.isFilled = !1;
12008              e = this.drawLineString(a, b);
12009              break;
12010          case "OpenLayers.Geometry.LinearRing":
12011              e = this.drawLinearRing(a, b);
12012              break;
12013          case "OpenLayers.Geometry.Polygon":
12014              e = this.drawPolygon(a, b);
12015              break;
12016          case "OpenLayers.Geometry.Rectangle":
12017              e = this.drawRectangle(a, b);
12018      }
12019      a._options = d;
12020      return !1 != e ? { node: this.setStyle(a, c, d, b), complete: e } : !1;
12021  },
12022  postDraw: function (a) {},
12023  drawPoint: function (a, b) {},
12024  drawLineString: function (a, b) {},
12025  drawLinearRing: function (a, b) {},
12026  drawPolygon: function (a, b) {},
12027  drawRectangle: function (a, b) {},
12028  drawCircle: function (a, b) {},
12029  removeText: function (a) {
12030      var b = document.getElementById(a + this.LABEL_ID_SUFFIX);
12031      b && this.textRoot.removeChild(b);
12032      (a = document.getElementById(a + this.LABEL_OUTLINE_SUFFIX)) && this.textRoot.removeChild(a);
12033  },
12034  getFeatureIdFromEvent: function (a) {
12035      var b = a.target,
12036          c = b && b.correspondingUseElement;
12037      return (c ? c : b || a.srcElement)._featureId;
12038  },
12039  eraseGeometry: function (a, b) {
12040      if ("OpenLayers.Geometry.MultiPoint" == a.CLASS_NAME || "OpenLayers.Geometry.MultiLineString" == a.CLASS_NAME || "OpenLayers.Geometry.MultiPolygon" == a.CLASS_NAME || "OpenLayers.Geometry.Collection" == a.CLASS_NAME)
12041          for (var c = 0, d = a.components.length; c < d; c++) this.eraseGeometry(a.components[c], b);
12042      else
12043          (c = OpenLayers.Util.getElement(a.id)) &&
12044              c.parentNode &&
12045              (c.geometry && (c.geometry.destroy(), (c.geometry = null)),
12046              c.parentNode.removeChild(c),
12047              this.indexer && this.indexer.remove(c),
12048              c._style.backgroundGraphic && (c = OpenLayers.Util.getElement(a.id + this.BACKGROUND_ID_SUFFIX)) && c.parentNode && c.parentNode.removeChild(c));
12049  },
12050  nodeFactory: function (a, b) {
12051      var c = OpenLayers.Util.getElement(a);
12052      c ? this.nodeTypeCompare(c, b) || (c.parentNode.removeChild(c), (c = this.nodeFactory(a, b))) : (c = this.createNode(b, a));
12053      return c;
12054  },
12055  nodeTypeCompare: function (a, b) {},
12056  createNode: function (a, b) {},
12057  moveRoot: function (a) {
12058      var b = this.root;
12059      a.root.parentNode == this.rendererRoot && (b = a.root);
12060      b.parentNode.removeChild(b);
12061      a.rendererRoot.appendChild(b);
12062  },
12063  getRenderLayerId: function () {
12064      return this.root.parentNode.parentNode.id;
12065  },
12066  isComplexSymbol: function (a) {
12067      return "circle" != a && !!a;
12068  },
12069  CLASS_NAME: "OpenLayers.Renderer.Elements",
12070});
12071OpenLayers.Control.ArgParser = OpenLayers.Class(OpenLayers.Control, {
12072  center: null,
12073  zoom: null,
12074  layers: null,
12075  displayProjection: null,
12076  getParameters: function (a) {
12077      a = a || window.location.href;
12078      var b = OpenLayers.Util.getParameters(a),
12079          c = a.indexOf("#");
12080      0 < c && ((a = "?" + a.substring(c + 1, a.length)), OpenLayers.Util.extend(b, OpenLayers.Util.getParameters(a)));
12081      return b;
12082  },
12083  setMap: function (a) {
12084      OpenLayers.Control.prototype.setMap.apply(this, arguments);
12085      for (var b = 0, c = this.map.controls.length; b < c; b++) {
12086          var d = this.map.controls[b];
12087          if (d != this && "OpenLayers.Control.ArgParser" == d.CLASS_NAME) {
12088              d.displayProjection != this.displayProjection && (this.displayProjection = d.displayProjection);
12089              break;
12090          }
12091      }
12092      b == this.map.controls.length &&
12093          ((b = this.getParameters()),
12094          b.layers && ((this.layers = b.layers), this.map.events.register("addlayer", this, this.configureLayers), this.configureLayers()),
12095          b.lat && b.lon && ((this.center = new OpenLayers.LonLat(parseFloat(b.lon), parseFloat(b.lat))), b.zoom && (this.zoom = parseFloat(b.zoom)), this.map.events.register("changebaselayer", this, this.setCenter), this.setCenter()));
12096  },
12097  setCenter: function () {
12098      this.map.baseLayer &&
12099          (this.map.events.unregister("changebaselayer", this, this.setCenter), this.displayProjection && this.center.transform(this.displayProjection, this.map.getProjectionObject()), this.map.setCenter(this.center, this.zoom));
12100  },
12101  configureLayers: function () {
12102      if (this.layers.length == this.map.layers.length) {
12103          this.map.events.unregister("addlayer", this, this.configureLayers);
12104          for (var a = 0, b = this.layers.length; a < b; a++) {
12105              var c = this.map.layers[a],
12106                  d = this.layers.charAt(a);
12107              "B" == d ? this.map.setBaseLayer(c) : ("T" != d && "F" != d) || c.setVisibility("T" == d);
12108          }
12109      }
12110  },
12111  CLASS_NAME: "OpenLayers.Control.ArgParser",
12112});
12113OpenLayers.Control.Permalink = OpenLayers.Class(OpenLayers.Control, {
12114  argParserClass: OpenLayers.Control.ArgParser,
12115  element: null,
12116  anchor: !1,
12117  base: "",
12118  displayProjection: null,
12119  initialize: function (a, b, c) {
12120      null === a || "object" != typeof a || OpenLayers.Util.isElement(a)
12121          ? (OpenLayers.Control.prototype.initialize.apply(this, [c]), (this.element = OpenLayers.Util.getElement(a)), (this.base = b || document.location.href))
12122          : ((this.base = document.location.href), OpenLayers.Control.prototype.initialize.apply(this, [a]), null != this.element && (this.element = OpenLayers.Util.getElement(this.element)));
12123  },
12124  destroy: function () {
12125      this.element && this.element.parentNode == this.div && (this.div.removeChild(this.element), (this.element = null));
12126      this.map && this.map.events.unregister("moveend", this, this.updateLink);
12127      OpenLayers.Control.prototype.destroy.apply(this, arguments);
12128  },
12129  setMap: function (a) {
12130      OpenLayers.Control.prototype.setMap.apply(this, arguments);
12131      for (var b = 0, c = this.map.controls.length; b < c; b++) {
12132          var d = this.map.controls[b];
12133          if (d.CLASS_NAME == this.argParserClass.CLASS_NAME) {
12134              d.displayProjection != this.displayProjection && (this.displayProjection = d.displayProjection);
12135              break;
12136          }
12137      }
12138      b == this.map.controls.length && this.map.addControl(new this.argParserClass({ displayProjection: this.displayProjection }));
12139  },
12140  draw: function () {
12141      OpenLayers.Control.prototype.draw.apply(this, arguments);
12142      this.element || this.anchor || ((this.element = document.createElement("a")), (this.element.innerHTML = OpenLayers.i18n("Permalink")), (this.element.href = ""), this.div.appendChild(this.element));
12143      this.map.events.on({ moveend: this.updateLink, changelayer: this.updateLink, changebaselayer: this.updateLink, scope: this });
12144      this.updateLink();
12145      return this.div;
12146  },
12147  updateLink: function () {
12148      var a = this.anchor ? "#" : "?",
12149          b = this.base,
12150          c = null;
12151      -1 != b.indexOf("#") && !1 == this.anchor && (c = b.substring(b.indexOf("#"), b.length));
12152      -1 != b.indexOf(a) && (b = b.substring(0, b.indexOf(a)));
12153      b = b.split("#")[0] + a + OpenLayers.Util.getParameterString(this.createParams());
12154      c && (b += c);
12155      this.anchor && !this.element ? (window.location.href = b) : (this.element.href = b);
12156  },
12157  createParams: function (a, b, c) {
12158      a = a || this.map.getCenter();
12159      var d = OpenLayers.Util.getParameters(this.base);
12160      if (a)
12161          for (
12162              d.zoom = b || this.map.getZoom(),
12163                  b = a.lat,
12164                  a = a.lon,
12165                  this.displayProjection && ((b = OpenLayers.Projection.transform({ x: a, y: b }, this.map.getProjectionObject(), this.displayProjection)), (a = b.x), (b = b.y)),
12166                  d.lat = Math.round(1e5 * b) / 1e5,
12167                  d.lon = Math.round(1e5 * a) / 1e5,
12168                  c = c || this.map.layers,
12169                  d.layers = "",
12170                  a = 0,
12171                  b = c.length;
12172              a < b;
12173              a++
12174          ) {
12175              var e = c[a];
12176              d.layers = e.isBaseLayer ? d.layers + (e == this.map.baseLayer ? "B" : "0") : d.layers + (e.getVisibility() ? "T" : "F");
12177          }
12178      return d;
12179  },
12180  CLASS_NAME: "OpenLayers.Control.Permalink",
12181});
12182OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
12183  serviceVersion: "1.0.0",
12184  layername: null,
12185  type: null,
12186  isBaseLayer: !0,
12187  tileOrigin: null,
12188  serverResolutions: null,
12189  zoomOffset: 0,
12190  initialize: function (a, b, c) {
12191      var d = [];
12192      d.push(a, b, {}, c);
12193      OpenLayers.Layer.Grid.prototype.initialize.apply(this, d);
12194  },
12195  clone: function (a) {
12196      null == a && (a = new OpenLayers.Layer.TMS(this.name, this.url, this.getOptions()));
12197      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
12198  },
12199  getURL: function (a) {
12200      a = this.adjustBounds(a);
12201      var b = this.getServerResolution(),
12202          c = Math.round((a.left - this.tileOrigin.lon) / (b * this.tileSize.w));
12203      a = Math.round((a.bottom - this.tileOrigin.lat) / (b * this.tileSize.h));
12204      b = this.getServerZoom();
12205      c = this.serviceVersion + "/" + this.layername + "/" + b + "/" + c + "/" + a + "." + this.type;
12206      a = this.url;
12207      OpenLayers.Util.isArray(a) && (a = this.selectUrl(c, a));
12208      return a + c;
12209  },
12210  setMap: function (a) {
12211      OpenLayers.Layer.Grid.prototype.setMap.apply(this, arguments);
12212      this.tileOrigin || (this.tileOrigin = new OpenLayers.LonLat(this.map.maxExtent.left, this.map.maxExtent.bottom));
12213  },
12214  CLASS_NAME: "OpenLayers.Layer.TMS",
12215});
12216OpenLayers.Format.WCSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { defaultVersion: "1.1.0", CLASS_NAME: "OpenLayers.Format.WCSCapabilities" });
12217OpenLayers.Format.WCSCapabilities.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
12218  regExes: { trimSpace: /^\s*|\s*$/g, splitSpace: /\s+/ },
12219  defaultPrefix: "wcs",
12220  read: function (a) {
12221      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
12222      a && 9 == a.nodeType && (a = a.documentElement);
12223      var b = {};
12224      this.readNode(a, b);
12225      return b;
12226  },
12227  CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1",
12228});
12229OpenLayers.Format.WCSCapabilities.v1_0_0 = OpenLayers.Class(OpenLayers.Format.WCSCapabilities.v1, {
12230  namespaces: { wcs: "http://www.opengis.net/wcs", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance", ows: "http://www.opengis.net/ows" },
12231  errorProperty: "service",
12232  readers: {
12233      wcs: {
12234          WCS_Capabilities: function (a, b) {
12235              this.readChildNodes(a, b);
12236          },
12237          Service: function (a, b) {
12238              b.service = {};
12239              this.readChildNodes(a, b.service);
12240          },
12241          name: function (a, b) {
12242              b.name = this.getChildValue(a);
12243          },
12244          label: function (a, b) {
12245              b.label = this.getChildValue(a);
12246          },
12247          keywords: function (a, b) {
12248              b.keywords = [];
12249              this.readChildNodes(a, b.keywords);
12250          },
12251          keyword: function (a, b) {
12252              b.push(this.getChildValue(a));
12253          },
12254          responsibleParty: function (a, b) {
12255              b.responsibleParty = {};
12256              this.readChildNodes(a, b.responsibleParty);
12257          },
12258          individualName: function (a, b) {
12259              b.individualName = this.getChildValue(a);
12260          },
12261          organisationName: function (a, b) {
12262              b.organisationName = this.getChildValue(a);
12263          },
12264          positionName: function (a, b) {
12265              b.positionName = this.getChildValue(a);
12266          },
12267          contactInfo: function (a, b) {
12268              b.contactInfo = {};
12269              this.readChildNodes(a, b.contactInfo);
12270          },
12271          phone: function (a, b) {
12272              b.phone = {};
12273              this.readChildNodes(a, b.phone);
12274          },
12275          voice: function (a, b) {
12276              b.voice = this.getChildValue(a);
12277          },
12278          facsimile: function (a, b) {
12279              b.facsimile = this.getChildValue(a);
12280          },
12281          address: function (a, b) {
12282              b.address = {};
12283              this.readChildNodes(a, b.address);
12284          },
12285          deliveryPoint: function (a, b) {
12286              b.deliveryPoint = this.getChildValue(a);
12287          },
12288          city: function (a, b) {
12289              b.city = this.getChildValue(a);
12290          },
12291          postalCode: function (a, b) {
12292              b.postalCode = this.getChildValue(a);
12293          },
12294          country: function (a, b) {
12295              b.country = this.getChildValue(a);
12296          },
12297          electronicMailAddress: function (a, b) {
12298              b.electronicMailAddress = this.getChildValue(a);
12299          },
12300          fees: function (a, b) {
12301              b.fees = this.getChildValue(a);
12302          },
12303          accessConstraints: function (a, b) {
12304              b.accessConstraints = this.getChildValue(a);
12305          },
12306          ContentMetadata: function (a, b) {
12307              b.contentMetadata = [];
12308              this.readChildNodes(a, b.contentMetadata);
12309          },
12310          CoverageOfferingBrief: function (a, b) {
12311              var c = {};
12312              this.readChildNodes(a, c);
12313              b.push(c);
12314          },
12315          name: function (a, b) {
12316              b.name = this.getChildValue(a);
12317          },
12318          label: function (a, b) {
12319              b.label = this.getChildValue(a);
12320          },
12321          lonLatEnvelope: function (a, b) {
12322              var c = this.getElementsByTagNameNS(a, "http://www.opengis.net/gml", "pos");
12323              if (2 == c.length) {
12324                  var d = {},
12325                      e = {};
12326                  OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this, [c[0], d]);
12327                  OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this, [c[1], e]);
12328                  b.lonLatEnvelope = {};
12329                  b.lonLatEnvelope.srsName = a.getAttribute("srsName");
12330                  b.lonLatEnvelope.min = d.points[0];
12331                  b.lonLatEnvelope.max = e.points[0];
12332              }
12333          },
12334      },
12335  },
12336  CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1_0_0",
12337});
12338OpenLayers.Strategy.Fixed = OpenLayers.Class(OpenLayers.Strategy, {
12339  preload: !1,
12340  activate: function () {
12341      var a = OpenLayers.Strategy.prototype.activate.apply(this, arguments);
12342      if (a)
12343          if ((this.layer.events.on({ refresh: this.load, scope: this }), !0 == this.layer.visibility || this.preload)) this.load();
12344          else this.layer.events.on({ visibilitychanged: this.load, scope: this });
12345      return a;
12346  },
12347  deactivate: function () {
12348      var a = OpenLayers.Strategy.prototype.deactivate.call(this);
12349      a && this.layer.events.un({ refresh: this.load, visibilitychanged: this.load, scope: this });
12350      return a;
12351  },
12352  load: function (a) {
12353      var b = this.layer;
12354      b.events.triggerEvent("loadstart", { filter: b.filter });
12355      b.protocol.read(OpenLayers.Util.applyDefaults({ callback: this.merge, filter: b.filter, scope: this }, a));
12356      b.events.un({ visibilitychanged: this.load, scope: this });
12357  },
12358  merge: function (a) {
12359      var b = this.layer;
12360      b.destroyFeatures();
12361      var c = a.features;
12362      if (c && 0 < c.length) {
12363          var d = b.projection,
12364              e = b.map.getProjectionObject();
12365          if (!e.equals(d)) for (var f, g = 0, h = c.length; g < h; ++g) (f = c[g].geometry) && f.transform(d, e);
12366          b.addFeatures(c);
12367      }
12368      b.events.triggerEvent("loadend", { response: a });
12369  },
12370  CLASS_NAME: "OpenLayers.Strategy.Fixed",
12371});
12372OpenLayers.Control.Zoom = OpenLayers.Class(OpenLayers.Control, {
12373  zoomInText: "+",
12374  zoomInId: "olZoomInLink",
12375  zoomOutText: "\u2212",
12376  zoomOutId: "olZoomOutLink",
12377  draw: function () {
12378      var a = OpenLayers.Control.prototype.draw.apply(this),
12379          b = this.getOrCreateLinks(a),
12380          c = b.zoomIn,
12381          b = b.zoomOut,
12382          d = this.map.events;
12383      b.parentNode !== a && ((d = this.events), d.attachToElement(b.parentNode));
12384      d.register("buttonclick", this, this.onZoomClick);
12385      this.zoomInLink = c;
12386      this.zoomOutLink = b;
12387      return a;
12388  },
12389  getOrCreateLinks: function (a) {
12390      var b = document.getElementById(this.zoomInId),
12391          c = document.getElementById(this.zoomOutId);
12392      b || ((b = document.createElement("a")), (b.href = "#zoomIn"), b.appendChild(document.createTextNode(this.zoomInText)), (b.className = "olControlZoomIn"), a.appendChild(b));
12393      OpenLayers.Element.addClass(b, "olButton");
12394      c || ((c = document.createElement("a")), (c.href = "#zoomOut"), c.appendChild(document.createTextNode(this.zoomOutText)), (c.className = "olControlZoomOut"), a.appendChild(c));
12395      OpenLayers.Element.addClass(c, "olButton");
12396      return { zoomIn: b, zoomOut: c };
12397  },
12398  onZoomClick: function (a) {
12399      a = a.buttonElement;
12400      a === this.zoomInLink ? this.map.zoomIn() : a === this.zoomOutLink && this.map.zoomOut();
12401  },
12402  destroy: function () {
12403      this.map && this.map.events.unregister("buttonclick", this, this.onZoomClick);
12404      delete this.zoomInLink;
12405      delete this.zoomOutLink;
12406      OpenLayers.Control.prototype.destroy.apply(this);
12407  },
12408  CLASS_NAME: "OpenLayers.Control.Zoom",
12409});
12410OpenLayers.Layer.PointTrack = OpenLayers.Class(OpenLayers.Layer.Vector, {
12411  dataFrom: null,
12412  styleFrom: null,
12413  addNodes: function (a, b) {
12414      if (2 > a.length) throw Error("At least two point features have to be added to create a line from");
12415      for (var c = Array(a.length - 1), d, e, f, g = 0, h = a.length; g < h; g++) {
12416          d = a[g];
12417          f = d.geometry;
12418          if (!f) (f = d.lonlat), (f = new OpenLayers.Geometry.Point(f.lon, f.lat));
12419          else if ("OpenLayers.Geometry.Point" != f.CLASS_NAME) throw new TypeError("Only features with point geometries are supported.");
12420          if (0 < g) {
12421              d = null != this.dataFrom ? a[g + this.dataFrom].data || a[g + this.dataFrom].attributes : null;
12422              var k = null != this.styleFrom ? a[g + this.styleFrom].style : null;
12423              e = new OpenLayers.Geometry.LineString([e, f]);
12424              c[g - 1] = new OpenLayers.Feature.Vector(e, d, k);
12425          }
12426          e = f;
12427      }
12428      this.addFeatures(c, b);
12429  },
12430  CLASS_NAME: "OpenLayers.Layer.PointTrack",
12431});
12432OpenLayers.Layer.PointTrack.SOURCE_NODE = -1;
12433OpenLayers.Layer.PointTrack.TARGET_NODE = 0;
12434OpenLayers.Layer.PointTrack.dataFrom = { SOURCE_NODE: -1, TARGET_NODE: 0 };
12435OpenLayers.Protocol.WFS = function (a) {
12436  a = OpenLayers.Util.applyDefaults(a, OpenLayers.Protocol.WFS.DEFAULTS);
12437  var b = OpenLayers.Protocol.WFS["v" + a.version.replace(/\./g, "_")];
12438  if (!b) throw "Unsupported WFS version: " + a.version;
12439  return new b(a);
12440};
12441OpenLayers.Protocol.WFS.fromWMSLayer = function (a, b) {
12442  var c, d;
12443  c = a.params.LAYERS;
12444  c = (OpenLayers.Util.isArray(c) ? c[0] : c).split(":");
12445  1 < c.length && (d = c[0]);
12446  c = c.pop();
12447  d = { url: a.url, featureType: c, featurePrefix: d, srsName: (a.projection && a.projection.getCode()) || (a.map && a.map.getProjectionObject().getCode()), version: "1.1.0" };
12448  return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(b, d));
12449};
12450OpenLayers.Protocol.WFS.DEFAULTS = { version: "1.0.0" };
12451OpenLayers.Layer.Markers = OpenLayers.Class(OpenLayers.Layer, {
12452  isBaseLayer: !1,
12453  markers: null,
12454  drawn: !1,
12455  initialize: function (a, b) {
12456      OpenLayers.Layer.prototype.initialize.apply(this, arguments);
12457      this.markers = [];
12458  },
12459  destroy: function () {
12460      this.clearMarkers();
12461      this.markers = null;
12462      OpenLayers.Layer.prototype.destroy.apply(this, arguments);
12463  },
12464  setOpacity: function (a) {
12465      if (a != this.opacity) {
12466          this.opacity = a;
12467          a = 0;
12468          for (var b = this.markers.length; a < b; a++) this.markers[a].setOpacity(this.opacity);
12469      }
12470  },
12471  moveTo: function (a, b, c) {
12472      OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
12473      if (b || !this.drawn) {
12474          for (var d = 0, e = this.markers.length; d < e; d++) this.drawMarker(this.markers[d]);
12475          this.drawn = !0;
12476      }
12477  },
12478  addMarker: function (a) {
12479      this.markers.push(a);
12480      1 > this.opacity && a.setOpacity(this.opacity);
12481      this.map && this.map.getExtent() && ((a.map = this.map), this.drawMarker(a));
12482  },
12483  removeMarker: function (a) {
12484      this.markers && this.markers.length && (OpenLayers.Util.removeItem(this.markers, a), a.erase());
12485  },
12486  clearMarkers: function () {
12487      if (null != this.markers) for (; 0 < this.markers.length; ) this.removeMarker(this.markers[0]);
12488  },
12489  drawMarker: function (a) {
12490      var b = this.map.getLayerPxFromLonLat(a.lonlat);
12491      null == b ? a.display(!1) : a.isDrawn() ? a.icon && a.icon.moveTo(b) : ((a = a.draw(b)), this.div.appendChild(a));
12492  },
12493  getDataExtent: function () {
12494      var a = null;
12495      if (this.markers && 0 < this.markers.length) for (var a = new OpenLayers.Bounds(), b = 0, c = this.markers.length; b < c; b++) a.extend(this.markers[b].lonlat);
12496      return a;
12497  },
12498  CLASS_NAME: "OpenLayers.Layer.Markers",
12499});
12500OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control.Button, {
12501  slideFactor: 50,
12502  slideRatio: null,
12503  direction: null,
12504  initialize: function (a, b) {
12505      this.direction = a;
12506      this.CLASS_NAME += this.direction;
12507      OpenLayers.Control.prototype.initialize.apply(this, [b]);
12508  },
12509  trigger: function () {
12510      if (this.map) {
12511          var a = OpenLayers.Function.bind(function (a) {
12512              return this.slideRatio ? this.map.getSize()[a] * this.slideRatio : this.slideFactor;
12513          }, this);
12514          switch (this.direction) {
12515              case OpenLayers.Control.Pan.NORTH:
12516                  this.map.pan(0, -a("h"));
12517                  break;
12518              case OpenLayers.Control.Pan.SOUTH:
12519                  this.map.pan(0, a("h"));
12520                  break;
12521              case OpenLayers.Control.Pan.WEST:
12522                  this.map.pan(-a("w"), 0);
12523                  break;
12524              case OpenLayers.Control.Pan.EAST:
12525                  this.map.pan(a("w"), 0);
12526          }
12527      }
12528  },
12529  CLASS_NAME: "OpenLayers.Control.Pan",
12530});
12531OpenLayers.Control.Pan.NORTH = "North";
12532OpenLayers.Control.Pan.SOUTH = "South";
12533OpenLayers.Control.Pan.EAST = "East";
12534OpenLayers.Control.Pan.WEST = "West";
12535OpenLayers.Format.CSWGetDomain = function (a) {
12536  a = OpenLayers.Util.applyDefaults(a, OpenLayers.Format.CSWGetDomain.DEFAULTS);
12537  var b = OpenLayers.Format.CSWGetDomain["v" + a.version.replace(/\./g, "_")];
12538  if (!b) throw "Unsupported CSWGetDomain version: " + a.version;
12539  return new b(a);
12540};
12541OpenLayers.Format.CSWGetDomain.DEFAULTS = { version: "2.0.2" };
12542OpenLayers.Format.CSWGetDomain.v2_0_2 = OpenLayers.Class(OpenLayers.Format.XML, {
12543  namespaces: { xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance", csw: "http://www.opengis.net/cat/csw/2.0.2" },
12544  defaultPrefix: "csw",
12545  version: "2.0.2",
12546  schemaLocation: "http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",
12547  PropertyName: null,
12548  ParameterName: null,
12549  read: function (a) {
12550      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
12551      a && 9 == a.nodeType && (a = a.documentElement);
12552      var b = {};
12553      this.readNode(a, b);
12554      return b;
12555  },
12556  readers: {
12557      csw: {
12558          GetDomainResponse: function (a, b) {
12559              this.readChildNodes(a, b);
12560          },
12561          DomainValues: function (a, b) {
12562              OpenLayers.Util.isArray(b.DomainValues) || (b.DomainValues = []);
12563              for (var c = a.attributes, d = {}, e = 0, f = c.length; e < f; ++e) d[c[e].name] = c[e].nodeValue;
12564              this.readChildNodes(a, d);
12565              b.DomainValues.push(d);
12566          },
12567          PropertyName: function (a, b) {
12568              b.PropertyName = this.getChildValue(a);
12569          },
12570          ParameterName: function (a, b) {
12571              b.ParameterName = this.getChildValue(a);
12572          },
12573          ListOfValues: function (a, b) {
12574              OpenLayers.Util.isArray(b.ListOfValues) || (b.ListOfValues = []);
12575              this.readChildNodes(a, b.ListOfValues);
12576          },
12577          Value: function (a, b) {
12578              for (var c = a.attributes, d = {}, e = 0, f = c.length; e < f; ++e) d[c[e].name] = c[e].nodeValue;
12579              d.value = this.getChildValue(a);
12580              b.push({ Value: d });
12581          },
12582          ConceptualScheme: function (a, b) {
12583              b.ConceptualScheme = {};
12584              this.readChildNodes(a, b.ConceptualScheme);
12585          },
12586          Name: function (a, b) {
12587              b.Name = this.getChildValue(a);
12588          },
12589          Document: function (a, b) {
12590              b.Document = this.getChildValue(a);
12591          },
12592          Authority: function (a, b) {
12593              b.Authority = this.getChildValue(a);
12594          },
12595          RangeOfValues: function (a, b) {
12596              b.RangeOfValues = {};
12597              this.readChildNodes(a, b.RangeOfValues);
12598          },
12599          MinValue: function (a, b) {
12600              for (var c = a.attributes, d = {}, e = 0, f = c.length; e < f; ++e) d[c[e].name] = c[e].nodeValue;
12601              d.value = this.getChildValue(a);
12602              b.MinValue = d;
12603          },
12604          MaxValue: function (a, b) {
12605              for (var c = a.attributes, d = {}, e = 0, f = c.length; e < f; ++e) d[c[e].name] = c[e].nodeValue;
12606              d.value = this.getChildValue(a);
12607              b.MaxValue = d;
12608          },
12609      },
12610  },
12611  write: function (a) {
12612      a = this.writeNode("csw:GetDomain", a);
12613      return OpenLayers.Format.XML.prototype.write.apply(this, [a]);
12614  },
12615  writers: {
12616      csw: {
12617          GetDomain: function (a) {
12618              var b = this.createElementNSPlus("csw:GetDomain", { attributes: { service: "CSW", version: this.version } });
12619              a.PropertyName || this.PropertyName
12620                  ? this.writeNode("csw:PropertyName", a.PropertyName || this.PropertyName, b)
12621                  : (a.ParameterName || this.ParameterName) && this.writeNode("csw:ParameterName", a.ParameterName || this.ParameterName, b);
12622              this.readChildNodes(b, a);
12623              return b;
12624          },
12625          PropertyName: function (a) {
12626              return this.createElementNSPlus("csw:PropertyName", { value: a });
12627          },
12628          ParameterName: function (a) {
12629              return this.createElementNSPlus("csw:ParameterName", { value: a });
12630          },
12631      },
12632  },
12633  CLASS_NAME: "OpenLayers.Format.CSWGetDomain.v2_0_2",
12634});
12635OpenLayers.Format.ArcXML.Features = OpenLayers.Class(OpenLayers.Format.XML, {
12636  read: function (a) {
12637      return new OpenLayers.Format.ArcXML().read(a).features.feature;
12638  },
12639});
12640OpenLayers.Control.Snapping = OpenLayers.Class(OpenLayers.Control, {
12641  DEFAULTS: { tolerance: 10, node: !0, edge: !0, vertex: !0 },
12642  greedy: !0,
12643  precedence: ["node", "vertex", "edge"],
12644  resolution: null,
12645  geoToleranceCache: null,
12646  layer: null,
12647  feature: null,
12648  point: null,
12649  initialize: function (a) {
12650      OpenLayers.Control.prototype.initialize.apply(this, [a]);
12651      this.options = a || {};
12652      this.options.layer && this.setLayer(this.options.layer);
12653      a = OpenLayers.Util.extend({}, this.options.defaults);
12654      this.defaults = OpenLayers.Util.applyDefaults(a, this.DEFAULTS);
12655      this.setTargets(this.options.targets);
12656      0 === this.targets.length && this.layer && this.addTargetLayer(this.layer);
12657      this.geoToleranceCache = {};
12658  },
12659  setLayer: function (a) {
12660      this.active ? (this.deactivate(), (this.layer = a), this.activate()) : (this.layer = a);
12661  },
12662  setTargets: function (a) {
12663      this.targets = [];
12664      if (a && a.length) for (var b, c = 0, d = a.length; c < d; ++c) (b = a[c]), b instanceof OpenLayers.Layer.Vector ? this.addTargetLayer(b) : this.addTarget(b);
12665  },
12666  addTargetLayer: function (a) {
12667      this.addTarget({ layer: a });
12668  },
12669  addTarget: function (a) {
12670      a = OpenLayers.Util.applyDefaults(a, this.defaults);
12671      a.nodeTolerance = a.nodeTolerance || a.tolerance;
12672      a.vertexTolerance = a.vertexTolerance || a.tolerance;
12673      a.edgeTolerance = a.edgeTolerance || a.tolerance;
12674      this.targets.push(a);
12675  },
12676  removeTargetLayer: function (a) {
12677      for (var b, c = this.targets.length - 1; 0 <= c; --c) (b = this.targets[c]), b.layer === a && this.removeTarget(b);
12678  },
12679  removeTarget: function (a) {
12680      return OpenLayers.Util.removeItem(this.targets, a);
12681  },
12682  activate: function () {
12683      var a = OpenLayers.Control.prototype.activate.call(this);
12684      if (a && this.layer && this.layer.events) this.layer.events.on({ sketchstarted: this.onSketchModified, sketchmodified: this.onSketchModified, vertexmodified: this.onVertexModified, scope: this });
12685      return a;
12686  },
12687  deactivate: function () {
12688      var a = OpenLayers.Control.prototype.deactivate.call(this);
12689      a && this.layer && this.layer.events && this.layer.events.un({ sketchstarted: this.onSketchModified, sketchmodified: this.onSketchModified, vertexmodified: this.onVertexModified, scope: this });
12690      this.point = this.feature = null;
12691      return a;
12692  },
12693  onSketchModified: function (a) {
12694      this.feature = a.feature;
12695      this.considerSnapping(a.vertex, a.vertex);
12696  },
12697  onVertexModified: function (a) {
12698      this.feature = a.feature;
12699      var b = this.layer.map.getLonLatFromViewPortPx(a.pixel);
12700      this.considerSnapping(a.vertex, new OpenLayers.Geometry.Point(b.lon, b.lat));
12701  },
12702  considerSnapping: function (a, b) {
12703      for (var c = { rank: Number.POSITIVE_INFINITY, dist: Number.POSITIVE_INFINITY, x: null, y: null }, d = !1, e, f, g = 0, h = this.targets.length; g < h; ++g)
12704          if (((f = this.targets[g]), (e = this.testTarget(f, b))))
12705              if (this.greedy) {
12706                  c = e;
12707                  c.target = f;
12708                  d = !0;
12709                  break;
12710              } else if (e.rank < c.rank || (e.rank === c.rank && e.dist < c.dist)) (c = e), (c.target = f), (d = !0);
12711      d &&
12712          (!1 !== this.events.triggerEvent("beforesnap", { point: a, x: c.x, y: c.y, distance: c.dist, layer: c.target.layer, snapType: this.precedence[c.rank] })
12713              ? ((a.x = c.x), (a.y = c.y), (this.point = a), this.events.triggerEvent("snap", { point: a, snapType: this.precedence[c.rank], layer: c.target.layer, distance: c.dist }))
12714              : (d = !1));
12715      this.point && !d && ((a.x = b.x), (a.y = b.y), (this.point = null), this.events.triggerEvent("unsnap", { point: a }));
12716  },
12717  testTarget: function (a, b) {
12718      var c = this.layer.map.getResolution();
12719      if (("minResolution" in a && c < a.minResolution) || ("maxResolution" in a && c >= a.maxResolution)) return null;
12720      for (
12721          var c = { node: this.getGeoTolerance(a.nodeTolerance, c), vertex: this.getGeoTolerance(a.vertexTolerance, c), edge: this.getGeoTolerance(a.edgeTolerance, c) },
12722              d = Math.max(c.node, c.vertex, c.edge),
12723              e = { rank: Number.POSITIVE_INFINITY, dist: Number.POSITIVE_INFINITY },
12724              f = !1,
12725              g = a.layer.features,
12726              h,
12727              k,
12728              l,
12729              m,
12730              n,
12731              p,
12732              q = this.precedence.length,
12733              r = new OpenLayers.LonLat(b.x, b.y),
12734              s = 0,
12735              t = g.length;
12736          s < t;
12737          ++s
12738      )
12739          if (((h = g[s]), h !== this.feature && !h._sketch && h.state !== OpenLayers.State.DELETE && (!a.filter || a.filter.evaluate(h)) && h.atPoint(r, d, d)))
12740              for (var u = 0, v = Math.min(e.rank + 1, q); u < v; ++u)
12741                  if (((k = this.precedence[u]), a[k]))
12742                      if ("edge" === k) {
12743                          if (((l = h.geometry.distanceTo(b, { details: !0 })), (n = l.distance), n <= c[k] && n < e.dist)) {
12744                              e = { rank: u, dist: n, x: l.x0, y: l.y0 };
12745                              f = !0;
12746                              break;
12747                          }
12748                      } else {
12749                          l = h.geometry.getVertices("node" === k);
12750                          p = !1;
12751                          for (var w = 0, x = l.length; w < x; ++w) (m = l[w]), (n = m.distanceTo(b)), n <= c[k] && (u < e.rank || (u === e.rank && n < e.dist)) && ((e = { rank: u, dist: n, x: m.x, y: m.y }), (p = f = !0));
12752                          if (p) break;
12753                      }
12754      return f ? e : null;
12755  },
12756  getGeoTolerance: function (a, b) {
12757      b !== this.resolution && ((this.resolution = b), (this.geoToleranceCache = {}));
12758      var c = this.geoToleranceCache[a];
12759      void 0 === c && ((c = a * b), (this.geoToleranceCache[a] = c));
12760      return c;
12761  },
12762  destroy: function () {
12763      this.active && this.deactivate();
12764      delete this.layer;
12765      delete this.targets;
12766      OpenLayers.Control.prototype.destroy.call(this);
12767  },
12768  CLASS_NAME: "OpenLayers.Control.Snapping",
12769});
12770OpenLayers.Format.OWSCommon.v1_1_0 = OpenLayers.Class(OpenLayers.Format.OWSCommon.v1, {
12771  namespaces: { ows: "http://www.opengis.net/ows/1.1", xlink: "http://www.w3.org/1999/xlink" },
12772  readers: {
12773      ows: OpenLayers.Util.applyDefaults(
12774          {
12775              ExceptionReport: function (a, b) {
12776                  b.exceptionReport = { version: a.getAttribute("version"), language: a.getAttribute("xml:lang"), exceptions: [] };
12777                  this.readChildNodes(a, b.exceptionReport);
12778              },
12779              AllowedValues: function (a, b) {
12780                  b.allowedValues = {};
12781                  this.readChildNodes(a, b.allowedValues);
12782              },
12783              AnyValue: function (a, b) {
12784                  b.anyValue = !0;
12785              },
12786              DataType: function (a, b) {
12787                  b.dataType = this.getChildValue(a);
12788              },
12789              Range: function (a, b) {
12790                  b.range = {};
12791                  this.readChildNodes(a, b.range);
12792              },
12793              MinimumValue: function (a, b) {
12794                  b.minValue = this.getChildValue(a);
12795              },
12796              MaximumValue: function (a, b) {
12797                  b.maxValue = this.getChildValue(a);
12798              },
12799              Identifier: function (a, b) {
12800                  b.identifier = this.getChildValue(a);
12801              },
12802              SupportedCRS: function (a, b) {
12803                  b.supportedCRS = this.getChildValue(a);
12804              },
12805          },
12806          OpenLayers.Format.OWSCommon.v1.prototype.readers.ows
12807      ),
12808  },
12809  writers: {
12810      ows: OpenLayers.Util.applyDefaults(
12811          {
12812              Range: function (a) {
12813                  var b = this.createElementNSPlus("ows:Range", { attributes: { "ows:rangeClosure": a.closure } });
12814                  this.writeNode("ows:MinimumValue", a.minValue, b);
12815                  this.writeNode("ows:MaximumValue", a.maxValue, b);
12816                  return b;
12817              },
12818              MinimumValue: function (a) {
12819                  return this.createElementNSPlus("ows:MinimumValue", { value: a });
12820              },
12821              MaximumValue: function (a) {
12822                  return this.createElementNSPlus("ows:MaximumValue", { value: a });
12823              },
12824              Value: function (a) {
12825                  return this.createElementNSPlus("ows:Value", { value: a });
12826              },
12827          },
12828          OpenLayers.Format.OWSCommon.v1.prototype.writers.ows
12829      ),
12830  },
12831  CLASS_NAME: "OpenLayers.Format.OWSCommon.v1_1_0",
12832});
12833OpenLayers.Format.WCSGetCoverage = OpenLayers.Class(OpenLayers.Format.XML, {
12834  namespaces: { ows: "http://www.opengis.net/ows/1.1", wcs: "http://www.opengis.net/wcs/1.1", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
12835  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
12836  VERSION: "1.1.2",
12837  schemaLocation: "http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1/wcsGetCoverage.xsd",
12838  write: function (a) {
12839      a = this.writeNode("wcs:GetCoverage", a);
12840      this.setAttributeNS(a, this.namespaces.xsi, "xsi:schemaLocation", this.schemaLocation);
12841      return OpenLayers.Format.XML.prototype.write.apply(this, [a]);
12842  },
12843  writers: {
12844      wcs: {
12845          GetCoverage: function (a) {
12846              var b = this.createElementNSPlus("wcs:GetCoverage", { attributes: { version: a.version || this.VERSION, service: "WCS" } });
12847              this.writeNode("ows:Identifier", a.identifier, b);
12848              this.writeNode("wcs:DomainSubset", a.domainSubset, b);
12849              this.writeNode("wcs:Output", a.output, b);
12850              return b;
12851          },
12852          DomainSubset: function (a) {
12853              var b = this.createElementNSPlus("wcs:DomainSubset", {});
12854              this.writeNode("ows:BoundingBox", a.boundingBox, b);
12855              a.temporalSubset && this.writeNode("wcs:TemporalSubset", a.temporalSubset, b);
12856              return b;
12857          },
12858          TemporalSubset: function (a) {
12859              for (var b = this.createElementNSPlus("wcs:TemporalSubset", {}), c = 0, d = a.timePeriods.length; c < d; ++c) this.writeNode("wcs:TimePeriod", a.timePeriods[c], b);
12860              return b;
12861          },
12862          TimePeriod: function (a) {
12863              var b = this.createElementNSPlus("wcs:TimePeriod", {});
12864              this.writeNode("wcs:BeginPosition", a.begin, b);
12865              this.writeNode("wcs:EndPosition", a.end, b);
12866              a.resolution && this.writeNode("wcs:TimeResolution", a.resolution, b);
12867              return b;
12868          },
12869          BeginPosition: function (a) {
12870              return this.createElementNSPlus("wcs:BeginPosition", { value: a });
12871          },
12872          EndPosition: function (a) {
12873              return this.createElementNSPlus("wcs:EndPosition", { value: a });
12874          },
12875          TimeResolution: function (a) {
12876              return this.createElementNSPlus("wcs:TimeResolution", { value: a });
12877          },
12878          Output: function (a) {
12879              var b = this.createElementNSPlus("wcs:Output", { attributes: { format: a.format, store: a.store } });
12880              a.gridCRS && this.writeNode("wcs:GridCRS", a.gridCRS, b);
12881              return b;
12882          },
12883          GridCRS: function (a) {
12884              var b = this.createElementNSPlus("wcs:GridCRS", {});
12885              this.writeNode("wcs:GridBaseCRS", a.baseCRS, b);
12886              a.type && this.writeNode("wcs:GridType", a.type, b);
12887              a.origin && this.writeNode("wcs:GridOrigin", a.origin, b);
12888              this.writeNode("wcs:GridOffsets", a.offsets, b);
12889              a.CS && this.writeNode("wcs:GridCS", a.CS, b);
12890              return b;
12891          },
12892          GridBaseCRS: function (a) {
12893              return this.createElementNSPlus("wcs:GridBaseCRS", { value: a });
12894          },
12895          GridOrigin: function (a) {
12896              return this.createElementNSPlus("wcs:GridOrigin", { value: a });
12897          },
12898          GridType: function (a) {
12899              return this.createElementNSPlus("wcs:GridType", { value: a });
12900          },
12901          GridOffsets: function (a) {
12902              return this.createElementNSPlus("wcs:GridOffsets", { value: a });
12903          },
12904          GridCS: function (a) {
12905              return this.createElementNSPlus("wcs:GridCS", { value: a });
12906          },
12907      },
12908      ows: OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows,
12909  },
12910  CLASS_NAME: "OpenLayers.Format.WCSGetCoverage",
12911});
12912OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
12913  namespaces: { kml: "http://www.opengis.net/kml/2.2", gx: "http://www.google.com/kml/ext/2.2" },
12914  kmlns: "http://earth.google.com/kml/2.0",
12915  placemarksDesc: "No description available",
12916  foldersName: "OpenLayers export",
12917  foldersDesc: "Exported on " + new Date(),
12918  extractAttributes: !0,
12919  kvpAttributes: !1,
12920  extractStyles: !1,
12921  extractTracks: !1,
12922  trackAttributes: null,
12923  internalns: null,
12924  features: null,
12925  styles: null,
12926  styleBaseUrl: "",
12927  fetched: null,
12928  maxDepth: 0,
12929  initialize: function (a) {
12930      this.regExes = {
12931          trimSpace: /^\s*|\s*$/g,
12932          removeSpace: /\s*/g,
12933          splitSpace: /\s+/,
12934          trimComma: /\s*,\s*/g,
12935          kmlColor: /(\w{2})(\w{2})(\w{2})(\w{2})/,
12936          kmlIconPalette: /root:\/\/icons\/palette-(\d+)(\.\w+)/,
12937          straightBracket: /\$\[(.*?)\]/g,
12938      };
12939      this.externalProjection = new OpenLayers.Projection("EPSG:4326");
12940      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
12941  },
12942  read: function (a) {
12943      this.features = [];
12944      this.styles = {};
12945      this.fetched = {};
12946      return this.parseData(a, { depth: 0, styleBaseUrl: this.styleBaseUrl });
12947  },
12948  parseData: function (a, b) {
12949      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
12950      for (var c = ["Link", "NetworkLink", "Style", "StyleMap", "Placemark"], d = 0, e = c.length; d < e; ++d) {
12951          var f = c[d],
12952              g = this.getElementsByTagNameNS(a, "*", f);
12953          if (0 != g.length)
12954              switch (f.toLowerCase()) {
12955                  case "link":
12956                  case "networklink":
12957                      this.parseLinks(g, b);
12958                      break;
12959                  case "style":
12960                      this.extractStyles && this.parseStyles(g, b);
12961                      break;
12962                  case "stylemap":
12963                      this.extractStyles && this.parseStyleMaps(g, b);
12964                      break;
12965                  case "placemark":
12966                      this.parseFeatures(g, b);
12967              }
12968      }
12969      return this.features;
12970  },
12971  parseLinks: function (a, b) {
12972      if (b.depth >= this.maxDepth) return !1;
12973      var c = OpenLayers.Util.extend({}, b);
12974      c.depth++;
12975      for (var d = 0, e = a.length; d < e; d++) {
12976          var f = this.parseProperty(a[d], "*", "href");
12977          f && !this.fetched[f] && ((this.fetched[f] = !0), (f = this.fetchLink(f)) && this.parseData(f, c));
12978      }
12979  },
12980  fetchLink: function (a) {
12981      if ((a = OpenLayers.Request.GET({ url: a, async: !1 }))) return a.responseText;
12982  },
12983  parseStyles: function (a, b) {
12984      for (var c = 0, d = a.length; c < d; c++) {
12985          var e = this.parseStyle(a[c]);
12986          e && (this.styles[(b.styleBaseUrl || "") + "#" + e.id] = e);
12987      }
12988  },
12989  parseKmlColor: function (a) {
12990      var b = null;
12991      a && (a = a.match(this.regExes.kmlColor)) && (b = { color: "#" + a[4] + a[3] + a[2], opacity: parseInt(a[1], 16) / 255 });
12992      return b;
12993  },
12994  parseStyle: function (a) {
12995      for (var b = {}, c = ["LineStyle", "PolyStyle", "IconStyle", "BalloonStyle", "LabelStyle"], d, e, f = 0, g = c.length; f < g; ++f)
12996          if (((d = c[f]), (e = this.getElementsByTagNameNS(a, "*", d)[0])))
12997              switch (d.toLowerCase()) {
12998                  case "linestyle":
12999                      d = this.parseProperty(e, "*", "color");
13000                      if ((d = this.parseKmlColor(d))) (b.strokeColor = d.color), (b.strokeOpacity = d.opacity);
13001                      (d = this.parseProperty(e, "*", "width")) && (b.strokeWidth = d);
13002                      break;
13003                  case "polystyle":
13004                      d = this.parseProperty(e, "*", "color");
13005                      if ((d = this.parseKmlColor(d))) (b.fillOpacity = d.opacity), (b.fillColor = d.color);
13006                      "0" == this.parseProperty(e, "*", "fill") && (b.fillColor = "none");
13007                      "0" == this.parseProperty(e, "*", "outline") && (b.strokeWidth = "0");
13008                      break;
13009                  case "iconstyle":
13010                      var h = parseFloat(this.parseProperty(e, "*", "scale") || 1);
13011                      d = 32 * h;
13012                      var k = 32 * h,
13013                          l = this.getElementsByTagNameNS(e, "*", "Icon")[0];
13014                      if (l) {
13015                          var m = this.parseProperty(l, "*", "href");
13016                          if (m) {
13017                              var n = this.parseProperty(l, "*", "w"),
13018                                  p = this.parseProperty(l, "*", "h");
13019                              !OpenLayers.String.startsWith(m, "http://maps.google.com/mapfiles/kml") || n || p || ((p = n = 64), (h /= 2));
13020                              n = n || p;
13021                              p = p || n;
13022                              n && (d = parseInt(n) * h);
13023                              p && (k = parseInt(p) * h);
13024                              if ((p = m.match(this.regExes.kmlIconPalette)))
13025                                  (n = p[1]),
13026                                      (p = p[2]),
13027                                      (m = this.parseProperty(l, "*", "x")),
13028                                      (l = this.parseProperty(l, "*", "y")),
13029                                      (m = "http://maps.google.com/mapfiles/kml/pal" + n + "/icon" + (8 * (l ? 7 - l / 32 : 7) + (m ? m / 32 : 0)) + p);
13030                              b.graphicOpacity = 1;
13031                              b.externalGraphic = m;
13032                          }
13033                      }
13034                      if ((e = this.getElementsByTagNameNS(e, "*", "hotSpot")[0]))
13035                          (m = parseFloat(e.getAttribute("x"))),
13036                              (l = parseFloat(e.getAttribute("y"))),
13037                              (n = e.getAttribute("xunits")),
13038                              "pixels" == n ? (b.graphicXOffset = -m * h) : "insetPixels" == n ? (b.graphicXOffset = -d + m * h) : "fraction" == n && (b.graphicXOffset = -d * m),
13039                              (e = e.getAttribute("yunits")),
13040                              "pixels" == e ? (b.graphicYOffset = -k + l * h + 1) : "insetPixels" == e ? (b.graphicYOffset = -(l * h) + 1) : "fraction" == e && (b.graphicYOffset = -k * (1 - l) + 1);
13041                      b.graphicWidth = d;
13042                      b.graphicHeight = k;
13043                      break;
13044                  case "balloonstyle":
13045                      (e = OpenLayers.Util.getXmlNodeValue(e)) && (b.balloonStyle = e.replace(this.regExes.straightBracket, "${$1}"));
13046                      break;
13047                  case "labelstyle":
13048                      if (((d = this.parseProperty(e, "*", "color")), (d = this.parseKmlColor(d)))) (b.fontColor = d.color), (b.fontOpacity = d.opacity);
13049              }
13050      !b.strokeColor && b.fillColor && (b.strokeColor = b.fillColor);
13051      (a = a.getAttribute("id")) && b && (b.id = a);
13052      return b;
13053  },
13054  parseStyleMaps: function (a, b) {
13055      for (var c = 0, d = a.length; c < d; c++)
13056          for (var e = a[c], f = this.getElementsByTagNameNS(e, "*", "Pair"), e = e.getAttribute("id"), g = 0, h = f.length; g < h; g++) {
13057              var k = f[g],
13058                  l = this.parseProperty(k, "*", "key");
13059              (k = this.parseProperty(k, "*", "styleUrl")) && "normal" == l && (this.styles[(b.styleBaseUrl || "") + "#" + e] = this.styles[(b.styleBaseUrl || "") + k]);
13060          }
13061  },
13062  parseFeatures: function (a, b) {
13063      for (var c = [], d = 0, e = a.length; d < e; d++) {
13064          var f = a[d],
13065              g = this.parseFeature.apply(this, [f]);
13066          if (g) {
13067              this.extractStyles && g.attributes && g.attributes.styleUrl && (g.style = this.get
13067Style(g.attributes.styleUrl, b));
13068              if (this.extractStyles) {
13069                  var h = this.getElementsByTagNameNS(f, "*", "Style")[0];
13070                  h && (h = this.parseStyle(h)) && (g.style = OpenLayers.Util.extend(g.style, h));
13071              }
13072              this.extractTracks
13073                  ? (f = this.getElementsByTagNameNS(f, this.namespaces.gx, "Track")) && 0 < f.length && ((g = { features: [], feature: g }), this.readNode(f[0], g), 0 < g.features.length && c.push.apply(c, g.features))
13074                  : c.push(g);
13075          } else throw "Bad Placemark: " + d;
13076      }
13077      this.features = this.features.concat(c);
13078  },
13079  readers: {
13080      kml: {
13081          when: function (a, b) {
13082              b.whens.push(OpenLayers.Date.parse(this.getChildValue(a)));
13083          },
13084          _trackPointAttribute: function (a, b) {
13085              var c = a.nodeName.split(":").pop();
13086              b.attributes[c].push(this.getChildValue(a));
13087          },
13088      },
13089      gx: {
13090          Track: function (a, b) {
13091              var c = { whens: [], points: [], angles: [] };
13092              if (this.trackAttributes) {
13093                  var d;
13094                  c.attributes = {};
13095                  for (var e = 0, f = this.trackAttributes.length; e < f; ++e) (d = this.trackAttributes[e]), (c.attributes[d] = []), d in this.readers.kml || (this.readers.kml[d] = this.readers.kml._trackPointAttribute);
13096              }
13097              this.readChildNodes(a, c);
13098              if (c.whens.length !== c.points.length) throw Error("gx:Track with unequal number of when (" + c.whens.length + ") and gx:coord (" + c.points.length + ") elements.");
13099              var g = 0 < c.angles.length;
13100              if (g && c.whens.length !== c.angles.length) throw Error("gx:Track with unequal number of when (" + c.whens.length + ") and gx:angles (" + c.angles.length + ") elements.");
13101              for (var h, e = 0, f = c.whens.length; e < f; ++e) {
13102                  h = b.feature.clone();
13103                  h.fid = b.feature.fid || b.feature.id;
13104                  d = c.points[e];
13105                  h.geometry = d;
13106                  "z" in d && (h.attributes.altitude = d.z);
13107                  this.internalProjection && this.externalProjection && h.geometry.transform(this.externalProjection, this.internalProjection);
13108                  if (this.trackAttributes) for (var k = 0, l = this.trackAttributes.length; k < l; ++k) (d = this.trackAttributes[k]), (h.attributes[d] = c.attributes[d][e]);
13109                  h.attributes.when = c.whens[e];
13110                  h.attributes.trackId = b.feature.id;
13111                  g && ((d = c.angles[e]), (h.attributes.heading = parseFloat(d[0])), (h.attributes.tilt = parseFloat(d[1])), (h.attributes.roll = parseFloat(d[2])));
13112                  b.features.push(h);
13113              }
13114          },
13115          coord: function (a, b) {
13116              var c = this.getChildValue(a).replace(this.regExes.trimSpace, "").split(/\s+/),
13117                  d = new OpenLayers.Geometry.Point(c[0], c[1]);
13118              2 < c.length && (d.z = parseFloat(c[2]));
13119              b.points.push(d);
13120          },
13121          angles: function (a, b) {
13122              var c = this.getChildValue(a).replace(this.regExes.trimSpace, "").split(/\s+/);
13123              b.angles.push(c);
13124          },
13125      },
13126  },
13127  parseFeature: function (a) {
13128      for (var b = ["MultiGeometry", "Polygon", "LineString", "Point"], c, d, e, f = 0, g = b.length; f < g; ++f)
13129          if (((c = b[f]), (this.internalns = a.namespaceURI ? a.namespaceURI : this.kmlns), (d = this.getElementsByTagNameNS(a, this.internalns, c)), 0 < d.length)) {
13130              if ((b = this.parseGeometry[c.toLowerCase()])) (e = b.apply(this, [d[0]])), this.internalProjection && this.externalProjection && e.transform(this.externalProjection, this.internalProjection);
13131              else throw new TypeError("Unsupported geometry type: " + c);
13132              break;
13133          }
13134      var h;
13135      this.extractAttributes && (h = this.parseAttributes(a));
13136      c = new OpenLayers.Feature.Vector(e, h);
13137      a = a.getAttribute("id") || a.getAttribute("name");
13138      null != a && (c.fid = a);
13139      return c;
13140  },
13141  getStyle: function (a, b) {
13142      var c = OpenLayers.Util.removeTail(a),
13143          d = OpenLayers.Util.extend({}, b);
13144      d.depth++;
13145      d.styleBaseUrl = c;
13146      !this.styles[a] && !OpenLayers.String.startsWith(a, "#") && d.depth <= this.maxDepth && !this.fetched[c] && (c = this.fetchLink(c)) && this.parseData(c, d);
13147      return OpenLayers.Util.extend({}, this.styles[a]);
13148  },
13149  parseGeometry: {
13150      point: function (a) {
13151          var b = this.getElementsByTagNameNS(a, this.internalns, "coordinates");
13152          a = [];
13153          if (0 < b.length) {
13154              var c = b[0].firstChild.nodeValue,
13155                  c = c.replace(this.regExes.removeSpace, "");
13156              a = c.split(",");
13157          }
13158          b = null;
13159          if (1 < a.length) 2 == a.length && (a[2] = null), (b = new OpenLayers.Geometry.Point(a[0], a[1], a[2]));
13160          else throw "Bad coordinate string: " + c;
13161          return b;
13162      },
13163      linestring: function (a, b) {
13164          var c = this.getElementsByTagNameNS(a, this.internalns, "coordinates"),
13165              d = null;
13166          if (0 < c.length) {
13167              for (var c = this.getChildValue(c[0]), c = c.replace(this.regExes.trimSpace, ""), c = c.replace(this.regExes.trimComma, ","), d = c.split(this.regExes.splitSpace), e = d.length, f = Array(e), g, h, k = 0; k < e; ++k)
13168                  if (((g = d[k].split(",")), (h = g.length), 1 < h)) 2 == g.length && (g[2] = null), (f[k] = new OpenLayers.Geometry.Point(g[0], g[1], g[2]));
13169                  else throw "Bad LineString point coordinates: " + d[k];
13170              if (e) d = b ? new OpenLayers.Geometry.LinearRing(f) : new OpenLayers.Geometry.LineString(f);
13171              else throw "Bad LineString coordinates: " + c;
13172          }
13173          return d;
13174      },
13175      polygon: function (a) {
13176          a = this.getElementsByTagNameNS(a, this.internalns, "LinearRing");
13177          var b = a.length,
13178              c = Array(b);
13179          if (0 < b)
13180              for (var d = 0, e = a.length; d < e; ++d)
13181                  if ((b = this.parseGeometry.linestring.apply(this, [a[d], !0]))) c[d] = b;
13182                  else throw "Bad LinearRing geometry: " + d;
13183          return new OpenLayers.Geometry.Polygon(c);
13184      },
13185      multigeometry: function (a) {
13186          for (var b, c = [], d = a.childNodes, e = 0, f = d.length; e < f; ++e)
13187              (a = d[e]), 1 == a.nodeType && ((b = a.prefix ? a.nodeName.split(":")[1] : a.nodeName), (b = this.parseGeometry[b.toLowerCase()]) && c.push(b.apply(this, [a])));
13188          return new OpenLayers.Geometry.Collection(c);
13189      },
13190  },
13191  parseAttributes: function (a) {
13192      var b = {},
13193          c = a.getElementsByTagName("ExtendedData");
13194      c.length && (b = this.parseExtendedData(c[0]));
13195      var d, e, f;
13196      a = a.childNodes;
13197      for (var c = 0, g = a.length; c < g; ++c)
13198          if (((d = a[c]), 1 == d.nodeType && ((e = d.childNodes), 1 <= e.length && 3 >= e.length))) {
13199              switch (e.length) {
13200                  case 1:
13201                      f = e[0];
13202                      break;
13203                  case 2:
13204                      f = e[0];
13205                      e = e[1];
13206                      f = 3 == f.nodeType || 4 == f.nodeType ? f : e;
13207                      break;
13208                  default:
13209                      f = e[1];
13210              }
13211              if (3 == f.nodeType || 4 == f.nodeType) if (((d = d.prefix ? d.nodeName.split(":")[1] : d.nodeName), (f = OpenLayers.Util.getXmlNodeValue(f)))) (f = f.replace(this.regExes.trimSpace, "")), (b[d] = f);
13212          }
13213      return b;
13214  },
13215  parseExtendedData: function (a) {
13216      var b = {},
13217          c,
13218          d,
13219          e,
13220          f,
13221          g = a.getElementsByTagName("Data");
13222      c = 0;
13223      for (d = g.length; c < d; c++) {
13224          e = g[c];
13225          f = e.getAttribute("name");
13226          var h = {},
13227              k = e.getElementsByTagName("value");
13228          k.length && (h.value = this.getChildValue(k[0]));
13229          this.kvpAttributes ? (b[f] = h.value) : ((e = e.getElementsByTagName("displayName")), e.length && (h.displayName = this.getChildValue(e[0])), (b[f] = h));
13230      }
13231      a = a.getElementsByTagName("SimpleData");
13232      c = 0;
13233      for (d = a.length; c < d; c++) (h = {}), (e = a[c]), (f = e.getAttribute("name")), (h.value = this.getChildValue(e)), this.kvpAttributes ? (b[f] = h.value) : ((h.displayName = f), (b[f] = h));
13234      return b;
13235  },
13236  parseProperty: function (a, b, c) {
13237      var d;
13238      a = this.getElementsByTagNameNS(a, b, c);
13239      try {
13240          d = OpenLayers.Util.getXmlNodeValue(a[0]);
13241      } catch (e) {
13242          d = null;
13243      }
13244      return d;
13245  },
13246  write: function (a) {
13247      OpenLayers.Util.isArray(a) || (a = [a]);
13248      for (var b = this.createElementNS(this.kmlns, "kml"), c = this.createFolderXML(), d = 0, e = a.length; d < e; ++d) c.appendChild(this.createPlacemarkXML(a[d]));
13249      b.appendChild(c);
13250      return OpenLayers.Format.XML.prototype.write.apply(this, [b]);
13251  },
13252  createFolderXML: function () {
13253      var a = this.createElementNS(this.kmlns, "Folder");
13254      if (this.foldersName) {
13255          var b = this.createElementNS(this.kmlns, "name"),
13256              c = this.createTextNode(this.foldersName);
13257          b.appendChild(c);
13258          a.appendChild(b);
13259      }
13260      this.foldersDesc && ((b = this.createElementNS(this.kmlns, "description")), (c = this.createTextNode(this.foldersDesc)), b.appendChild(c), a.appendChild(b));
13261      return a;
13262  },
13263  createPlacemarkXML: function (a) {
13264      var b = this.createElementNS(this.kmlns, "name"),
13265          c = a.style && a.style.label ? a.style.label : a.id;
13266      b.appendChild(this.createTextNode(a.attributes.name || c));
13267      var d = this.createElementNS(this.kmlns, "description");
13268      d.appendChild(this.createTextNode(a.attributes.description || this.placemarksDesc));
13269      c = this.createElementNS(this.kmlns, "Placemark");
13270      null != a.fid && c.setAttribute("id", a.fid);
13271      c.appendChild(b);
13272      c.appendChild(d);
13273      b = this.buildGeometryNode(a.geometry);
13274      c.appendChild(b);
13275      a.attributes && (a = this.buildExtendedData(a.attributes)) && c.appendChild(a);
13276      return c;
13277  },
13278  buildGeometryNode: function (a) {
13279      var b = a.CLASS_NAME,
13280          b = b.substring(b.lastIndexOf(".") + 1),
13281          b = this.buildGeometry[b.toLowerCase()],
13282          c = null;
13283      b && (c = b.apply(this, [a]));
13284      return c;
13285  },
13286  buildGeometry: {
13287      point: function (a) {
13288          var b = this.createElementNS(this.kmlns, "Point");
13289          b.appendChild(this.buildCoordinatesNode(a));
13290          return b;
13291      },
13292      multipoint: function (a) {
13293          return this.buildGeometry.collection.apply(this, [a]);
13294      },
13295      linestring: function (a) {
13296          var b = this.createElementNS(this.kmlns, "LineString");
13297          b.appendChild(this.buildCoordinatesNode(a));
13298          return b;
13299      },
13300      multilinestring: function (a) {
13301          return this.buildGeometry.collection.apply(this, [a]);
13302      },
13303      linearring: function (a) {
13304          var b = this.createElementNS(this.kmlns, "LinearRing");
13305          b.appendChild(this.buildCoordinatesNode(a));
13306          return b;
13307      },
13308      polygon: function (a) {
13309          var b = this.createElementNS(this.kmlns, "Polygon");
13310          a = a.components;
13311          for (var c, d, e = 0, f = a.length; e < f; ++e)
13312              (c = 0 == e ? "outerBoundaryIs" : "innerBoundaryIs"), (c = this.createElementNS(this.kmlns, c)), (d = this.buildGeometry.linearring.apply(this, [a[e]])), c.appendChild(d), b.appendChild(c);
13313          return b;
13314      },
13315      multipolygon: function (a) {
13316          return this.buildGeometry.collection.apply(this, [a]);
13317      },
13318      collection: function (a) {
13319          for (var b = this.createElementNS(this.kmlns, "MultiGeometry"), c, d = 0, e = a.components.length; d < e; ++d) (c = this.buildGeometryNode.apply(this, [a.components[d]])) && b.appendChild(c);
13320          return b;
13321      },
13322  },
13323  buildCoordinatesNode: function (a) {
13324      var b = this.createElementNS(this.kmlns, "coordinates"),
13325          c;
13326      if ((c = a.components)) {
13327          for (var d = c.length, e = Array(d), f = 0; f < d; ++f) (a = c[f]), (e[f] = this.buildCoordinates(a));
13328          c = e.join(" ");
13329      } else c = this.buildCoordinates(a);
13330      c = this.createTextNode(c);
13331      b.appendChild(c);
13332      return b;
13333  },
13334  buildCoordinates: function (a) {
13335      this.internalProjection && this.externalProjection && ((a = a.clone()), a.transform(this.internalProjection, this.externalProjection));
13336      return a.x + "," + a.y;
13337  },
13338  buildExtendedData: function (a) {
13339      var b = this.createElementNS(this.kmlns, "ExtendedData"),
13340          c;
13341      for (c in a)
13342          if (a[c] && "name" != c && "description" != c && "styleUrl" != c) {
13343              var d = this.createElementNS(this.kmlns, "Data");
13344              d.setAttribute("name", c);
13345              var e = this.createElementNS(this.kmlns, "value");
13346              if ("object" == typeof a[c]) {
13347                  if ((a[c].value && e.appendChild(this.createTextNode(a[c].value)), a[c].displayName)) {
13348                      var f = this.createElementNS(this.kmlns, "displayName");
13349                      f.appendChild(this.getXMLDoc().createCDATASection(a[c].displayName));
13350                      d.appendChild(f);
13351                  }
13352              } else e.appendChild(this.createTextNode(a[c]));
13353              d.appendChild(e);
13354              b.appendChild(d);
13355          }
13356      return this.isSimpleContent(b) ? null : b;
13357  },
13358  CLASS_NAME: "OpenLayers.Format.KML",
13359});
13360OpenLayers.Format.WMSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { defaultVersion: "1.1.1", profile: null, CLASS_NAME: "OpenLayers.Format.WMSCapabilities" });
13361OpenLayers.Format.WMSCapabilities.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
13362  namespaces: { wms: "http://www.opengis.net/wms", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
13363  defaultPrefix: "wms",
13364  read: function (a) {
13365      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
13366      var b = a;
13367      a && 9 == a.nodeType && (a = a.documentElement);
13368      var c = {};
13369      this.readNode(a, c);
13370      void 0 === c.service && ((a = new OpenLayers.Format.OGCExceptionReport()), (c.error = a.read(b)));
13371      return c;
13372  },
13373  readers: {
13374      wms: {
13375          Service: function (a, b) {
13376              b.service = {};
13377              this.readChildNodes(a, b.service);
13378          },
13379          Name: function (a, b) {
13380              b.name = this.getChildValue(a);
13381          },
13382          Title: function (a, b) {
13383              b.title = this.getChildValue(a);
13384          },
13385          Abstract: function (a, b) {
13386              b["abstract"] = this.getChildValue(a);
13387          },
13388          BoundingBox: function (a, b) {
13389              var c = {};
13390              c.bbox = [parseFloat(a.getAttribute("minx")), parseFloat(a.getAttribute("miny")), parseFloat(a.getAttribute("maxx")), parseFloat(a.getAttribute("maxy"))];
13391              var d = { x: parseFloat(a.getAttribute("resx")), y: parseFloat(a.getAttribute("resy")) };
13392              (isNaN(d.x) && isNaN(d.y)) || (c.res = d);
13393              return c;
13394          },
13395          OnlineResource: function (a, b) {
13396              b.href = this.getAttributeNS(a, this.namespaces.xlink, "href");
13397          },
13398          ContactInformation: function (a, b) {
13399              b.contactInformation = {};
13400              this.readChildNodes(a, b.contactInformation);
13401          },
13402          ContactPersonPrimary: function (a, b) {
13403              b.personPrimary = {};
13404              this.readChildNodes(a, b.personPrimary);
13405          },
13406          ContactPerson: function (a, b) {
13407              b.person = this.getChildValue(a);
13408          },
13409          ContactOrganization: function (a, b) {
13410              b.organization = this.getChildValue(a);
13411          },
13412          ContactPosition: function (a, b) {
13413              b.position = this.getChildValue(a);
13414          },
13415          ContactAddress: function (a, b) {
13416              b.contactAddress = {};
13417              this.readChildNodes(a, b.contactAddress);
13418          },
13419          AddressType: function (a, b) {
13420              b.type = this.getChildValue(a);
13421          },
13422          Address: function (a, b) {
13423              b.address = this.getChildValue(a);
13424          },
13425          City: function (a, b) {
13426              b.city = this.getChildValue(a);
13427          },
13428          StateOrProvince: function (a, b) {
13429              b.stateOrProvince = this.getChildValue(a);
13430          },
13431          PostCode: function (a, b) {
13432              b.postcode = this.getChildValue(a);
13433          },
13434          Country: function (a, b) {
13435              b.country = this.getChildValue(a);
13436          },
13437          ContactVoiceTelephone: function (a, b) {
13438              b.phone = this.getChildValue(a);
13439          },
13440          ContactFacsimileTelephone: function (a, b) {
13441              b.fax = this.getChildValue(a);
13442          },
13443          ContactElectronicMailAddress: function (a, b) {
13444              b.email = this.getChildValue(a);
13445          },
13446          Fees: function (a, b) {
13447              var c = this.getChildValue(a);
13448              c && "none" != c.toLowerCase() && (b.fees = c);
13449          },
13450          AccessConstraints: function (a, b) {
13451              var c = this.getChildValue(a);
13452              c && "none" != c.toLowerCase() && (b.accessConstraints = c);
13453          },
13454          Capability: function (a, b) {
13455              b.capability = { nestedLayers: [], layers: [] };
13456              this.readChildNodes(a, b.capability);
13457          },
13458          Request: function (a, b) {
13459              b.request = {};
13460              this.readChildNodes(a, b.request);
13461          },
13462          GetCapabilities: function (a, b) {
13463              b.getcapabilities = { formats: [] };
13464              this.readChildNodes(a, b.getcapabilities);
13465          },
13466          Format: function (a, b) {
13467              OpenLayers.Util.isArray(b.formats) ? b.formats.push(this.getChildValue(a)) : (b.format = this.getChildValue(a));
13468          },
13469          DCPType: function (a, b) {
13470              this.readChildNodes(a, b);
13471          },
13472          HTTP: function (a, b) {
13473              this.readChildNodes(a, b);
13474          },
13475          Get: function (a, b) {
13476              b.get = {};
13477              this.readChildNodes(a, b.get);
13478              b.href || (b.href = b.get.href);
13479          },
13480          Post: function (a, b) {
13481              b.post = {};
13482              this.readChildNodes(a, b.post);
13483              b.href || (b.href = b.get.href);
13484          },
13485          GetMap: function (a, b) {
13486              b.getmap = { formats: [] };
13487              this.readChildNodes(a, b.getmap);
13488          },
13489          GetFeatureInfo: function (a, b) {
13490              b.getfeatureinfo = { formats: [] };
13491              this.readChildNodes(a, b.getfeatureinfo);
13492          },
13493          Exception: function (a, b) {
13494              b.exception = { formats: [] };
13495              this.readChildNodes(a, b.exception);
13496          },
13497          Layer: function (a, b) {
13498              var c, d;
13499              b.capability ? ((d = b.capability), (c = b)) : (d = b);
13500              var e = a.getAttributeNode("queryable"),
13501                  f = e && e.specified ? a.getAttribute("queryable") : null,
13502                  g = (e = a.getAttributeNode("cascaded")) && e.specified ? a.getAttribute("cascaded") : null,
13503                  e = (e = a.getAttributeNode("opaque")) && e.specified ? a.getAttribute("opaque") : null,
13504                  h = a.getAttribute("noSubsets"),
13505                  k = a.getAttribute("fixedWidth"),
13506                  l = a.getAttribute("fixedHeight"),
13507                  m = c || {},
13508                  n = OpenLayers.Util.extend;
13509              c = {
13510                  nestedLayers: [],
13511                  styles: c ? [].concat(c.styles) : [],
13512                  srs: c ? n({}, m.srs) : {},
13513                  metadataURLs: [],
13514                  bbox: c ? n({}, m.bbox) : {},
13515                  llbbox: m.llbbox,
13516                  dimensions: c ? n({}, m.dimensions) : {},
13517                  authorityURLs: c ? n({}, m.authorityURLs) : {},
13518                  identifiers: {},
13519                  keywords: [],
13520                  queryable: f && "" !== f ? "1" === f || "true" === f : m.queryable || !1,
13521                  cascaded: null !== g ? parseInt(g) : m.cascaded || 0,
13522                  opaque: e ? "1" === e || "true" === e : m.opaque || !1,
13523                  noSubsets: null !== h ? "1" === h || "true" === h : m.noSubsets || !1,
13524                  fixedWidth: null != k ? parseInt(k) : m.fixedWidth || 0,
13525                  fixedHeight: null != l ? parseInt(l) : m.fixedHeight || 0,
13526                  minScale: m.minScale,
13527                  maxScale: m.maxScale,
13528                  attribution: m.attribution,
13529              };
13530              b.nestedLayers.push(c);
13531              c.capability = d;
13532              this.readChildNodes(a, c);
13533              delete c.capability;
13534              c.name &&
13535                  ((f = c.name.split(":")),
13536                  (g = d.request),
13537                  (e = g.getfeatureinfo),
13538                  0 < f.length && (c.prefix = f[0]),
13539                  d.layers.push(c),
13540                  void 0 === c.formats && (c.formats = g.getmap.formats),
13541                  void 0 === c.infoFormats && e && (c.infoFormats = e.formats));
13542          },
13543          Attribution: function (a, b) {
13544              b.attribution = {};
13545              this.readChildNodes(a, b.attribution);
13546          },
13547          LogoURL: function (a, b) {
13548              b.logo = { width: a.getAttribute("width"), height: a.getAttribute("height") };
13549              this.readChildNodes(a, b.logo);
13550          },
13551          Style: function (a, b) {
13552              var c = {};
13553              b.styles.push(c);
13554              this.readChildNodes(a, c);
13555          },
13556          LegendURL: function (a, b) {
13557              var c = { width: a.getAttribute("width"), height: a.getAttribute("height") };
13558              b.legend = c;
13559              this.readChildNodes(a, c);
13560          },
13561          MetadataURL: function (a, b) {
13562              var c = { type: a.getAttribute("type") };
13563              b.metadataURLs.push(c);
13564              this.readChildNodes(a, c);
13565          },
13566          DataURL: function (a, b) {
13567              b.dataURL = {};
13568              this.readChildNodes(a, b.dataURL);
13569          },
13570          FeatureListURL: function (a, b) {
13571              b.featureListURL = {};
13572              this.readChildNodes(a, b.featureListURL);
13573          },
13574          AuthorityURL: function (a, b) {
13575              var c = a.getAttribute("name"),
13576                  d = {};
13577              this.readChildNodes(a, d);
13578              b.authorityURLs[c] = d.href;
13579          },
13580          Identifier: function (a, b) {
13581              var c = a.getAttribute("authority");
13582              b.identifiers[c] = this.getChildValue(a);
13583          },
13584          KeywordList: function (a, b) {
13585              this.readChildNodes(a, b);
13586          },
13587          SRS: function (a, b) {
13588              b.srs[this.getChildValue(a)] = !0;
13589          },
13590      },
13591  },
13592  CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1",
13593});
13594OpenLayers.Format.WMSCapabilities.v1_1 = OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1, {
13595  readers: {
13596      wms: OpenLayers.Util.applyDefaults(
13597          {
13598              WMT_MS_Capabilities: function (a, b) {
13599                  this.readChildNodes(a, b);
13600              },
13601              Keyword: function (a, b) {
13602                  b.keywords && b.keywords.push(this.getChildValue(a));
13603              },
13604              DescribeLayer: function (a, b) {
13605                  b.describelayer = { formats: [] };
13606                  this.readChildNodes(a, b.describelayer);
13607              },
13608              GetLegendGraphic: function (a, b) {
13609                  b.getlegendgraphic = { formats: [] };
13610                  this.readChildNodes(a, b.getlegendgraphic);
13611              },
13612              GetStyles: function (a, b) {
13613                  b.getstyles = { formats: [] };
13614                  this.readChildNodes(a, b.getstyles);
13615              },
13616              PutStyles: function (a, b) {
13617                  b.putstyles = { formats: [] };
13618                  this.readChildNodes(a, b.putstyles);
13619              },
13620              UserDefinedSymbolization: function (a, b) {
13621                  var c = {
13622                      supportSLD: 1 == parseInt(a.getAttribute("SupportSLD")),
13623                      userLayer: 1 == parseInt(a.getAttribute("UserLayer")),
13624                      userStyle: 1 == parseInt(a.getAttribute("UserStyle")),
13625                      remoteWFS: 1 == parseInt(a.getAttribute("RemoteWFS")),
13626                  };
13627                  b.userSymbols = c;
13628              },
13629              LatLonBoundingBox: function (a, b) {
13630                  b.llbbox = [parseFloat(a.getAttribute("minx")), parseFloat(a.getAttribute("miny")), parseFloat(a.getAttribute("maxx")), parseFloat(a.getAttribute("maxy"))];
13631              },
13632              BoundingBox: function (a, b) {
13633                  var c = OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this, [a, b]);
13634                  c.srs = a.getAttribute("SRS");
13635                  b.bbox[c.srs] = c;
13636              },
13637              ScaleHint: function (a, b) {
13638                  var c = a.getAttribute("min"),
13639                      d = a.getAttribute("max"),
13640                      e = Math.pow(2, 0.5),
13641                      f = OpenLayers.INCHES_PER_UNIT.m;
13642                  0 != c && (b.maxScale = parseFloat(((c / e) * f * OpenLayers.DOTS_PER_INCH).toPrecision(13)));
13643                  d != Number.POSITIVE_INFINITY && (b.minScale = parseFloat(((d / e) * f * OpenLayers.DOTS_PER_INCH).toPrecision(13)));
13644              },
13645              Dimension: function (a, b) {
13646                  var c = { name: a.getAttribute("name").toLowerCase(), units: a.getAttribute("units"), unitsymbol: a.getAttribute("unitSymbol") };
13647                  b.dimensions[c.name] = c;
13648              },
13649              Extent: function (a, b) {
13650                  var c = a.getAttribute("name").toLowerCase();
13651                  if (c in b.dimensions) {
13652                      c = b.dimensions[c];
13653                      c.nearestVal = "1" === a.getAttribute("nearestValue");
13654                      c.multipleVal = "1" === a.getAttribute("multipleValues");
13655                      c.current = "1" === a.getAttribute("current");
13656                      c["default"] = a.getAttribute("default") || "";
13657                      var d = this.getChildValue(a);
13658                      c.values = d.split(",");
13659                  }
13660              },
13661          },
13662          OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms
13663      ),
13664  },
13665  CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1_1",
13666});
13667OpenLayers.Format.WMSCapabilities.v1_1_0 = OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1, {
13668  version: "1.1.0",
13669  readers: {
13670      wms: OpenLayers.Util.applyDefaults(
13671          {
13672              SRS: function (a, b) {
13673                  for (var c = this.getChildValue(a).split(/ +/), d = 0, e = c.length; d < e; d++) b.srs[c[d]] = !0;
13674              },
13675          },
13676          OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms
13677      ),
13678  },
13679  CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1_1_0",
13680});
13681OpenLayers.Protocol.WFS.v1 = OpenLayers.Class(OpenLayers.Protocol, {
13682  version: null,
13683  srsName: "EPSG:4326",
13684  featureType: null,
13685  featureNS: null,
13686  geometryName: "the_geom",
13687  schema: null,
13688  featurePrefix: "feature",
13689  formatOptions: null,
13690  readFormat: null,
13691  readOptions: null,
13692  initialize: function (a) {
13693      OpenLayers.Protocol.prototype.initialize.apply(this, [a]);
13694      a.format ||
13695          (this.format = OpenLayers.Format.WFST(
13696              OpenLayers.Util.extend(
13697                  { version: this.version, featureType: this.featureType, featureNS: this.featureNS, featurePrefix: this.featurePrefix, geometryName: this.geometryName, srsName: this.srsName, schema: this.schema },
13698                  this.formatOptions
13699              )
13700          ));
13701      !a.geometryName && 1 < parseFloat(this.format.version) && this.setGeometryName(null);
13702  },
13703  destroy: function () {
13704      this.options && !this.options.format && this.format.destroy();
13705      this.format = null;
13706      OpenLayers.Protocol.prototype.destroy.apply(this);
13707  },
13708  read: function (a) {
13709      OpenLayers.Protocol.prototype.read.apply(this, arguments);
13710      a = OpenLayers.Util.extend({}, a);
13711      OpenLayers.Util.applyDefaults(a, this.options || {});
13712      var b = new OpenLayers.Protocol.Response({ requestType: "read" }),
13713          c = OpenLayers.Format.XML.prototype.write.apply(this.format, [this.format.writeNode("wfs:GetFeature", a)]);
13714      b.priv = OpenLayers.Request.POST({ url: a.url, callback: this.createCallback(this.handleRead, b, a), params: a.params, headers: a.headers, data: c });
13715      return b;
13716  },
13717  setFeatureType: function (a) {
13718      this.featureType = a;
13719      this.format.featureType = a;
13720  },
13721  setGeometryName: function (a) {
13722      this.geometryName = a;
13723      this.format.geometryName = a;
13724  },
13725  handleRead: function (a, b) {
13726      b = OpenLayers.Util.extend({}, b);
13727      OpenLayers.Util.applyDefaults(b, this.options);
13728      if (b.callback) {
13729          var c = a.priv;
13730          200 <= c.status && 300 > c.status
13731              ? (c = this.parseResponse(c, b.readOptions)) && !1 !== c.success
13732                  ? (b.readOptions && "object" == b.readOptions.output ? OpenLayers.Util.extend(a, c) : (a.features = c), (a.code = OpenLayers.Protocol.Response.SUCCESS))
13733                  : ((a.code = OpenLayers.Protocol.Response.FAILURE), (a.error = c))
13734              : (a.code = OpenLayers.Protocol.Response.FAILURE);
13735          b.callback.call(b.scope, a);
13736      }
13737  },
13738  parseResponse: function (a, b) {
13739      var c = a.responseXML;
13740      (c && c.documentElement) || (c = a.responseText);
13741      if (!c || 0 >= c.length) return null;
13742      c = null !== this.readFormat ? this.readFormat.read(c) : this.format.read(c, b);
13743      if (!this.featureNS) {
13744          var d = this.readFormat || this.format;
13745          this.featureNS = d.featureNS;
13746          d.autoConfig = !1;
13747          this.geometryName || this.setGeometryName(d.geometryName);
13748      }
13749      return c;
13750  },
13751  commit: function (a, b) {
13752      b = OpenLayers.Util.extend({}, b);
13753      OpenLayers.Util.applyDefaults(b, this.options);
13754      var c = new OpenLayers.Protocol.Response({ requestType: "commit", reqFeatures: a });
13755      c.priv = OpenLayers.Request.POST({ url: b.url, headers: b.headers, data: this.format.write(a, b), callback: this.createCallback(this.handleCommit, c, b) });
13756      return c;
13757  },
13758  handleCommit: function (a, b) {
13759      if (b.callback) {
13760          var c = a.priv,
13761              d = c.responseXML;
13762          (d && d.documentElement) || (d = c.responseText);
13763          c = this.format.read(d) || {};
13764          a.insertIds = c.insertIds || [];
13765          c.success ? (a.code = OpenLayers.Protocol.Response.SUCCESS) : ((a.code = OpenLayers.Protocol.Response.FAILURE), (a.error = c));
13766          b.callback.call(b.scope, a);
13767      }
13768  },
13769  filterDelete: function (a, b) {
13770      b = OpenLayers.Util.extend({}, b);
13771      OpenLayers.Util.applyDefaults(b, this.options);
13772      new OpenLayers.Protocol.Response({ requestType: "commit" });
13773      var c = this.format.createElementNSPlus("wfs:Transaction", { attributes: { service: "WFS", version: this.version } }),
13774          d = this.format.createElementNSPlus("wfs:Delete", { attributes: { typeName: (b.featureNS ? this.featurePrefix + ":" : "") + b.featureType } });
13775      b.featureNS && d.setAttribute("xmlns:" + this.featurePrefix, b.featureNS);
13776      var e = this.format.writeNode("ogc:Filter", a);
13777      d.appendChild(e);
13778      c.appendChild(d);
13779      c = OpenLayers.Format.XML.prototype.write.apply(this.format, [c]);
13780      return OpenLayers.Request.POST({ url: this.url, callback: b.callback || function () {}, data: c });
13781  },
13782  abort: function (a) {
13783      a && a.priv.abort();
13784  },
13785  CLASS_NAME: "OpenLayers.Protocol.WFS.v1",
13786});
13787OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
13788  EVENTMAP: {
13789      click: { in: "click", out: "clickout" },
13790      mousemove: { in: "over", out: "out" },
13791      dblclick: { in: "dblclick", out: null },
13792      mousedown: { in: null, out: null },
13793      mouseup: { in: null, out: null },
13794      touchstart: { in: "click", out: "clickout" },
13795  },
13796  feature: null,
13797  lastFeature: null,
13798  down: null,
13799  up: null,
13800  clickTolerance: 4,
13801  geometryTypes: null,
13802  stopClick: !0,
13803  stopDown: !0,
13804  stopUp: !1,
13805  initialize: function (a, b, c, d) {
13806      OpenLayers.Handler.prototype.initialize.apply(this, [a, c, d]);
13807      this.layer = b;
13808  },
13809  touchstart: function (a) {
13810      this.startTouch();
13811      return OpenLayers.Event.isMultiTouch(a) ? !0 : this.mousedown(a);
13812  },
13813  touchmove: function (a) {
13814      OpenLayers.Event.preventDefault(a);
13815  },
13816  mousedown: function (a) {
13817      if (OpenLayers.Event.isLeftClick(a) || OpenLayers.Event.isSingleTouch(a)) this.down = a.xy;
13818      return this.handle(a) ? !this.stopDown : !0;
13819  },
13820  mouseup: function (a) {
13821      this.up = a.xy;
13822      return this.handle(a) ? !this.stopUp : !0;
13823  },
13824  click: function (a) {
13825      return this.handle(a) ? !this.stopClick : !0;
13826  },
13827  mousemove: function (a) {
13828      if (!this.callbacks.over && !this.callbacks.out) return !0;
13829      this.handle(a);
13830      return !0;
13831  },
13832  dblclick: function (a) {
13833      return !this.handle(a);
13834  },
13835  geometryTypeMatches: function (a) {
13836      return null == this.geometryTypes || -1 < OpenLayers.Util.indexOf(this.geometryTypes, a.geometry.CLASS_NAME);
13837  },
13838  handle: function (a) {
13839      this.feature && !this.feature.layer && (this.feature = null);
13840      var b = a.type,
13841          c = !1,
13842          d = !!this.feature,
13843          e = "click" == b || "dblclick" == b || "touchstart" == b;
13844      (this.feature = this.layer.getFeatureFromEvent(a)) && !this.feature.layer && (this.feature = null);
13845      this.lastFeature && !this.lastFeature.layer && (this.lastFeature = null);
13846      this.feature
13847          ? ("touchstart" === b && OpenLayers.Event.preventDefault(a),
13848            (a = this.feature != this.lastFeature),
13849            this.geometryTypeMatches(this.feature)
13850                ? (d && a ? (this.lastFeature && this.triggerCallback(b, "out", [this.lastFeature]), this.triggerCallback(b, "in", [this.feature])) : (d && !e) || this.triggerCallback(b, "in", [this.feature]),
13851                  (this.lastFeature = this.feature),
13852                  (c = !0))
13853                : (this.lastFeature && ((d && a) || e) && this.triggerCallback(b, "out", [this.lastFeature]), (this.feature = null)))
13854          : this.lastFeature && (d || e) && this.triggerCallback(b, "out", [this.lastFeature]);
13855      return c;
13856  },
13857  triggerCallback: function (a, b, c) {
13858      if ((b = this.EVENTMAP[a][b]))
13859          "click" == a && this.up && this.down ? (Math.sqrt(Math.pow(this.up.x - this.down.x, 2) + Math.pow(this.up.y - this.down.y, 2)) <= this.clickTolerance && this.callback(b, c), (this.up = this.down = null)) : this.callback(b, c);
13860  },
13861  activate: function () {
13862      var a = !1;
13863      OpenLayers.Handler.prototype.activate.apply(this, arguments) && (this.moveLayerToTop(), this.map.events.on({ removelayer: this.handleMapEvents, changelayer: this.handleMapEvents, scope: this }), (a = !0));
13864      return a;
13865  },
13866  deactivate: function () {
13867      var a = !1;
13868      OpenLayers.Handler.prototype.deactivate.apply(this, arguments) &&
13869          (this.moveLayerBack(), (this.up = this.down = this.lastFeature = this.feature = null), this.map.events.un({ removelayer: this.handleMapEvents, changelayer: this.handleMapEvents, scope: this }), (a = !0));
13870      return a;
13871  },
13872  handleMapEvents: function (a) {
13873      ("removelayer" != a.type && "order" != a.property) || this.moveLayerToTop();
13874  },
13875  moveLayerToTop: function () {
13876      var a = Math.max(this.map.Z_INDEX_BASE.Feature - 1, this.layer.getZIndex()) + 1;
13877      this.layer.setZIndex(a);
13878  },
13879  moveLayerBack: function () {
13880      var a = this.layer.getZIndex() - 1;
13881      a >= this.map.Z_INDEX_BASE.Feature ? this.layer.setZIndex(a) : this.map.setLayerZIndex(this.layer, this.map.getLayerIndex(this.layer));
13882  },
13883  CLASS_NAME: "OpenLayers.Handler.Feature",
13884});
13885OpenLayers.Layer.Vector.RootContainer = OpenLayers.Class(OpenLayers.Layer.Vector, {
13886  displayInLayerSwitcher: !1,
13887  layers: null,
13888  display: function () {},
13889  getFeatureFromEvent: function (a) {
13890      for (var b = this.layers, c, d = 0; d < b.length; d++) if ((c = b[d].getFeatureFromEvent(a))) return c;
13891  },
13892  setMap: function (a) {
13893      OpenLayers.Layer.Vector.prototype.setMap.apply(this, arguments);
13894      this.collectRoots();
13895      a.events.register("changelayer", this, this.handleChangeLayer);
13896  },
13897  removeMap: function (a) {
13898      a.events.unregister("changelayer", this, this.handleChangeLayer);
13899      this.resetRoots();
13900      OpenLayers.Layer.Vector.prototype.removeMap.apply(this, arguments);
13901  },
13902  collectRoots: function () {
13903      for (var a, b = 0; b < this.map.layers.length; ++b) (a = this.map.layers[b]), -1 != OpenLayers.Util.indexOf(this.layers, a) && a.renderer.moveRoot(this.renderer);
13904  },
13905  resetRoots: function () {
13906      for (var a, b = 0; b < this.layers.length; ++b) (a = this.layers[b]), this.renderer && a.renderer.getRenderLayerId() == this.id && this.renderer.moveRoot(a.renderer);
13907  },
13908  handleChangeLayer: function (a) {
13909      var b = a.layer;
13910      "order" == a.property && -1 != OpenLayers.Util.indexOf(this.layers, b) && (this.resetRoots(), this.collectRoots());
13911  },
13912  CLASS_NAME: "OpenLayers.Layer.Vector.RootContainer",
13913});
13914OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
13915  multipleKey: null,
13916  toggleKey: null,
13917  multiple: !1,
13918  clickout: !0,
13919  toggle: !1,
13920  hover: !1,
13921  highlightOnly: !1,
13922  box: !1,
13923  onBeforeSelect: function () {},
13924  onSelect: function () {},
13925  onUnselect: function () {},
13926  scope: null,
13927  geometryTypes: null,
13928  layer: null,
13929  layers: null,
13930  callbacks: null,
13931  selectStyle: null,
13932  renderIntent: "select",
13933  handlers: null,
13934  initialize: function (a, b) {
13935      OpenLayers.Control.prototype.initialize.apply(this, [b]);
13936      null === this.scope && (this.scope = this);
13937      this.initLayer(a);
13938      var c = { click: this.clickFeature, clickout: this.clickoutFeature };
13939      this.hover && ((c.over = this.overFeature), (c.out = this.outFeature));
13940      this.callbacks = OpenLayers.Util.extend(c, this.callbacks);
13941      this.handlers = { feature: new OpenLayers.Handler.Feature(this, this.layer, this.callbacks, { geometryTypes: this.geometryTypes }) };
13942      this.box && (this.handlers.box = new OpenLayers.Handler.Box(this, { done: this.selectBox }, { boxDivClassName: "olHandlerBoxSelectFeature" }));
13943  },
13944  initLayer: function (a) {
13945      OpenLayers.Util.isArray(a) ? ((this.layers = a), (this.layer = new OpenLayers.Layer.Vector.RootContainer(this.id + "_container", { layers: a }))) : (this.layer = a);
13946  },
13947  destroy: function () {
13948      this.active && this.layers && this.map.removeLayer(this.layer);
13949      OpenLayers.Control.prototype.destroy.apply(this, arguments);
13950      this.layers && this.layer.destroy();
13951  },
13952  activate: function () {
13953      this.active || (this.layers && this.map.addLayer(this.layer), this.handlers.feature.activate(), this.box && this.handlers.box && this.handlers.box.activate());
13954      return OpenLayers.Control.prototype.activate.apply(this, arguments);
13955  },
13956  deactivate: function () {
13957      this.active && (this.handlers.feature.deactivate(), this.handlers.box && this.handlers.box.deactivate(), this.layers && this.map.removeLayer(this.layer));
13958      return OpenLayers.Control.prototype.deactivate.apply(this, arguments);
13959  },
13960  unselectAll: function (a) {
13961      var b = this.layers || [this.layer],
13962          c,
13963          d,
13964          e,
13965          f;
13966      for (e = 0; e < b.length; ++e) if (((c = b[e]), (f = 0), null != c.selectedFeatures)) for (; c.selectedFeatures.length > f; ) (d = c.selectedFeatures[f]), a && a.except == d ? ++f : this.unselect(d);
13967  },
13968  clickFeature: function (a) {
13969      this.hover ||
13970          (-1 < OpenLayers.Util.indexOf(a.layer.selectedFeatures, a)
13971              ? this.toggleSelect()
13972                  ? this.unselect(a)
13973                  : this.multipleSelect() || this.unselectAll({ except: a })
13974              : (this.multipleSelect() || this.unselectAll({ except: a }), this.select(a)));
13975  },
13976  multipleSelect: function () {
13977      return this.multiple || (this.handlers.feature.evt && this.handlers.feature.evt[this.multipleKey]);
13978  },
13979  toggleSelect: function () {
13980      return this.toggle || (this.handlers.feature.evt && this.handlers.feature.evt[this.toggleKey]);
13981  },
13982  clickoutFeature: function (a) {
13983      !this.hover && this.clickout && this.unselectAll();
13984  },
13985  overFeature: function (a) {
13986      var b = a.layer;
13987      this.hover && (this.highlightOnly ? this.highlight(a) : -1 == OpenLayers.Util.indexOf(b.selectedFeatures, a) && this.select(a));
13988  },
13989  outFeature: function (a) {
13990      if (this.hover)
13991          if (this.highlightOnly) {
13992              if (a._lastHighlighter == this.id)
13993                  if (a._prevHighlighter && a._prevHighlighter != this.id) {
13994                      delete a._lastHighlighter;
13995                      var b = this.map.getControl(a._prevHighlighter);
13996                      b && b.highlight(a);
13997                  } else this.unhighlight(a);
13998          } else this.unselect(a);
13999  },
14000  highlight: function (a) {
14001      var b = a.layer;
14002      !1 !== this.events.triggerEvent("beforefeaturehighlighted", { feature: a }) &&
14003          ((a._prevHighlighter = a._lastHighlighter), (a._lastHighlighter = this.id), b.drawFeature(a, this.selectStyle || this.renderIntent), this.events.triggerEvent("featurehighlighted", { feature: a }));
14004  },
14005  unhighlight: function (a) {
14006      var b = a.layer;
14007      void 0 == a._prevHighlighter ? delete a._lastHighlighter : (a._prevHighlighter != this.id && (a._lastHighlighter = a._prevHighlighter), delete a._prevHighlighter);
14008      b.drawFeature(a, a.style || a.layer.style || "default");
14009      this.events.triggerEvent("featureunhighlighted", { feature: a });
14010  },
14011  select: function (a) {
14012      var b = this.onBeforeSelect.call(this.scope, a),
14013          c = a.layer;
14014      !1 !== b &&
14015          ((b = c.events.triggerEvent("beforefeatureselected", { feature: a })),
14016          !1 !== b &&
14017              (c.selectedFeatures.push(a),
14018              this.highlight(a),
14019              this.handlers.feature.lastFeature || (this.handlers.feature.lastFeature = c.selectedFeatures[0]),
14020              c.events.triggerEvent("featureselected", { feature: a }),
14021              this.onSelect.call(this.scope, a)));
14022  },
14023  unselect: function (a) {
14024      var b = a.layer;
14025      this.unhighlight(a);
14026      OpenLayers.Util.removeItem(b.selectedFeatures, a);
14027      b.events.triggerEvent("featureunselected", { feature: a });
14028      this.onUnselect.call(this.scope, a);
14029  },
14030  selectBox: function (a) {
14031      if (a instanceof OpenLayers.Bounds) {
14032          var b = this.map.getLonLatFromPixel({ x: a.left, y: a.bottom });
14033          a = this.map.getLonLatFromPixel({ x: a.right, y: a.top });
14034          b = new OpenLayers.Bounds(b.lon, b.lat, a.lon, a.lat);
14035          this.multipleSelect() || this.unselectAll();
14036          a = this.multiple;
14037          this.multiple = !0;
14038          var c = this.layers || [this.layer];
14039          this.events.triggerEvent("boxselectionstart", { layers: c });
14040          for (var d, e = 0; e < c.length; ++e) {
14041              d = c[e];
14042              for (var f = 0, g = d.features.length; f < g; ++f) {
14043                  var h = d.features[f];
14044                  h.getVisibility() &&
14045                      (null == this.geometryTypes || -1 < OpenLayers.Util.indexOf(this.geometryTypes, h.geometry.CLASS_NAME)) &&
14046                      b.toGeometry().intersects(h.geometry) &&
14047                      -1 == OpenLayers.Util.indexOf(d.selectedFeatures, h) &&
14048                      this.select(h);
14049              }
14050          }
14051          this.multiple = a;
14052          this.events.triggerEvent("boxselectionend", { layers: c });
14053      }
14054  },
14055  setMap: function (a) {
14056      this.handlers.feature.setMap(a);
14057      this.box && this.handlers.box.setMap(a);
14058      OpenLayers.Control.prototype.setMap.apply(this, arguments);
14059  },
14060  setLayer: function (a) {
14061      var b = this.active;
14062      this.unselectAll();
14063      this.deactivate();
14064      this.layers && (this.layer.destroy(), (this.layers = null));
14065      this.initLayer(a);
14066      this.handlers.feature.layer = this.layer;
14067      b && this.activate();
14068  },
14069  CLASS_NAME: "OpenLayers.Control.SelectFeature",
14070});
14071OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
14072  point: null,
14073  layer: null,
14074  multi: !1,
14075  citeCompliant: !1,
14076  mouseDown: !1,
14077  stoppedDown: null,
14078  lastDown: null,
14079  lastUp: null,
14080  persist: !1,
14081  stopDown: !1,
14082  stopUp: !1,
14083  layerOptions: null,
14084  pixelTolerance: 5,
14085  lastTouchPx: null,
14086  initialize: function (a, b, c) {
14087      (c && c.layerOptions && c.layerOptions.styleMap) || (this.style = OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"], {}));
14088      OpenLayers.Handler.prototype.initialize.apply(this, arguments);
14089  },
14090  activate: function () {
14091      if (!OpenLayers.Handler.prototype.activate.apply(this, arguments)) return !1;
14092      var a = OpenLayers.Util.extend({ displayInLayerSwitcher: !1, calculateInRange: OpenLayers.Function.True, wrapDateLine: this.citeCompliant }, this.layerOptions);
14093      this.layer = new OpenLayers.Layer.Vector(this.CLASS_NAME, a);
14094      this.map.addLayer(this.layer);
14095      return !0;
14096  },
14097  createFeature: function (a) {
14098      a = this.layer.getLonLatFromViewPortPx(a);
14099      a = new OpenLayers.Geometry.Point(a.lon, a.lat);
14100      this.point = new OpenLayers.Feature.Vector(a);
14101      this.callback("create", [this.point.geometry, this.point]);
14102      this.point.geometry.clearBounds();
14103      this.layer.addFeatures([this.point], { silent: !0 });
14104  },
14105  deactivate: function () {
14106      if (!OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) return !1;
14107      this.cancel();
14108      null != this.layer.map && (this.destroyFeature(!0), this.layer.destroy(!1));
14109      this.layer = null;
14110      return !0;
14111  },
14112  destroyFeature: function (a) {
14113      !this.layer || (!a && this.persist) || this.layer.destroyFeatures();
14114      this.point = null;
14115  },
14116  destroyPersistedFeature: function () {
14117      var a = this.layer;
14118      a && 1 < a.features.length && this.layer.features[0].destroy();
14119  },
14120  finalize: function (a) {
14121      this.mouseDown = !1;
14122      this.lastTouchPx = this.lastUp = this.lastDown = null;
14123      this.callback(a ? "cancel" : "done", [this.geometryClone()]);
14124      this.destroyFeature(a);
14125  },
14126  cancel: function () {
14127      this.finalize(!0);
14128  },
14129  click: function (a) {
14130      OpenLayers.Event.stop(a);
14131      return !1;
14132  },
14133  dblclick: function (a) {
14134      OpenLayers.Event.stop(a);
14135      return !1;
14136  },
14137  modifyFeature: function (a) {
14138      this.point || this.createFeature(a);
14139      a = this.layer.getLonLatFromViewPortPx(a);
14140      this.point.geometry.x = a.lon;
14141      this.point.geometry.y = a.lat;
14142      this.callback("modify", [this.point.geometry, this.point, !1]);
14143      this.point.geometry.clearBounds();
14144      this.drawFeature();
14145  },
14146  drawFeature: function () {
14147      this.layer.drawFeature(this.point, this.style);
14148  },
14149  getGeometry: function () {
14150      var a = this.point && this.point.geometry;
14151      a && this.multi && (a = new OpenLayers.Geometry.MultiPoint([a]));
14152      return a;
14153  },
14154  geometryClone: function () {
14155      var a = this.getGeometry();
14156      return a && a.clone();
14157  },
14158  mousedown: function (a) {
14159      return this.down(a);
14160  },
14161  touchstart: function (a) {
14162      this.startTouch();
14163      this.lastTouchPx = a.xy;
14164      return this.down(a);
14165  },
14166  mousemove: function (a) {
14167      return this.move(a);
14168  },
14169  touchmove: function (a) {
14170      this.lastTouchPx = a.xy;
14171      return this.move(a);
14172  },
14173  mouseup: function (a) {
14174      return this.up(a);
14175  },
14176  touchend: function (a) {
14177      a.xy = this.lastTouchPx;
14178      return this.up(a);
14179  },
14180  down: function (a) {
14181      this.mouseDown = !0;
14182      this.lastDown = a.xy;
14183      this.touch || this.modifyFeature(a.xy);
14184      this.stoppedDown = this.stopDown;
14185      return !this.stopDown;
14186  },
14187  move: function (a) {
14188      this.touch || (this.mouseDown && !this.stoppedDown) || this.modifyFeature(a.xy);
14189      return !0;
14190  },
14191  up: function (a) {
14192      this.mouseDown = !1;
14193      this.stoppedDown = this.stopDown;
14194      if (!this.checkModifiers(a) || (this.lastUp && this.lastUp.equals(a.xy)) || !this.lastDown || !this.passesTolerance(this.lastDown, a.xy, this.pixelTolerance)) return !0;
14195      this.touch && this.modifyFeature(a.xy);
14196      this.persist && this.destroyPersistedFeature();
14197      this.lastUp = a.xy;
14198      this.finalize();
14199      return !this.stopUp;
14200  },
14201  mouseout: function (a) {
14202      OpenLayers.Util.mouseLeft(a, this.map.viewPortDiv) && ((this.stoppedDown = this.stopDown), (this.mouseDown = !1));
14203  },
14204  passesTolerance: function (a, b, c) {
14205      var d = !0;
14206      null != c && a && b && a.distanceTo(b) > c && (d = !1);
14207      return d;
14208  },
14209  CLASS_NAME: "OpenLayers.Handler.Point",
14210});
14211OpenLayers.Handler.Path = OpenLayers.Class(OpenLayers.Handler.Point, {
14212  line: null,
14213  maxVertices: null,
14214  doubleTouchTolerance: 20,
14215  freehand: !1,
14216  freehandToggle: "shiftKey",
14217  timerId: null,
14218  redoStack: null,
14219  createFeature: function (a) {
14220      a = this.layer.getLonLatFromViewPortPx(a);
14221      a = new OpenLayers.Geometry.Point(a.lon, a.lat);
14222      this.point = new OpenLayers.Feature.Vector(a);
14223      this.line = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));
14224      this.callback("create", [this.point.geometry, this.getSketch()]);
14225      this.point.geometry.clearBounds();
14226      this.layer.addFeatures([this.line, this.point], { silent: !0 });
14227  },
14228  destroyFeature: function (a) {
14229      OpenLayers.Handler.Point.prototype.destroyFeature.call(this, a);
14230      this.line = null;
14231  },
14232  destroyPersistedFeature: function () {
14233      var a = this.layer;
14234      a && 2 < a.features.length && this.layer.features[0].destroy();
14235  },
14236  removePoint: function () {
14237      this.point && this.layer.removeFeatures([this.point]);
14238  },
14239  addPoint: function (a) {
14240      this.layer.removeFeatures([this.point]);
14241      a = this.layer.getLonLatFromViewPortPx(a);
14242      this.point = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a.lon, a.lat));
14243      this.line.geometry.addComponent(this.point.geometry, this.line.geometry.components.length);
14244      this.layer.addFeatures([this.point]);
14245      this.callback("point", [this.point.geometry, this.getGeometry()]);
14246      this.callback("modify", [this.point.geometry, this.getSketch()]);
14247      this.drawFeature();
14248      delete this.redoStack;
14249  },
14250  insertXY: function (a, b) {
14251      this.line.geometry.addComponent(new OpenLayers.Geometry.Point(a, b), this.getCurrentPointIndex());
14252      this.drawFeature();
14253      delete this.redoStack;
14254  },
14255  insertDeltaXY: function (a, b) {
14256      var c = this.getCurrentPointIndex() - 1,
14257          c = this.line.geometry.components[c];
14258      !c || isNaN(c.x) || isNaN(c.y) || this.insertXY(c.x + a, c.y + b);
14259  },
14260  insertDirectionLength: function (a, b) {
14261      a *= Math.PI / 180;
14262      var c = b * Math.cos(a),
14263          d = b * Math.sin(a);
14264      this.insertDeltaXY(c, d);
14265  },
14266  insertDeflectionLength: function (a, b) {
14267      var c = this.getCurrentPointIndex() - 1;
14268      if (0 < c) {
14269          var d = this.line.geometry.components[c],
14270              c = this.line.geometry.components[c - 1],
14271              d = Math.atan2(d.y - c.y, d.x - c.x);
14272          this.insertDirectionLength((180 * d) / Math.PI + a, b);
14273      }
14274  },
14275  getCurrentPointIndex: function () {
14276      return this.line.geometry.components.length - 1;
14277  },
14278  undo: function () {
14279      var a = this.line.geometry,
14280          b = a.components,
14281          c = this.getCurrentPointIndex() - 1,
14282          d = b[c],
14283          e = a.removeComponent(d);
14284      e && (this.touch && 0 < c && ((b = a.components), (a = b[c - 1]), (c = this.getCurrentPointIndex()), (b = b[c]), (b.x = a.x), (b.y = a.y)), this.redoStack || (this.redoStack = []), this.redoStack.push(d), this.drawFeature());
14285      return e;
14286  },
14287  redo: function () {
14288      var a = this.redoStack && this.redoStack.pop();
14289      a && (this.line.geometry.addComponent(a, this.getCurrentPointIndex()), this.drawFeature());
14290      return !!a;
14291  },
14292  freehandMode: function (a) {
14293      return this.freehandToggle && a[this.freehandToggle] ? !this.freehand : this.freehand;
14294  },
14295  modifyFeature: function (a, b) {
14296      this.line || this.createFeature(a);
14297      var c = this.layer.getLonLatFromViewPortPx(a);
14298      this.point.geometry.x = c.lon;
14299      this.point.geometry.y = c.lat;
14300      this.callback("modify", [this.point.geometry, this.getSketch(), b]);
14301      this.point.geometry.clearBounds();
14302      this.drawFeature();
14303  },
14304  drawFeature: function () {
14305      this.layer.drawFeature(this.line, this.style);
14306      this.layer.drawFeature(this.point, this.style);
14307  },
14308  getSketch: function () {
14309      return this.line;
14310  },
14311  getGeometry: function () {
14312      var a = this.line && this.line.geometry;
14313      a && this.multi && (a = new OpenLayers.Geometry.MultiLineString([a]));
14314      return a;
14315  },
14316  touchstart: function (a) {
14317      if (this.timerId && this.passesTolerance(this.lastTouchPx, a.xy, this.doubleTouchTolerance)) return this.finishGeometry(), window.clearTimeout(this.timerId), (this.timerId = null), !1;
14318      this.timerId && (window.clearTimeout(this.timerId), (this.timerId = null));
14319      this.timerId = window.setTimeout(
14320          OpenLayers.Function.bind(function () {
14321              this.timerId = null;
14322          }, this),
14323          300
14324      );
14325      return OpenLayers.Handler.Point.prototype.touchstart.call(this, a);
14326  },
14327  down: function (a) {
14328      var b = this.stopDown;
14329      this.freehandMode(a) && ((b = !0), this.touch && (this.modifyFeature(a.xy, !!this.lastUp), OpenLayers.Event.stop(a)));
14330      this.touch || (this.lastDown && this.passesTolerance(this.lastDown, a.xy, this.pixelTolerance)) || this.modifyFeature(a.xy, !!this.lastUp);
14331      this.mouseDown = !0;
14332      this.lastDown = a.xy;
14333      this.stoppedDown = b;
14334      return !b;
14335  },
14336  move: function (a) {
14337      if (this.stoppedDown && this.freehandMode(a))
14338          return this.persist && this.destroyPersistedFeature(), this.maxVertices && this.line && this.line.geometry.components.length === this.maxVertices ? (this.removePoint(), this.finalize()) : this.addPoint(a.xy), !1;
14339      this.touch || (this.mouseDown && !this.stoppedDown) || this.modifyFeature(a.xy, !!this.lastUp);
14340      return !0;
14341  },
14342  up: function (a) {
14343      !this.mouseDown ||
14344          (this.lastUp && this.lastUp.equals(a.xy)) ||
14345          (this.stoppedDown && this.freehandMode(a)
14346              ? (this.persist && this.destroyPersistedFeature(), this.removePoint(), this.finalize())
14347              : this.passesTolerance(this.lastDown, a.xy, this.pixelTolerance) &&
14348                (this.touch && this.modifyFeature(a.xy),
14349                null == this.lastUp && this.persist && this.destroyPersistedFeature(),
14350                this.addPoint(a.xy),
14351                (this.lastUp = a.xy),
14352                this.line.geometry.components.length === this.maxVertices + 1 && this.finishGeometry()));
14353      this.stoppedDown = this.stopDown;
14354      this.mouseDown = !1;
14355      return !this.stopUp;
14356  },
14357  finishGeometry: function () {
14358      this.line.geometry.removeComponent(this.line.geometry.components[this.line.geometry.components.length - 1]);
14359      this.removePoint();
14360      this.finalize();
14361  },
14362  dblclick: function (a) {
14363      this.freehandMode(a) || this.finishGeometry();
14364      return !1;
14365  },
14366  CLASS_NAME: "OpenLayers.Handler.Path",
14367});
14368OpenLayers.Spherical = OpenLayers.Spherical || {};
14369OpenLayers.Spherical.DEFAULT_RADIUS = 6378137;
14370OpenLayers.Spherical.computeDistanceBetween = function (a, b, c) {
14371  c = c || OpenLayers.Spherical.DEFAULT_RADIUS;
14372  var d = Math.sin((Math.PI * (b.lon - a.lon)) / 360),
14373      e = Math.sin((Math.PI * (b.lat - a.lat)) / 360);
14374  a = e * e + d * d * Math.cos((Math.PI * a.lat) / 180) * Math.cos((Math.PI * b.lat) / 180);
14375  return 2 * c * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
14376};
14377OpenLayers.Spherical.computeHeading = function (a, b) {
14378  var c = Math.sin((Math.PI * (a.lon - b.lon)) / 180) * Math.cos((Math.PI * b.lat) / 180),
14379      d = Math.cos((Math.PI * a.lat) / 180) * Math.sin((Math.PI * b.lat) / 180) - Math.sin((Math.PI * a.lat) / 180) * Math.cos((Math.PI * b.lat) / 180) * Math.cos((Math.PI * (a.lon - b.lon)) / 180);
14380  return (180 * Math.atan2(c, d)) / Math.PI;
14381};
14382OpenLayers.Control.CacheWrite = OpenLayers.Class(OpenLayers.Control, {
14383  layers: null,
14384  imageFormat: "image/png",
14385  quotaRegEx: /quota/i,
14386  setMap: function (a) {
14387      OpenLayers.Control.prototype.setMap.apply(this, arguments);
14388      var b,
14389          c = this.layers || a.layers;
14390      for (b = c.length - 1; 0 <= b; --b) this.addLayer({ layer: c[b] });
14391      if (!this.layers) a.events.on({ addlayer: this.addLayer, removeLayer: this.removeLayer, scope: this });
14392  },
14393  addLayer: function (a) {
14394      a.layer.events.on({ tileloadstart: this.makeSameOrigin, tileloaded: this.onTileLoaded, scope: this });
14395  },
14396  removeLayer: function (a) {
14397      a.layer.events.un({ tileloadstart: this.makeSameOrigin, tileloaded: this.onTileLoaded, scope: this });
14398  },
14399  makeSameOrigin: function (a) {
14400      if (this.active && ((a = a.tile), a instanceof OpenLayers.Tile.Image && !a.crossOriginKeyword && "data:" !== a.url.substr(0, 5))
14400) {
14401          var b = OpenLayers.Request.makeSameOrigin(a.url, OpenLayers.ProxyHost);
14402          OpenLayers.Control.CacheWrite.urlMap[b] = a.url;
14403          a.url = b;
14404      }
14405  },
14406  onTileLoaded: function (a) {
14407      this.active && !a.aborted && a.tile instanceof OpenLayers.Tile.Image && "data:" !== a.tile.url.substr(0, 5) && (this.cache({ tile: a.tile }), delete OpenLayers.Control.CacheWrite.urlMap[a.tile.url]);
14408  },
14409  cache: function (a) {
14410      if (window.localStorage) {
14411          a = a.tile;
14412          try {
14413              var b = a.getCanvasContext();
14414              b && window.localStorage.setItem("olCache_" + (OpenLayers.Control.CacheWrite.urlMap[a.url] || a.url), b.canvas.toDataURL(this.imageFormat));
14415          } catch (c) {
14416              (b = c.name || c.message) && this.quotaRegEx.test(b) ? this.events.triggerEvent("cachefull", { tile: a }) : OpenLayers.Console.error(c.toString());
14417          }
14418      }
14419  },
14420  destroy: function () {
14421      if (this.layers || this.map) {
14422          var a,
14423              b = this.layers || this.map.layers;
14424          for (a = b.length - 1; 0 <= a; --a) this.removeLayer({ layer: b[a] });
14425      }
14426      this.map && this.map.events.un({ addlayer: this.addLayer, removeLayer: this.removeLayer, scope: this });
14427      OpenLayers.Control.prototype.destroy.apply(this, arguments);
14428  },
14429  CLASS_NAME: "OpenLayers.Control.CacheWrite",
14430});
14431OpenLayers.Control.CacheWrite.clearCache = function () {
14432  if (window.localStorage) {
14433      var a, b;
14434      for (a = window.localStorage.length - 1; 0 <= a; --a) (b = window.localStorage.key(a)), "olCache_" === b.substr(0, 8) && window.localStorage.removeItem(b);
14435  }
14436};
14437OpenLayers.Control.CacheWrite.urlMap = {};
14438OpenLayers.Format.Context = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, {
14439  layerOptions: null,
14440  layerParams: null,
14441  read: function (a, b) {
14442      var c = OpenLayers.Format.XML.VersionedOGC.prototype.read.apply(this, arguments);
14443      if (b && b.map)
14444          if (((this.context = c), b.map instanceof OpenLayers.Map)) c = this.mergeContextToMap(c, b.map);
14445          else {
14446              var d = b.map;
14447              if (OpenLayers.Util.isElement(d) || "string" == typeof d) d = { div: d };
14448              c = this.contextToMap(c, d);
14449          }
14450      return c;
14451  },
14452  getLayerFromContext: function (a) {
14453      var b,
14454          c,
14455          d = {
14456              queryable: a.queryable,
14457              visibility: a.visibility,
14458              maxExtent: a.maxExtent,
14459              metadata: OpenLayers.Util.applyDefaults(a.metadata, { styles: a.styles, formats: a.formats, abstract: a["abstract"], dataURL: a.dataURL }),
14460              numZoomLevels: a.numZoomLevels,
14461              units: a.units,
14462              isBaseLayer: a.isBaseLayer,
14463              opacity: a.opacity,
14464              displayInLayerSwitcher: a.displayInLayerSwitcher,
14465              singleTile: a.singleTile,
14466              tileSize: a.tileSize ? new OpenLayers.Size(a.tileSize.width, a.tileSize.height) : void 0,
14467              minScale: a.minScale || a.maxScaleDenominator,
14468              maxScale: a.maxScale || a.minScaleDenominator,
14469              srs: a.srs,
14470              dimensions: a.dimensions,
14471              metadataURL: a.metadataURL,
14472          };
14473      this.layerOptions && OpenLayers.Util.applyDefaults(d, this.layerOptions);
14474      var e = { layers: a.name, transparent: a.transparent, version: a.version };
14475      if (a.formats && 0 < a.formats.length)
14476          for (e.format = a.formats[0].value, b = 0, c = a.formats.length; b < c; b++) {
14477              var f = a.formats[b];
14478              if (!0 == f.current) {
14479                  e.format = f.value;
14480                  break;
14481              }
14482          }
14483      if (a.styles && 0 < a.styles.length)
14484          for (b = 0, c = a.styles.length; b < c; b++)
14485              if (((f = a.styles[b]), !0 == f.current)) {
14486                  f.href ? (e.sld = f.href) : f.body ? (e.sld_body = f.body) : (e.styles = f.name);
14487                  break;
14488              }
14489      this.layerParams && OpenLayers.Util.applyDefaults(e, this.layerParams);
14490      b = null;
14491      c = a.service;
14492      c == OpenLayers.Format.Context.serviceTypes.WFS
14493          ? ((d.strategies = [new OpenLayers.Strategy.BBOX()]),
14494            (d.protocol = new OpenLayers.Protocol.WFS({ url: a.url, featurePrefix: a.name.split(":")[0], featureType: a.name.split(":").pop() })),
14495            (b = new OpenLayers.Layer.Vector(a.title || a.name, d)))
14496          : c == OpenLayers.Format.Context.serviceTypes.KML
14497          ? ((d.strategies = [new OpenLayers.Strategy.Fixed()]), (d.protocol = new OpenLayers.Protocol.HTTP({ url: a.url, format: new OpenLayers.Format.KML() })), (b = new OpenLayers.Layer.Vector(a.title || a.name, d)))
14498          : c == OpenLayers.Format.Context.serviceTypes.GML
14499          ? ((d.strategies = [new OpenLayers.Strategy.Fixed()]), (d.protocol = new OpenLayers.Protocol.HTTP({ url: a.url, format: new OpenLayers.Format.GML() })), (b = new OpenLayers.Layer.Vector(a.title || a.name, d)))
14500          : a.features
14501          ? ((b = new OpenLayers.Layer.Vector(a.title || a.name, d)), b.addFeatures(a.features))
14502          : !0 !== a.categoryLayer && (b = new OpenLayers.Layer.WMS(a.title || a.name, a.url, e, d));
14503      return b;
14504  },
14505  getLayersFromContext: function (a) {
14506      for (var b = [], c = 0, d = a.length; c < d; c++) {
14507          var e = this.getLayerFromContext(a[c]);
14508          null !== e && b.push(e);
14509      }
14510      return b;
14511  },
14512  contextToMap: function (a, b) {
14513      b = OpenLayers.Util.applyDefaults({ maxExtent: a.maxExtent, projection: a.projection, units: a.units }, b);
14514      b.maxExtent && (b.maxResolution = b.maxExtent.getWidth() / OpenLayers.Map.TILE_WIDTH);
14515      b.metadata = { contactInformation: a.contactInformation, abstract: a["abstract"], keywords: a.keywords, logo: a.logo, descriptionURL: a.descriptionURL };
14516      var c = new OpenLayers.Map(b);
14517      c.addLayers(this.getLayersFromContext(a.layersContext));
14518      c.setCenter(a.bounds.getCenterLonLat(), c.getZoomForExtent(a.bounds, !0));
14519      return c;
14520  },
14521  mergeContextToMap: function (a, b) {
14522      b.addLayers(this.getLayersFromContext(a.layersContext));
14523      return b;
14524  },
14525  write: function (a, b) {
14526      a = this.toContext(a);
14527      return OpenLayers.Format.XML.VersionedOGC.prototype.write.apply(this, arguments);
14528  },
14529  CLASS_NAME: "OpenLayers.Format.Context",
14530});
14531OpenLayers.Format.Context.serviceTypes = {
14532  WMS: "urn:ogc:serviceType:WMS",
14533  WFS: "urn:ogc:serviceType:WFS",
14534  WCS: "urn:ogc:serviceType:WCS",
14535  GML: "urn:ogc:serviceType:GML",
14536  SLD: "urn:ogc:serviceType:SLD",
14537  FES: "urn:ogc:serviceType:FES",
14538  KML: "urn:ogc:serviceType:KML",
14539};
14540OpenLayers.Format.WMC = OpenLayers.Class(OpenLayers.Format.Context, {
14541  defaultVersion: "1.1.0",
14542  layerToContext: function (a) {
14543      var b = this.getParser(),
14544          c = {
14545              queryable: a.queryable,
14546              visibility: a.visibility,
14547              name: a.params.LAYERS,
14548              title: a.name,
14549              abstract: a.metadata["abstract"],
14550              dataURL: a.metadata.dataURL,
14551              metadataURL: a.metadataURL,
14552              server: { version: a.params.VERSION, url: a.url },
14553              maxExtent: a.maxExtent,
14554              transparent: a.params.TRANSPARENT,
14555              numZoomLevels: a.numZoomLevels,
14556              units: a.units,
14557              isBaseLayer: a.isBaseLayer,
14558              opacity: 1 == a.opacity ? void 0 : a.opacity,
14559              displayInLayerSwitcher: a.displayInLayerSwitcher,
14560              singleTile: a.singleTile,
14561              tileSize: a.singleTile || !a.tileSize ? void 0 : { width: a.tileSize.w, height: a.tileSize.h },
14562              minScale: a.options.resolutions || a.options.scales || a.options.maxResolution || a.options.minScale ? a.minScale : void 0,
14563              maxScale: a.options.resolutions || a.options.scales || a.options.minResolution || a.options.maxScale ? a.maxScale : void 0,
14564              formats: [],
14565              styles: [],
14566              srs: a.srs,
14567              dimensions: a.dimensions,
14568          };
14569      a.metadata.servertitle && (c.server.title = a.metadata.servertitle);
14570      if (a.metadata.formats && 0 < a.metadata.formats.length)
14571          for (var d = 0, e = a.metadata.formats.length; d < e; d++) {
14572              var f = a.metadata.formats[d];
14573              c.formats.push({ value: f.value, current: f.value == a.params.FORMAT });
14574          }
14575      else c.formats.push({ value: a.params.FORMAT, current: !0 });
14576      if (a.metadata.styles && 0 < a.metadata.styles.length)
14577          for (d = 0, e = a.metadata.styles.length; d < e; d++) (b = a.metadata.styles[d]), (b.current = b.href == a.params.SLD || b.body == a.params.SLD_BODY || b.name == a.params.STYLES ? !0 : !1), c.styles.push(b);
14578      else c.styles.push({ href: a.params.SLD, body: a.params.SLD_BODY, name: a.params.STYLES || b.defaultStyleName, title: b.defaultStyleTitle, current: !0 });
14579      return c;
14580  },
14581  toContext: function (a) {
14582      var b = {},
14583          c = a.layers;
14584      if ("OpenLayers.Map" == a.CLASS_NAME) {
14585          var d = a.metadata || {};
14586          b.size = a.getSize();
14587          b.bounds = a.getExtent();
14588          b.projection = a.projection;
14589          b.title = a.title;
14590          b.keywords = d.keywords;
14591          b["abstract"] = d["abstract"];
14592          b.logo = d.logo;
14593          b.descriptionURL = d.descriptionURL;
14594          b.contactInformation = d.contactInformation;
14595          b.maxExtent = a.maxExtent;
14596      } else OpenLayers.Util.applyDefaults(b, a), void 0 != b.layers && delete b.layers;
14597      void 0 == b.layersContext && (b.layersContext = []);
14598      if (void 0 != c && OpenLayers.Util.isArray(c))
14599          for (a = 0, d = c.length; a < d; a++) {
14600              var e = c[a];
14601              e instanceof OpenLayers.Layer.WMS && b.layersContext.push(this.layerToContext(e));
14602          }
14603      return b;
14604  },
14605  CLASS_NAME: "OpenLayers.Format.WMC",
14606});
14607OpenLayers.Format.WMC.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
14608  namespaces: { ol: "http://openlayers.org/context", wmc: "http://www.opengis.net/context", sld: "http://www.opengis.net/sld", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
14609  schemaLocation: "",
14610  getNamespacePrefix: function (a) {
14611      var b = null;
14612      if (null == a) b = this.namespaces[this.defaultPrefix];
14613      else for (b in this.namespaces) if (this.namespaces[b] == a) break;
14614      return b;
14615  },
14616  defaultPrefix: "wmc",
14617  rootPrefix: null,
14618  defaultStyleName: "",
14619  defaultStyleTitle: "Default",
14620  initialize: function (a) {
14621      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
14622  },
14623  read: function (a) {
14624      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
14625      a = a.documentElement;
14626      this.rootPrefix = a.prefix;
14627      var b = { version: a.getAttribute("version") };
14628      this.runChildNodes(b, a);
14629      return b;
14630  },
14631  runChildNodes: function (a, b) {
14632      for (var c = b.childNodes, d, e, f, g = 0, h = c.length; g < h; ++g)
14633          (d = c[g]), 1 == d.nodeType && ((e = this.getNamespacePrefix(d.namespaceURI)), (f = d.nodeName.split(":").pop()), (e = this["read_" + e + "_" + f]) && e.apply(this, [a, d]));
14634  },
14635  read_wmc_General: function (a, b) {
14636      this.runChildNodes(a, b);
14637  },
14638  read_wmc_BoundingBox: function (a, b) {
14639      a.projection = b.getAttribute("SRS");
14640      a.bounds = new OpenLayers.Bounds(b.getAttribute("minx"), b.getAttribute("miny"), b.getAttribute("maxx"), b.getAttribute("maxy"));
14641  },
14642  read_wmc_LayerList: function (a, b) {
14643      a.layersContext = [];
14644      this.runChildNodes(a, b);
14645  },
14646  read_wmc_Layer: function (a, b) {
14647      var c = { visibility: "1" != b.getAttribute("hidden"), queryable: "1" == b.getAttribute("queryable"), formats: [], styles: [], metadata: {} };
14648      this.runChildNodes(c, b);
14649      a.layersContext.push(c);
14650  },
14651  read_wmc_Extension: function (a, b) {
14652      this.runChildNodes(a, b);
14653  },
14654  read_ol_units: function (a, b) {
14655      a.units = this.getChildValue(b);
14656  },
14657  read_ol_maxExtent: function (a, b) {
14658      var c = new OpenLayers.Bounds(b.getAttribute("minx"), b.getAttribute("miny"), b.getAttribute("maxx"), b.getAttribute("maxy"));
14659      a.maxExtent = c;
14660  },
14661  read_ol_transparent: function (a, b) {
14662      a.transparent = this.getChildValue(b);
14663  },
14664  read_ol_numZoomLevels: function (a, b) {
14665      a.numZoomLevels = parseInt(this.getChildValue(b));
14666  },
14667  read_ol_opacity: function (a, b) {
14668      a.opacity = parseFloat(this.getChildValue(b));
14669  },
14670  read_ol_singleTile: function (a, b) {
14671      a.singleTile = "true" == this.getChildValue(b);
14672  },
14673  read_ol_tileSize: function (a, b) {
14674      var c = { width: b.getAttribute("width"), height: b.getAttribute("height") };
14675      a.tileSize = c;
14676  },
14677  read_ol_isBaseLayer: function (a, b) {
14678      a.isBaseLayer = "true" == this.getChildValue(b);
14679  },
14680  read_ol_displayInLayerSwitcher: function (a, b) {
14681      a.displayInLayerSwitcher = "true" == this.getChildValue(b);
14682  },
14683  read_wmc_Server: function (a, b) {
14684      a.version = b.getAttribute("version");
14685      a.url = this.getOnlineResource_href(b);
14686      a.metadata.servertitle = b.getAttribute("title");
14687  },
14688  read_wmc_FormatList: function (a, b) {
14689      this.runChildNodes(a, b);
14690  },
14691  read_wmc_Format: function (a, b) {
14692      var c = { value: this.getChildValue(b) };
14693      "1" == b.getAttribute("current") && (c.current = !0);
14694      a.formats.push(c);
14695  },
14696  read_wmc_StyleList: function (a, b) {
14697      this.runChildNodes(a, b);
14698  },
14699  read_wmc_Style: function (a, b) {
14700      var c = {};
14701      this.runChildNodes(c, b);
14702      "1" == b.getAttribute("current") && (c.current = !0);
14703      a.styles.push(c);
14704  },
14705  read_wmc_SLD: function (a, b) {
14706      this.runChildNodes(a, b);
14707  },
14708  read_sld_StyledLayerDescriptor: function (a, b) {
14709      var c = OpenLayers.Format.XML.prototype.write.apply(this, [b]);
14710      a.body = c;
14711  },
14712  read_sld_FeatureTypeStyle: function (a, b) {
14713      var c = OpenLayers.Format.XML.prototype.write.apply(this, [b]);
14714      a.body = c;
14715  },
14716  read_wmc_OnlineResource: function (a, b) {
14717      a.href = this.getAttributeNS(b, this.namespaces.xlink, "href");
14718  },
14719  read_wmc_Name: function (a, b) {
14720      var c = this.getChildValue(b);
14721      c && (a.name = c);
14722  },
14723  read_wmc_Title: function (a, b) {
14724      var c = this.getChildValue(b);
14725      c && (a.title = c);
14726  },
14727  read_wmc_MetadataURL: function (a, b) {
14728      a.metadataURL = this.getOnlineResource_href(b);
14729  },
14730  read_wmc_KeywordList: function (a, b) {
14731      a.keywords = [];
14732      this.runChildNodes(a.keywords, b);
14733  },
14734  read_wmc_Keyword: function (a, b) {
14735      a.push(this.getChildValue(b));
14736  },
14737  read_wmc_Abstract: function (a, b) {
14738      var c = this.getChildValue(b);
14739      c && (a["abstract"] = c);
14740  },
14741  read_wmc_LogoURL: function (a, b) {
14742      a.logo = { width: b.getAttribute("width"), height: b.getAttribute("height"), format: b.getAttribute("format"), href: this.getOnlineResource_href(b) };
14743  },
14744  read_wmc_DescriptionURL: function (a, b) {
14745      a.descriptionURL = this.getOnlineResource_href(b);
14746  },
14747  read_wmc_ContactInformation: function (a, b) {
14748      var c = {};
14749      this.runChildNodes(c, b);
14750      a.contactInformation = c;
14751  },
14752  read_wmc_ContactPersonPrimary: function (a, b) {
14753      var c = {};
14754      this.runChildNodes(c, b);
14755      a.personPrimary = c;
14756  },
14757  read_wmc_ContactPerson: function (a, b) {
14758      var c = this.getChildValue(b);
14759      c && (a.person = c);
14760  },
14761  read_wmc_ContactOrganization: function (a, b) {
14762      var c = this.getChildValue(b);
14763      c && (a.organization = c);
14764  },
14765  read_wmc_ContactPosition: function (a, b) {
14766      var c = this.getChildValue(b);
14767      c && (a.position = c);
14768  },
14769  read_wmc_ContactAddress: function (a, b) {
14770      var c = {};
14771      this.runChildNodes(c, b);
14772      a.contactAddress = c;
14773  },
14774  read_wmc_AddressType: function (a, b) {
14775      var c = this.getChildValue(b);
14776      c && (a.type = c);
14777  },
14778  read_wmc_Address: function (a, b) {
14779      var c = this.getChildValue(b);
14780      c && (a.address = c);
14781  },
14782  read_wmc_City: function (a, b) {
14783      var c = this.getChildValue(b);
14784      c && (a.city = c);
14785  },
14786  read_wmc_StateOrProvince: function (a, b) {
14787      var c = this.getChildValue(b);
14788      c && (a.stateOrProvince = c);
14789  },
14790  read_wmc_PostCode: function (a, b) {
14791      var c = this.getChildValue(b);
14792      c && (a.postcode = c);
14793  },
14794  read_wmc_Country: function (a, b) {
14795      var c = this.getChildValue(b);
14796      c && (a.country = c);
14797  },
14798  read_wmc_ContactVoiceTelephone: function (a, b) {
14799      var c = this.getChildValue(b);
14800      c && (a.phone = c);
14801  },
14802  read_wmc_ContactFacsimileTelephone: function (a, b) {
14803      var c = this.getChildValue(b);
14804      c && (a.fax = c);
14805  },
14806  read_wmc_ContactElectronicMailAddress: function (a, b) {
14807      var c = this.getChildValue(b);
14808      c && (a.email = c);
14809  },
14810  read_wmc_DataURL: function (a, b) {
14811      a.dataURL = this.getOnlineResource_href(b);
14812  },
14813  read_wmc_LegendURL: function (a, b) {
14814      var c = { width: b.getAttribute("width"), height: b.getAttribute("height"), format: b.getAttribute("format"), href: this.getOnlineResource_href(b) };
14815      a.legend = c;
14816  },
14817  read_wmc_DimensionList: function (a, b) {
14818      a.dimensions = {};
14819      this.runChildNodes(a.dimensions, b);
14820  },
14821  read_wmc_Dimension: function (a, b) {
14822      var c = {
14823              name: b.getAttribute("name").toLowerCase(),
14824              units: b.getAttribute("units") || "",
14825              unitSymbol: b.getAttribute("unitSymbol") || "",
14826              userValue: b.getAttribute("userValue") || "",
14827              nearestValue: "1" === b.getAttribute("nearestValue"),
14828              multipleValues: "1" === b.getAttribute("multipleValues"),
14829              current: "1" === b.getAttribute("current"),
14830              default: b.getAttribute("default") || "",
14831          },
14832          d = this.getChildValue(b);
14833      c.values = d.split(",");
14834      a[c.name] = c;
14835  },
14836  write: function (a, b) {
14837      var c = this.createElementDefaultNS("ViewContext");
14838      this.setAttributes(c, { version: this.VERSION, id: b && "string" == typeof b.id ? b.id : OpenLayers.Util.createUniqueID("OpenLayers_Context_") });
14839      this.setAttributeNS(c, this.namespaces.xsi, "xsi:schemaLocation", this.schemaLocation);
14840      c.appendChild(this.write_wmc_General(a));
14841      c.appendChild(this.write_wmc_LayerList(a));
14842      return OpenLayers.Format.XML.prototype.write.apply(this, [c]);
14843  },
14844  createElementDefaultNS: function (a, b, c) {
14845      a = this.createElementNS(this.namespaces[this.defaultPrefix], a);
14846      b && a.appendChild(this.createTextNode(b));
14847      c && this.setAttributes(a, c);
14848      return a;
14849  },
14850  setAttributes: function (a, b) {
14851      var c, d;
14852      for (d in b) (c = b[d].toString()), c.match(/[A-Z]/) ? this.setAttributeNS(a, null, d, c) : a.setAttribute(d, c);
14853  },
14854  write_wmc_General: function (a) {
14855      var b = this.createElementDefaultNS("General");
14856      a.size && b.appendChild(this.createElementDefaultNS("Window", null, { width: a.size.w, height: a.size.h }));
14857      var c = a.bounds;
14858      b.appendChild(this.createElementDefaultNS("BoundingBox", null, { minx: c.left.toPrecision(18), miny: c.bottom.toPrecision(18), maxx: c.right.toPrecision(18), maxy: c.top.toPrecision(18), SRS: a.projection }));
14859      b.appendChild(this.createElementDefaultNS("Title", a.title));
14860      a.keywords && b.appendChild(this.write_wmc_KeywordList(a.keywords));
14861      a["abstract"] && b.appendChild(this.createElementDefaultNS("Abstract", a["abstract"]));
14862      a.logo && b.appendChild(this.write_wmc_URLType("LogoURL", a.logo.href, a.logo));
14863      a.descriptionURL && b.appendChild(this.write_wmc_URLType("DescriptionURL", a.descriptionURL));
14864      a.contactInformation && b.appendChild(this.write_wmc_ContactInformation(a.contactInformation));
14865      b.appendChild(this.write_ol_MapExtension(a));
14866      return b;
14867  },
14868  write_wmc_KeywordList: function (a) {
14869      for (var b = this.createElementDefaultNS("KeywordList"), c = 0, d = a.length; c < d; c++) b.appendChild(this.createElementDefaultNS("Keyword", a[c]));
14870      return b;
14871  },
14872  write_wmc_ContactInformation: function (a) {
14873      var b = this.createElementDefaultNS("ContactInformation");
14874      a.personPrimary && b.appendChild(this.write_wmc_ContactPersonPrimary(a.personPrimary));
14875      a.position && b.appendChild(this.createElementDefaultNS("ContactPosition", a.position));
14876      a.contactAddress && b.appendChild(this.write_wmc_ContactAddress(a.contactAddress));
14877      a.phone && b.appendChild(this.createElementDefaultNS("ContactVoiceTelephone", a.phone));
14878      a.fax && b.appendChild(this.createElementDefaultNS("ContactFacsimileTelephone", a.fax));
14879      a.email && b.appendChild(this.createElementDefaultNS("ContactElectronicMailAddress", a.email));
14880      return b;
14881  },
14882  write_wmc_ContactPersonPrimary: function (a) {
14883      var b = this.createElementDefaultNS("ContactPersonPrimary");
14884      a.person && b.appendChild(this.createElementDefaultNS("ContactPerson", a.person));
14885      a.organization && b.appendChild(this.createElementDefaultNS("ContactOrganization", a.organization));
14886      return b;
14887  },
14888  write_wmc_ContactAddress: function (a) {
14889      var b = this.createElementDefaultNS("ContactAddress");
14890      a.type && b.appendChild(this.createElementDefaultNS("AddressType", a.type));
14891      a.address && b.appendChild(this.createElementDefaultNS("Address", a.address));
14892      a.city && b.appendChild(this.createElementDefaultNS("City", a.city));
14893      a.stateOrProvince && b.appendChild(this.createElementDefaultNS("StateOrProvince", a.stateOrProvince));
14894      a.postcode && b.appendChild(this.createElementDefaultNS("PostCode", a.postcode));
14895      a.country && b.appendChild(this.createElementDefaultNS("Country", a.country));
14896      return b;
14897  },
14898  write_ol_MapExtension: function (a) {
14899      var b = this.createElementDefaultNS("Extension");
14900      if ((a = a.maxExtent)) {
14901          var c = this.createElementNS(this.namespaces.ol, "ol:maxExtent");
14902          this.setAttributes(c, { minx: a.left.toPrecision(18), miny: a.bottom.toPrecision(18), maxx: a.right.toPrecision(18), maxy: a.top.toPrecision(18) });
14903          b.appendChild(c);
14904      }
14905      return b;
14906  },
14907  write_wmc_LayerList: function (a) {
14908      for (var b = this.createElementDefaultNS("LayerList"), c = 0, d = a.layersContext.length; c < d; ++c) b.appendChild(this.write_wmc_Layer(a.layersContext[c]));
14909      return b;
14910  },
14911  write_wmc_Layer: function (a) {
14912      var b = this.createElementDefaultNS("Layer", null, { queryable: a.queryable ? "1" : "0", hidden: a.visibility ? "0" : "1" });
14913      b.appendChild(this.write_wmc_Server(a));
14914      b.appendChild(this.createElementDefaultNS("Name", a.name));
14915      b.appendChild(this.createElementDefaultNS("Title", a.title));
14916      a["abstract"] && b.appendChild(this.createElementDefaultNS("Abstract", a["abstract"]));
14917      a.dataURL && b.appendChild(this.write_wmc_URLType("DataURL", a.dataURL));
14918      a.metadataURL && b.appendChild(this.write_wmc_URLType("MetadataURL", a.metadataURL));
14919      return b;
14920  },
14921  write_wmc_LayerExtension: function (a) {
14922      var b = this.createElementDefaultNS("Extension"),
14923          c = a.maxExtent,
14924          d = this.createElementNS(this.namespaces.ol, "ol:maxExtent");
14925      this.setAttributes(d, { minx: c.left.toPrecision(18), miny: c.bottom.toPrecision(18), maxx: c.right.toPrecision(18), maxy: c.top.toPrecision(18) });
14926      b.appendChild(d);
14927      a.tileSize && !a.singleTile && ((c = this.createElementNS(this.namespaces.ol, "ol:tileSize")), this.setAttributes(c, a.tileSize), b.appendChild(c));
14928      for (var c = "transparent numZoomLevels units isBaseLayer opacity displayInLayerSwitcher singleTile".split(" "), e = 0, f = c.length; e < f; ++e) (d = this.createOLPropertyNode(a, c[e])) && b.appendChild(d);
14929      return b;
14930  },
14931  createOLPropertyNode: function (a, b) {
14932      var c = null;
14933      null != a[b] && ((c = this.createElementNS(this.namespaces.ol, "ol:" + b)), c.appendChild(this.createTextNode(a[b].toString())));
14934      return c;
14935  },
14936  write_wmc_Server: function (a) {
14937      a = a.server;
14938      var b = this.createElementDefaultNS("Server"),
14939          c = { service: "OGC:WMS", version: a.version };
14940      a.title && (c.title = a.title);
14941      this.setAttributes(b, c);
14942      b.appendChild(this.write_wmc_OnlineResource(a.url));
14943      return b;
14944  },
14945  write_wmc_URLType: function (a, b, c) {
14946      a = this.createElementDefaultNS(a);
14947      a.appendChild(this.write_wmc_OnlineResource(b));
14948      if (c) {
14949          b = ["width", "height", "format"];
14950          for (var d = 0; d < b.length; d++) b[d] in c && a.setAttribute(b[d], c[b[d]]);
14951      }
14952      return a;
14953  },
14954  write_wmc_DimensionList: function (a) {
14955      var b = this.createElementDefaultNS("DimensionList"),
14956          c;
14957      for (c in a.dimensions) {
14958          var d = {},
14959              e = a.dimensions[c],
14960              f;
14961          for (f in e) d[f] = "boolean" == typeof e[f] ? Number(e[f]) : e[f];
14962          e = "";
14963          d.values && ((e = d.values.join(",")), delete d.values);
14964          b.appendChild(this.createElementDefaultNS("Dimension", e, d));
14965      }
14966      return b;
14967  },
14968  write_wmc_FormatList: function (a) {
14969      for (var b = this.createElementDefaultNS("FormatList"), c = 0, d = a.formats.length; c < d; c++) {
14970          var e = a.formats[c];
14971          b.appendChild(this.createElementDefaultNS("Format", e.value, e.current && !0 == e.current ? { current: "1" } : null));
14972      }
14973      return b;
14974  },
14975  write_wmc_StyleList: function (a) {
14976      var b = this.createElementDefaultNS("StyleList");
14977      if ((a = a.styles) && OpenLayers.Util.isArray(a))
14978          for (var c, d = 0, e = a.length; d < e; d++) {
14979              var f = a[d],
14980                  g = this.createElementDefaultNS("Style", null, f.current && !0 == f.current ? { current: "1" } : null);
14981              f.href
14982                  ? ((c = this.createElementDefaultNS("SLD")),
14983                    f.name && c.appendChild(this.createElementDefaultNS("Name", f.name)),
14984                    f.title && c.appendChild(this.createElementDefaultNS("Title", f.title)),
14985                    f.legend && c.appendChild(this.write_wmc_URLType("LegendURL", f.legend.href, f.legend)),
14986                    (f = this.write_wmc_OnlineResource(f.href)),
14987                    c.appendChild(f),
14988                    g.appendChild(c))
14989                  : f.body
14990                  ? ((c = this.createElementDefaultNS("SLD")),
14991                    f.name && c.appendChild(this.createElementDefaultNS("Name", f.name)),
14992                    f.title && c.appendChild(this.createElementDefaultNS("Title", f.title)),
14993                    f.legend && c.appendChild(this.write_wmc_URLType("LegendURL", f.legend.href, f.legend)),
14994                    (f = OpenLayers.Format.XML.prototype.read.apply(this, [f.body]).documentElement),
14995                    c.ownerDocument && c.ownerDocument.importNode && (f = c.ownerDocument.importNode(f, !0)),
14996                    c.appendChild(f),
14997                    g.appendChild(c))
14998                  : (g.appendChild(this.createElementDefaultNS("Name", f.name)),
14999                    g.appendChild(this.createElementDefaultNS("Title", f.title)),
15000                    f["abstract"] && g.appendChild(this.createElementDefaultNS("Abstract", f["abstract"])),
15001                    f.legend && g.appendChild(this.write_wmc_URLType("LegendURL", f.legend.href, f.legend)));
15002              b.appendChild(g);
15003          }
15004      return b;
15005  },
15006  write_wmc_OnlineResource: function (a) {
15007      var b = this.createElementDefaultNS("OnlineResource");
15008      this.setAttributeNS(b, this.namespaces.xlink, "xlink:type", "simple");
15009      this.setAttributeNS(b, this.namespaces.xlink, "xlink:href", a);
15010      return b;
15011  },
15012  getOnlineResource_href: function (a) {
15013      var b = {};
15014      a = a.getElementsByTagName("OnlineResource");
15015      0 < a.length && this.read_wmc_OnlineResource(b, a[0]);
15016      return b.href;
15017  },
15018  CLASS_NAME: "OpenLayers.Format.WMC.v1",
15019});
15020OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
15021  slideFactor: 50,
15022  slideRatio: null,
15023  initialize: function (a) {
15024      OpenLayers.Control.Panel.prototype.initialize.apply(this, [a]);
15025      a = { slideFactor: this.slideFactor, slideRatio: this.slideRatio };
15026      this.addControls([
15027          new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH, a),
15028          new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH, a),
15029          new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST, a),
15030          new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST, a),
15031      ]);
15032  },
15033  CLASS_NAME: "OpenLayers.Control.PanPanel",
15034});
15035OpenLayers.Control.Attribution = OpenLayers.Class(OpenLayers.Control, {
15036  separator: ", ",
15037  template: "${layers}",
15038  destroy: function () {
15039      this.map.events.un({ removelayer: this.updateAttribution, addlayer: this.updateAttribution, changelayer: this.updateAttribution, changebaselayer: this.updateAttribution, scope: this });
15040      OpenLayers.Control.prototype.destroy.apply(this, arguments);
15041  },
15042  draw: function () {
15043      OpenLayers.Control.prototype.draw.apply(this, arguments);
15044      this.map.events.on({ changebaselayer: this.updateAttribution, changelayer: this.updateAttribution, addlayer: this.updateAttribution, removelayer: this.updateAttribution, scope: this });
15045      this.updateAttribution();
15046      return this.div;
15047  },
15048  updateAttribution: function () {
15049      var a = [];
15050      if (this.map && this.map.layers) {
15051          for (var b = 0, c = this.map.layers.length; b < c; b++) {
15052              var d = this.map.layers[b];
15053              d.attribution && d.getVisibility() && -1 === OpenLayers.Util.indexOf(a, d.attribution) && a.push(d.attribution);
15054          }
15055          this.div.innerHTML = OpenLayers.String.format(this.template, { layers: a.join(this.separator) });
15056      }
15057  },
15058  CLASS_NAME: "OpenLayers.Control.Attribution",
15059});
15060OpenLayers.Kinetic = OpenLayers.Class({
15061  threshold: 0,
15062  deceleration: 0.0035,
15063  nbPoints: 100,
15064  delay: 200,
15065  points: void 0,
15066  timerId: void 0,
15067  initialize: function (a) {
15068      OpenLayers.Util.extend(this, a);
15069  },
15070  begin: function () {
15071      OpenLayers.Animation.stop(this.timerId);
15072      this.timerId = void 0;
15073      this.points = [];
15074  },
15075  update: function (a) {
15076      this.points.unshift({ xy: a, tick: new Date().getTime() });
15077      this.points.length > this.nbPoints && this.points.pop();
15078  },
15079  end: function (a) {
15080      for (var b, c = new Date().getTime(), d = 0, e = this.points.length, f; d < e; d++) {
15081          f = this.points[d];
15082          if (c - f.tick > this.delay) break;
15083          b = f;
15084      }
15085      if (b && ((d = new Date().getTime() - b.tick), (c = Math.sqrt(Math.pow(a.x - b.xy.x, 2) + Math.pow(a.y - b.xy.y, 2))), (d = c / d), !(0 == d || d < this.threshold)))
15086          return (c = Math.asin((a.y - b.xy.y) / c)), b.xy.x <= a.x && (c = Math.PI - c), { speed: d, theta: c };
15087  },
15088  move: function (a, b) {
15089      var c = a.speed,
15090          d = Math.cos(a.theta),
15091          e = -Math.sin(a.theta),
15092          f = new Date().getTime(),
15093          g = 0,
15094          h = 0;
15095      this.timerId = OpenLayers.Animation.start(
15096          OpenLayers.Function.bind(function () {
15097              if (null != this.timerId) {
15098                  var a = new Date().getTime() - f,
15099                      l = (-this.deceleration * Math.pow(a, 2)) / 2 + c * a,
15100                      m = l * d,
15101                      l = l * e,
15102                      n,
15103                      p;
15104                  n = !1;
15105                  0 >= -this.deceleration * a + c && (OpenLayers.Animation.stop(this.timerId), (this.timerId = null), (n = !0));
15106                  a = m - g;
15107                  p = l - h;
15108                  g = m;
15109                  h = l;
15110                  b(a, p, n);
15111              }
15112          }, this)
15113      );
15114  },
15115  CLASS_NAME: "OpenLayers.Kinetic",
15116});
15117OpenLayers.Format.WPSExecute = OpenLayers.Class(OpenLayers.Format.XML, OpenLayers.Format.Filter.v1_1_0, {
15118  namespaces: {
15119      ows: "http://www.opengis.net/ows/1.1",
15120      gml: "http://www.opengis.net/gml",
15121      wps: "http://www.opengis.net/wps/1.0.0",
15122      wfs: "http://www.opengis.net/wfs",
15123      ogc: "http://www.opengis.net/ogc",
15124      wcs: "http://www.opengis.net/wcs",
15125      xlink: "http://www.w3.org/1999/xlink",
15126      xsi: "http://www.w3.org/2001/XMLSchema-instance",
15127  },
15128  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
15129  VERSION: "1.0.0",
15130  schemaLocation: "http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",
15131  schemaLocationAttr: function (a) {},
15132  write: function (a) {
15133      var b;
15134      window.ActiveXObject ? (this.xmldom = b = new ActiveXObject("Microsoft.XMLDOM")) : (b = document.implementation.createDocument("", "", null));
15135      a = this.writeNode("wps:Execute", a, b);
15136      this.setAttributeNS(a, this.namespaces.xsi, "xsi:schemaLocation", this.schemaLocation);
15137      return OpenLayers.Format.XML.prototype.write.apply(this, [a]);
15138  },
15139  read: function (a) {
15140      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
15141      a && 9 == a.nodeType && (a = a.documentElement);
15142      var b = {};
15143      this.readNode(a, b);
15144      return b;
15145  },
15146  writers: {
15147      wps: {
15148          Execute: function (a) {
15149              var b = this.createElementNSPlus("wps:Execute", { attributes: { version: this.VERSION, service: "WPS" } });
15150              this.writeNode("ows:Identifier", a.identifier, b);
15151              this.writeNode("wps:DataInputs", a.dataInputs, b);
15152              this.writeNode("wps:ResponseForm", a.responseForm, b);
15153              return b;
15154          },
15155          ResponseForm: function (a) {
15156              var b = this.createElementNSPlus("wps:ResponseForm", {});
15157              a.rawDataOutput && this.writeNode("wps:RawDataOutput", a.rawDataOutput, b);
15158              a.responseDocument && this.writeNode("wps:ResponseDocument", a.responseDocument, b);
15159              return b;
15160          },
15161          ResponseDocument: function (a) {
15162              var b = this.createElementNSPlus("wps:ResponseDocument", { attributes: { storeExecuteResponse: a.storeExecuteResponse, lineage: a.lineage, status: a.status } });
15163              if (a.outputs) for (var c = 0, d = a.outputs.length; c < d; c++) this.writeNode("wps:Output", a.outputs[c], b);
15164              return b;
15165          },
15166          Output: function (a) {
15167              var b = this.createElementNSPlus("wps:Output", { attributes: { asReference: a.asReference, mimeType: a.mimeType, encoding: a.encoding, schema: a.schema } });
15168              this.writeNode("ows:Identifier", a.identifier, b);
15169              this.writeNode("ows:Title", a.title, b);
15170              this.writeNode("ows:Abstract", a["abstract"], b);
15171              return b;
15172          },
15173          RawDataOutput: function (a) {
15174              var b = this.createElementNSPlus("wps:RawDataOutput", { attributes: { mimeType: a.mimeType, encoding: a.encoding, schema: a.schema } });
15175              this.writeNode("ows:Identifier", a.identifier, b);
15176              return b;
15177          },
15178          DataInputs: function (a) {
15179              for (var b = this.createElementNSPlus("wps:DataInputs", {}), c = 0, d = a.length; c < d; ++c) this.writeNode("wps:Input", a[c], b);
15180              return b;
15181          },
15182          Input: function (a) {
15183              var b = this.createElementNSPlus("wps:Input", {});
15184              this.writeNode("ows:Identifier", a.identifier, b);
15185              a.title && this.writeNode("ows:Title", a.title, b);
15186              a.data && this.writeNode("wps:Data", a.data, b);
15187              a.reference && this.writeNode("wps:Reference", a.reference, b);
15188              a.boundingBoxData && this.writeNode("wps:BoundingBoxData", a.boundingBoxData, b);
15189              return b;
15190          },
15191          Data: function (a) {
15192              var b = this.createElementNSPlus("wps:Data", {});
15193              a.literalData ? this.writeNode("wps:LiteralData", a.literalData, b) : a.complexData ? this.writeNode("wps:ComplexData", a.complexData, b) : a.boundingBoxData && this.writeNode("ows:BoundingBox", a.boundingBoxData, b);
15194              return b;
15195          },
15196          LiteralData: function (a) {
15197              return this.createElementNSPlus("wps:LiteralData", { attributes: { uom: a.uom }, value: a.value });
15198          },
15199          ComplexData: function (a) {
15200              var b = this.createElementNSPlus("wps:ComplexData", { attributes: { mimeType: a.mimeType, encoding: a.encoding, schema: a.schema } }),
15201                  c = a.value;
15202              "string" === typeof c ? b.appendChild(this.getXMLDoc().createCDATASection(a.value)) : b.appendChild(c);
15203              return b;
15204          },
15205          Reference: function (a) {
15206              var b = this.createElementNSPlus("wps:Reference", { attributes: { mimeType: a.mimeType, "xlink:href": a.href, method: a.method, encoding: a.encoding, schema: a.schema } });
15207              a.body && this.writeNode("wps:Body", a.body, b);
15208              return b;
15209          },
15210          BoundingBoxData: function (a, b) {
15211              this.writers.ows.BoundingBox.apply(this, [a, b, "wps:BoundingBoxData"]);
15212          },
15213          Body: function (a) {
15214              var b = this.createElementNSPlus("wps:Body", {});
15215              a.wcs ? this.writeNode("wcs:GetCoverage", a.wcs, b) : a.wfs ? ((this.featureType = a.wfs.featureType), (this.version = a.wfs.version), this.writeNode("wfs:GetFeature", a.wfs, b)) : this.writeNode("wps:Execute", a, b);
15216              return b;
15217          },
15218      },
15219      wcs: OpenLayers.Format.WCSGetCoverage.prototype.writers.wcs,
15220      wfs: OpenLayers.Format.WFST.v1_1_0.prototype.writers.wfs,
15221      ogc: OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc,
15222      ows: OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows,
15223  },
15224  readers: {
15225      wps: {
15226          ExecuteResponse: function (a, b) {
15227              b.executeResponse = { lang: a.getAttribute("lang"), statusLocation: a.getAttribute("statusLocation"), serviceInstance: a.getAttribute("serviceInstance"), service: a.getAttribute("service") };
15228              this.readChildNodes(a, b.executeResponse);
15229          },
15230          Process: function (a, b) {
15231              b.process = {};
15232              this.readChildNodes(a, b.process);
15233          },
15234          Status: function (a, b) {
15235              b.status = { creationTime: a.getAttribute("creationTime") };
15236              this.readChildNodes(a, b.status);
15237          },
15238          ProcessSucceeded: function (a, b) {
15239              b.processSucceeded = !0;
15240          },
15241          ProcessOutputs: function (a, b) {
15242              b.processOutputs = [];
15243              this.readChildNodes(a, b.processOutputs);
15244          },
15245          Output: function (a, b) {
15246              var c = {};
15247              this.readChildNodes(a, c);
15248              b.push(c);
15249          },
15250          Reference: function (a, b) {
15251              b.reference = { href: a.getAttribute("href"), mimeType: a.getAttribute("mimeType"), encoding: a.getAttribute("encoding"), schema: a.getAttribute("schema") };
15252          },
15253          Data: function (a, b) {
15254              b.data = {};
15255              this.readChildNodes(a, b);
15256          },
15257          LiteralData: function (a, b) {
15258              b.literalData = { dataType: a.getAttribute("dataType"), uom: a.getAttribute("uom"), value: this.getChildValue(a) };
15259          },
15260          ComplexData: function (a, b) {
15261              b.complexData = { mimeType: a.getAttribute("mimeType"), schema: a.getAttribute("schema"), encoding: a.getAttribute("encoding"), value: "" };
15262              if (this.isSimpleContent(a)) {
15263                  var c;
15264                  for (c = a.firstChild; c;
15264 c = c.nextSibling)
15265                      switch (c.nodeType) {
15266                          case 3:
15267                          case 4:
15268                              b.complexData.value += c.nodeValue;
15269                      }
15270              } else for (c = a.firstChild; c; c = c.nextSibling) 1 == c.nodeType && (b.complexData.value = c);
15271          },
15272          BoundingBox: function (a, b) {
15273              b.boundingBoxData = { dimensions: a.getAttribute("dimensions"), crs: a.getAttribute("crs") };
15274              this.readChildNodes(a, b.boundingBoxData);
15275          },
15276      },
15277      ows: OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows,
15278  },
15279  CLASS_NAME: "OpenLayers.Format.WPSExecute",
15280});
15281OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
15282  location: null,
15283  features: null,
15284  formatOptions: null,
15285  selectedFeature: null,
15286  icon: null,
15287  popupSize: null,
15288  useFeedTitle: !0,
15289  initialize: function (a, b, c) {
15290      OpenLayers.Layer.Markers.prototype.initialize.apply(this, [a, c]);
15291      this.location = b;
15292      this.features = [];
15293  },
15294  destroy: function () {
15295      OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments);
15296      this.clearFeatures();
15297      this.features = null;
15298  },
15299  loadRSS: function () {
15300      this.loaded || (this.events.triggerEvent("loadstart"), OpenLayers.Request.GET({ url: this.location, success: this.parseData, scope: this }), (this.loaded = !0));
15301  },
15302  moveTo: function (a, b, c) {
15303      OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments);
15304      this.visibility && !this.loaded && this.loadRSS();
15305  },
15306  parseData: function (a) {
15307      var b = a.responseXML;
15308      (b && b.documentElement) || (b = OpenLayers.Format.XML.prototype.read(a.responseText));
15309      if (this.useFeedTitle) {
15310          a = null;
15311          try {
15312              a = b.getElementsByTagNameNS("*", "title")[0].firstChild.nodeValue;
15313          } catch (c) {
15314              a = b.getElementsByTagName("title")[0].firstChild.nodeValue;
15315          }
15316          a && this.setName(a);
15317      }
15318      a = {};
15319      OpenLayers.Util.extend(a, this.formatOptions);
15320      this.map && !this.projection.equals(this.map.getProjectionObject()) && ((a.externalProjection = this.projection), (a.internalProjection = this.map.getProjectionObject()));
15321      b = new OpenLayers.Format.GeoRSS(a).read(b);
15322      a = 0;
15323      for (var d = b.length; a < d; a++) {
15324          var e = {},
15325              f = b[a];
15326          if (f.geometry) {
15327              var g = f.attributes.title ? f.attributes.title : "Untitled",
15328                  h = f.attributes.description ? f.attributes.description : "No description.",
15329                  k = f.attributes.link ? f.attributes.link : "",
15330                  f = f.geometry.getBounds().getCenterLonLat();
15331              e.icon = null == this.icon ? OpenLayers.Marker.defaultIcon() : this.icon.clone();
15332              e.popupSize = this.popupSize ? this.popupSize.clone() : new OpenLayers.Size(250, 120);
15333              if (g || h) {
15334                  e.title = g;
15335                  e.description = h;
15336                  var l = '<div class="olLayerGeoRSSClose">[x]</div>',
15337                      l = l + '<div class="olLayerGeoRSSTitle">';
15338                  k && (l += '<a class="link" href="' + k + '" target="_blank">');
15339                  l += g;
15340                  k && (l += "</a>");
15341                  l += "</div>";
15342                  l += '<div style="" class="olLayerGeoRSSDescription">';
15343                  l += h;
15344                  l += "</div>";
15345                  e.popupContentHTML = l;
15346              }
15347              f = new OpenLayers.Feature(this, f, e);
15348              this.features.push(f);
15349              e = f.createMarker();
15350              e.events.register("click", f, this.markerClick);
15351              this.addMarker(e);
15352          }
15353      }
15354      this.events.triggerEvent("loadend");
15355  },
15356  markerClick: function (a) {
15357      var b = this == this.layer.selectedFeature;
15358      this.layer.selectedFeature = b ? null : this;
15359      for (var c = 0, d = this.layer.map.popups.length; c < d; c++) this.layer.map.removePopup(this.layer.map.popups[c]);
15360      b ||
15361          ((b = this.createPopup()),
15362          OpenLayers.Event.observe(
15363              b.div,
15364              "click",
15365              OpenLayers.Function.bind(function () {
15366                  for (var a = 0, b = this.layer.map.popups.length; a < b; a++) this.layer.map.removePopup(this.layer.map.popups[a]);
15367              }, this)
15368          ),
15369          this.layer.map.addPopup(b));
15370      OpenLayers.Event.stop(a);
15371  },
15372  clearFeatures: function () {
15373      if (null != this.features)
15374          for (; 0 < this.features.length; ) {
15375              var a = this.features[0];
15376              OpenLayers.Util.removeItem(this.features, a);
15377              a.destroy();
15378          }
15379  },
15380  CLASS_NAME: "OpenLayers.Layer.GeoRSS",
15381});
15382OpenLayers.Symbolizer.Point = OpenLayers.Class(OpenLayers.Symbolizer, {
15383  initialize: function (a) {
15384      OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
15385  },
15386  CLASS_NAME: "OpenLayers.Symbolizer.Point",
15387});
15388OpenLayers.Symbolizer.Line = OpenLayers.Class(OpenLayers.Symbolizer, {
15389  initialize: function (a) {
15390      OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
15391  },
15392  CLASS_NAME: "OpenLayers.Symbolizer.Line",
15393});
15394OpenLayers.Symbolizer.Text = OpenLayers.Class(OpenLayers.Symbolizer, {
15395  initialize: function (a) {
15396      OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
15397  },
15398  CLASS_NAME: "OpenLayers.Symbolizer.Text",
15399});
15400OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
15401  namespaces: { sld: "http://www.opengis.net/sld", ogc: "http://www.opengis.net/ogc", gml: "http://www.opengis.net/gml", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
15402  defaultPrefix: "sld",
15403  schemaLocation: null,
15404  multipleSymbolizers: !1,
15405  featureTypeCounter: null,
15406  defaultSymbolizer: { fillColor: "#808080", fillOpacity: 1, strokeColor: "#000000", strokeOpacity: 1, strokeWidth: 1, strokeDashstyle: "solid", pointRadius: 3, graphicName: "square" },
15407  read: function (a, b) {
15408      b = OpenLayers.Util.applyDefaults(b, this.options);
15409      var c = { namedLayers: !0 === b.namedLayersAsArray ? [] : {} };
15410      this.readChildNodes(a, c);
15411      return c;
15412  },
15413  readers: OpenLayers.Util.applyDefaults(
15414      {
15415          sld: {
15416              StyledLayerDescriptor: function (a, b) {
15417                  b.version = a.getAttribute("version");
15418                  this.readChildNodes(a, b);
15419              },
15420              Name: function (a, b) {
15421                  b.name = this.getChildValue(a);
15422              },
15423              Title: function (a, b) {
15424                  b.title = this.getChildValue(a);
15425              },
15426              Abstract: function (a, b) {
15427                  b.description = this.getChildValue(a);
15428              },
15429              NamedLayer: function (a, b) {
15430                  var c = { userStyles: [], namedStyles: [] };
15431                  this.readChildNodes(a, c);
15432                  for (var d = 0, e = c.userStyles.length; d < e; ++d) c.userStyles[d].layerName = c.name;
15433                  OpenLayers.Util.isArray(b.namedLayers) ? b.namedLayers.push(c) : (b.namedLayers[c.name] = c);
15434              },
15435              NamedStyle: function (a, b) {
15436                  b.namedStyles.push(this.getChildName(a.firstChild));
15437              },
15438              UserStyle: function (a, b) {
15439                  var c = { defaultsPerSymbolizer: !0, rules: [] };
15440                  this.featureTypeCounter = -1;
15441                  this.readChildNodes(a, c);
15442                  this.multipleSymbolizers ? (delete c.defaultsPerSymbolizer, (c = new OpenLayers.Style2(c))
15442) : (c = new OpenLayers.Style(this.defaultSymbolizer, c));
15443                  b.userStyles.push(c);
15444              },
15445              IsDefault: function (a, b) {
15446                  "1" == this.getChildValue(a) && (b.isDefault = !0);
15447              },
15448              FeatureTypeStyle: function (a, b) {
15449                  ++this.featureTypeCounter;
15450                  var c = { rules: this.multipleSymbolizers ? b.rules : [] };
15451                  this.readChildNodes(a, c);
15452                  this.multipleSymbolizers || (b.rules = c.rules);
15453              },
15454              Rule: function (a, b) {
15455                  var c;
15456                  this.multipleSymbolizers && (c = { symbolizers: [] });
15457                  c = new OpenLayers.Rule(c);
15458                  this.readChildNodes(a, c);
15459                  b.rules.push(c);
15460              },
15461              ElseFilter: function (a, b) {
15462                  b.elseFilter = !0;
15463              },
15464              MinScaleDenominator: function (a, b) {
15465                  b.minScaleDenominator = parseFloat(this.getChildValue(a));
15466              },
15467              MaxScaleDenominator: function (a, b) {
15468                  b.maxScaleDenominator = parseFloat(this.getChildValue(a));
15469              },
15470              TextSymbolizer: function (a, b) {
15471                  var c = {};
15472                  this.readChildNodes(a, c);
15473                  this.multipleSymbolizers ? ((c.zIndex = this.featureTypeCounter), b.symbolizers.push(new OpenLayers.Symbolizer.Text(c))) : (b.symbolizer.Text = OpenLayers.Util.applyDefaults(c, b.symbolizer.Text));
15474              },
15475              LabelPlacement: function (a, b) {
15476                  this.readChildNodes(a, b);
15477              },
15478              PointPlacement: function (a, b) {
15479                  var c = {};
15480                  this.readChildNodes(a, c);
15481                  c.labelRotation = c.rotation;
15482                  delete c.rotation;
15483                  var d,
15484                      e = b.labelAnchorPointX,
15485                      f = b.labelAnchorPointY;
15486                  e <= 1 / 3 ? (d = "l") : e > 1 / 3 && e < 2 / 3 ? (d = "c") : e >= 2 / 3 && (d = "r");
15487                  f <= 1 / 3 ? (d += "b") : f > 1 / 3 && f < 2 / 3 ? (d += "m") : f >= 2 / 3 && (d += "t");
15488                  c.labelAlign = d;
15489                  OpenLayers.Util.applyDefaults(b, c);
15490              },
15491              AnchorPoint: function (a, b) {
15492                  this.readChildNodes(a, b);
15493              },
15494              AnchorPointX: function (a, b) {
15495                  var c = this.readers.ogc._expression.call(this, a);
15496                  c && (b.labelAnchorPointX = c);
15497              },
15498              AnchorPointY: function (a, b) {
15499                  var c = this.readers.ogc._expression.call(this, a);
15500                  c && (b.labelAnchorPointY = c);
15501              },
15502              Displacement: function (a, b) {
15503                  this.readChildNodes(a, b);
15504              },
15505              DisplacementX: function (a, b) {
15506                  var c = this.readers.ogc._expression.call(this, a);
15507                  c && (b.labelXOffset = c);
15508              },
15509              DisplacementY: function (a, b) {
15510                  var c = this.readers.ogc._expression.call(this, a);
15511                  c && (b.labelYOffset = c);
15512              },
15513              LinePlacement: function (a, b) {
15514                  this.readChildNodes(a, b);
15515              },
15516              PerpendicularOffset: function (a, b) {
15517                  var c = this.readers.ogc._expression.call(this, a);
15518                  c && (b.labelPerpendicularOffset = c);
15519              },
15520              Label: function (a, b) {
15521                  var c = this.readers.ogc._expression.call(this, a);
15522                  c && (b.label = c);
15523              },
15524              Font: function (a, b) {
15525                  this.readChildNodes(a, b);
15526              },
15527              Halo: function (a, b) {
15528                  var c = {};
15529                  this.readChildNodes(a, c);
15530                  b.haloRadius = c.haloRadius;
15531                  b.haloColor = c.fillColor;
15532                  b.haloOpacity = c.fillOpacity;
15533              },
15534              Radius: function (a, b) {
15535                  var c = this.readers.ogc._expression.call(this, a);
15536                  null != c && (b.haloRadius = c);
15537              },
15538              RasterSymbolizer: function (a, b) {
15539                  var c = {};
15540                  this.readChildNodes(a, c);
15541                  this.multipleSymbolizers ? ((c.zIndex = this.featureTypeCounter), b.symbolizers.push(new OpenLayers.Symbolizer.Raster(c))) : (b.symbolizer.Raster = OpenLayers.Util.applyDefaults(c, b.symbolizer.Raster));
15542              },
15543              Geometry: function (a, b) {
15544                  b.geometry = {};
15545                  this.readChildNodes(a, b.geometry);
15546              },
15547              ColorMap: function (a, b) {
15548                  b.colorMap = [];
15549                  this.readChildNodes(a, b.colorMap);
15550              },
15551              ColorMapEntry: function (a, b) {
15552                  var c = a.getAttribute("quantity"),
15553                      d = a.getAttribute("opacity");
15554                  b.push({ color: a.getAttribute("color"), quantity: null !== c ? parseFloat(c) : void 0, label: a.getAttribute("label") || void 0, opacity: null !== d ? parseFloat(d) : void 0 });
15555              },
15556              LineSymbolizer: function (a, b) {
15557                  var c = {};
15558                  this.readChildNodes(a, c);
15559                  this.multipleSymbolizers ? ((c.zIndex = this.featureTypeCounter), b.symbolizers.push(new OpenLayers.Symbolizer.Line(c))) : (b.symbolizer.Line = OpenLayers.Util.applyDefaults(c, b.symbolizer.Line));
15560              },
15561              PolygonSymbolizer: function (a, b) {
15562                  var c = { fill: !1, stroke: !1 };
15563                  this.multipleSymbolizers || (c = b.symbolizer.Polygon || c);
15564                  this.readChildNodes(a, c);
15565                  this.multipleSymbolizers ? ((c.zIndex = this.featureTypeCounter), b.symbolizers.push(new OpenLayers.Symbolizer.Polygon(c))) : (b.symbolizer.Polygon = c);
15566              },
15567              PointSymbolizer: function (a, b) {
15568                  var c = { fill: !1, stroke: !1, graphic: !1 };
15569                  this.multipleSymbolizers || (c = b.symbolizer.Point || c);
15570                  this.readChildNodes(a, c);
15571                  this.multipleSymbolizers ? ((c.zIndex = this.featureTypeCounter), b.symbolizers.push(new OpenLayers.Symbolizer.Point(c))) : (b.symbolizer.Point = c);
15572              },
15573              Stroke: function (a, b) {
15574                  b.stroke = !0;
15575                  this.readChildNodes(a, b);
15576              },
15577              Fill: function (a, b) {
15578                  b.fill = !0;
15579                  this.readChildNodes(a, b);
15580              },
15581              CssParameter: function (a, b) {
15582                  var c = a.getAttribute("name"),
15583                      d = this.cssMap[c];
15584                  b.label && ("fill" === c ? (d = "fontColor") : "fill-opacity" === c && (d = "fontOpacity"));
15585                  d && (c = this.readers.ogc._expression.call(this, a)) && (b[d] = c);
15586              },
15587              Graphic: function (a, b) {
15588                  b.graphic = !0;
15589                  var c = {};
15590                  this.readChildNodes(a, c);
15591                  for (var d = "stroke strokeColor strokeWidth strokeOpacity strokeLinecap fill fillColor fillOpacity graphicName rotation graphicFormat".split(" "), e, f, g = 0, h = d.length; g < h; ++g)
15592                      (e = d[g]), (f = c[e]), void 0 != f && (b[e] = f);
15593                  void 0 != c.opacity && (b.graphicOpacity = c.opacity);
15594                  void 0 != c.size && (isNaN(c.size / 2) ? (b.graphicWidth = c.size) : (b.pointRadius = c.size / 2));
15595                  void 0 != c.href && (b.externalGraphic = c.href);
15596                  void 0 != c.rotation && (b.rotation = c.rotation);
15597              },
15598              ExternalGraphic: function (a, b) {
15599                  this.readChildNodes(a, b);
15600              },
15601              Mark: function (a, b) {
15602                  this.readChildNodes(a, b);
15603              },
15604              WellKnownName: function (a, b) {
15605                  b.graphicName = this.getChildValue(a);
15606              },
15607              Opacity: function (a, b) {
15608                  var c = this.readers.ogc._expression.call(this, a);
15609                  c && (b.opacity = c);
15610              },
15611              Size: function (a, b) {
15612                  var c = this.readers.ogc._expression.call(this, a);
15613                  c && (b.size = c);
15614              },
15615              Rotation: function (a, b) {
15616                  var c = this.readers.ogc._expression.call(this, a);
15617                  c && (b.rotation = c);
15618              },
15619              OnlineResource: function (a, b) {
15620                  b.href = this.getAttributeNS(a, this.namespaces.xlink, "href");
15621              },
15622              Format: function (a, b) {
15623                  b.graphicFormat = this.getChildValue(a);
15624              },
15625          },
15626      },
15627      OpenLayers.Format.Filter.v1_0_0.prototype.readers
15628  ),
15629  cssMap: {
15630      stroke: "strokeColor",
15631      "stroke-opacity": "strokeOpacity",
15632      "stroke-width": "strokeWidth",
15633      "stroke-linecap": "strokeLinecap",
15634      "stroke-dasharray": "strokeDashstyle",
15635      fill: "fillColor",
15636      "fill-opacity": "fillOpacity",
15637      "font-family": "fontFamily",
15638      "font-size": "fontSize",
15639      "font-weight": "fontWeight",
15640      "font-style": "fontStyle",
15641  },
15642  getCssProperty: function (a) {
15643      var b = null,
15644          c;
15645      for (c in this.cssMap)
15646          if (this.cssMap[c] == a) {
15647              b = c;
15648              break;
15649          }
15650      return b;
15651  },
15652  getGraphicFormat: function (a) {
15653      var b, c;
15654      for (c in this.graphicFormats)
15655          if (this.graphicFormats[c].test(a)) {
15656              b = c;
15657              break;
15658          }
15659      return b || this.defaultGraphicFormat;
15660  },
15661  defaultGraphicFormat: "image/png",
15662  graphicFormats: { "image/jpeg": /\.jpe?g$/i, "image/gif": /\.gif$/i, "image/png": /\.png$/i },
15663  write: function (a) {
15664      return this.writers.sld.StyledLayerDescriptor.apply(this, [a]);
15665  },
15666  writers: OpenLayers.Util.applyDefaults(
15667      {
15668          sld: {
15669              _OGCExpression: function (a, b) {
15670                  var c = this.createElementNSPlus(a),
15671                      d = "string" == typeof b ? b.split("${") : [b];
15672                  c.appendChild(this.createTextNode(d[0]));
15673                  for (var e, f, g = 1, h = d.length; g < h; g++)
15674                      (e = d[g]), (f = e.indexOf("}")), 0 < f ? (this.writeNode("ogc:PropertyName", { property: e.substring(0, f) }, c), c.appendChild(this.createTextNode(e.substring(++f)))) : c.appendChild(this.createTextNode("${" + e));
15675                  return c;
15676              },
15677              StyledLayerDescriptor: function (a) {
15678                  var b = this.createElementNSPlus("sld:StyledLayerDescriptor", { attributes: { version: this.VERSION, "xsi:schemaLocation": this.schemaLocation } });
15679                  b.setAttribute("xmlns:ogc", this.namespaces.ogc);
15680                  b.setAttribute("xmlns:gml", this.namespaces.gml);
15681                  a.name && this.writeNode("Name", a.name, b);
15682                  a.title && this.writeNode("Title", a.title, b);
15683                  a.description && this.writeNode("Abstract", a.description, b);
15684                  if (OpenLayers.Util.isArray(a.namedLayers)) for (var c = 0, d = a.namedLayers.length; c < d; ++c) this.writeNode("NamedLayer", a.namedLayers[c], b);
15685                  else for (c in a.namedLayers) this.writeNode("NamedLayer", a.namedLayers[c], b);
15686                  return b;
15687              },
15688              Name: function (a) {
15689                  return this.createElementNSPlus("sld:Name", { value: a });
15690              },
15691              Title: function (a) {
15692                  return this.createElementNSPlus("sld:Title", { value: a });
15693              },
15694              Abstract: function (a) {
15695                  return this.createElementNSPlus("sld:Abstract", { value: a });
15696              },
15697              NamedLayer: function (a) {
15698                  var b = this.createElementNSPlus("sld:NamedLayer");
15699                  this.writeNode("Name", a.name, b);
15700                  if (a.namedStyles) for (var c = 0, d = a.namedStyles.length; c < d; ++c) this.writeNode("NamedStyle", a.namedStyles[c], b);
15701                  if (a.userStyles) for (c = 0, d = a.userStyles.length; c < d; ++c) this.writeNode("UserStyle", a.userStyles[c], b);
15702                  return b;
15703              },
15704              NamedStyle: function (a) {
15705                  var b = this.createElementNSPlus("sld:NamedStyle");
15706                  this.writeNode("Name", a, b);
15707                  return b;
15708              },
15709              UserStyle: function (a) {
15710                  var b = this.createElementNSPlus("sld:UserStyle");
15711                  a.name && this.writeNode("Name", a.name, b);
15712                  a.title && this.writeNode("Title", a.title, b);
15713                  a.description && this.writeNode("Abstract", a.description, b);
15714                  a.isDefault && this.writeNode("IsDefault", a.isDefault, b);
15715                  if (this.multipleSymbolizers && a.rules) {
15716                      for (var c = { 0: [] }, d = [0], e, f, g, h, k, l = 0, m = a.rules.length; l < m; ++l)
15717                          if (((e = a.rules[l]), e.symbolizers)) {
15718                              f = {};
15719                              for (var n = 0, p = e.symbolizers.length; n < p; ++n) (g = e.symbolizers[n]), (h = g.zIndex), h in f || ((k = e.clone()), (k.symbolizers = []), (f[h] = k)), f[h].symbolizers.push(g.clone());
15720                              for (h in f) h in c || (d.push(h), (c[h] = [])), c[h].push(f[h]);
15721                          } else c[0].push(e.clone());
15722                      d.sort();
15723                      l = 0;
15724                      for (m = d.length; l < m; ++l) (e = c[d[l]]), 0 < e.length && ((k = a.clone()), (k.rules = c[d[l]]), this.writeNode("FeatureTypeStyle", k, b));
15725                  } else this.writeNode("FeatureTypeStyle", a, b);
15726                  return b;
15727              },
15728              IsDefault: function (a) {
15729                  return this.createElementNSPlus("sld:IsDefault", { value: a ? "1" : "0" });
15730              },
15731              FeatureTypeStyle: function (a) {
15732                  for (var b = this.createElementNSPlus("sld:FeatureTypeStyle"), c = 0, d = a.rules.length; c < d; ++c) this.writeNode("Rule", a.rules[c], b);
15733                  return b;
15734              },
15735              Rule: function (a) {
15736                  var b = this.createElementNSPlus("sld:Rule");
15737                  a.name && this.writeNode("Name", a.name, b);
15738                  a.title && this.writeNode("Title", a.title, b);
15739                  a.description && this.writeNode("Abstract", a.description, b);
15740                  a.elseFilter ? this.writeNode("ElseFilter", null, b) : a.filter && this.writeNode("ogc:Filter", a.filter, b);
15741                  void 0 != a.minScaleDenominator && this.writeNode("MinScaleDenominator", a.minScaleDenominator, b);
15742                  void 0 != a.maxScaleDenominator && this.writeNode("MaxScaleDenominator", a.maxScaleDenominator, b);
15743                  var c, d;
15744                  if (this.multipleSymbolizers && a.symbolizers) for (var e = 0, f = a.symbolizers.length; e < f; ++e) (d = a.symbolizers[e]), (c = d.CLASS_NAME.split(".").pop()), this.writeNode(c + "Symbolizer", d, b);
15745                  else for (var f = OpenLayers.Style.SYMBOLIZER_PREFIXES, e = 0, g = f.length; e < g; ++e) (c = f[e]), (d = a.symbolizer[c]) && this.writeNode(c + "Symbolizer", d, b);
15746                  return b;
15747              },
15748              ElseFilter: function () {
15749                  return this.createElementNSPlus("sld:ElseFilter");
15750              },
15751              MinScaleDenominator: function (a) {
15752                  return this.createElementNSPlus("sld:MinScaleDenominator", { value: a });
15753              },
15754              MaxScaleDenominator: function (a) {
15755                  return this.createElementNSPlus("sld:MaxScaleDenominator", { value: a });
15756              },
15757              LineSymbolizer: function (a) {
15758                  var b = this.createElementNSPlus("sld:LineSymbolizer");
15759                  this.writeNode("Stroke", a, b);
15760                  return b;
15761              },
15762              Stroke: function (a) {
15763                  var b = this.createElementNSPlus("sld:Stroke");
15764                  void 0 != a.strokeColor && this.writeNode("CssParameter", { symbolizer: a, key: "strokeColor" }, b);
15765                  void 0 != a.strokeOpacity && this.writeNode("CssParameter", { symbolizer: a, key: "strokeOpacity" }, b);
15766                  void 0 != a.strokeWidth && this.writeNode("CssParameter", { symbolizer: a, key: "strokeWidth" }, b);
15767                  void 0 != a.strokeDashstyle && "solid" !== a.strokeDashstyle && this.writeNode("CssParameter", { symbolizer: a, key: "strokeDashstyle" }, b);
15768                  void 0 != a.strokeLinecap && this.writeNode("CssParameter", { symbolizer: a, key: "strokeLinecap" }, b);
15769                  return b;
15770              },
15771              CssParameter: function (a) {
15772                  return this.createElementNSPlus("sld:CssParameter", { attributes: { name: this.getCssProperty(a.key) }, value: a.symbolizer[a.key] });
15773              },
15774              TextSymbolizer: function (a) {
15775                  var b = this.createElementNSPlus("sld:TextSymbolizer");
15776                  null != a.label && this.writeNode("Label", a.label, b);
15777                  (null == a.fontFamily && null == a.fontSize && null == a.fontWeight && null == a.fontStyle) || this.writeNode("Font", a, b);
15778                  (null == a.labelAnchorPointX && null == a.labelAnchorPointY && null == a.labelAlign && null == a.labelXOffset && null == a.labelYOffset && null == a.labelRotation && null == a.labelPerpendicularOffset) ||
15779                      this.writeNode("LabelPlacement", a, b);
15780                  (null == a.haloRadius && null == a.haloColor && null == a.haloOpacity) || this.writeNode("Halo", a, b);
15781                  (null == a.fontColor && null == a.fontOpacity) || this.writeNode("Fill", { fillColor: a.fontColor, fillOpacity: a.fontOpacity }, b);
15782                  return b;
15783              },
15784              LabelPlacement: function (a) {
15785                  var b = this.createElementNSPlus("sld:LabelPlacement");
15786                  (null == a.labelAnchorPointX && null == a.labelAnchorPointY && null == a.labelAlign && null == a.labelXOffset && null == a.labelYOffset && null == a.labelRotation) ||
15787                      null != a.labelPerpendicularOffset ||
15788                      this.writeNode("PointPlacement", a, b);
15789                  null != a.labelPerpendicularOffset && this.writeNode("LinePlacement", a, b);
15790                  return b;
15791              },
15792              LinePlacement: function (a) {
15793                  var b = this.createElementNSPlus("sld:LinePlacement");
15794                  this.writeNode("PerpendicularOffset", a.labelPerpendicularOffset, b);
15795                  return b;
15796              },
15797              PerpendicularOffset: function (a) {
15798                  return this.createElementNSPlus("sld:PerpendicularOffset", { value: a });
15799              },
15800              PointPlacement: function (a) {
15801                  var b = this.createElementNSPlus("sld:PointPlacement");
15802                  (null == a.labelAnchorPointX && null == a.labelAnchorPointY && null == a.labelAlign) || this.writeNode("AnchorPoint", a, b);
15803                  (null == a.labelXOffset && null == a.labelYOffset) || this.writeNode("Displacement", a, b);
15804                  null != a.labelRotation && this.writeNode("Rotation", a.labelRotation, b);
15805                  return b;
15806              },
15807              AnchorPoint: function (a) {
15808                  var b = this.createElementNSPlus("sld:AnchorPoint"),
15809                      c = a.labelAnchorPointX,
15810                      d = a.labelAnchorPointY;
15811                  null != c && this.writeNode("AnchorPointX", c, b);
15812                  null != d && this.writeNode("AnchorPointY", d, b);
15813                  if (null == c && null == d) {
15814                      var e = a.labelAlign.substr(0, 1);
15815                      a = a.labelAlign.substr(1, 1);
15816                      "l" === e ? (c = 0) : "c" === e ? (c = 0.5) : "r" === e && (c = 1);
15817                      "b" === a ? (d = 0) : "m" === a ? (d = 0.5) : "t" === a && (d = 1);
15818                      this.writeNode("AnchorPointX", c, b);
15819                      this.writeNode("AnchorPointY", d, b);
15820                  }
15821                  return b;
15822              },
15823              AnchorPointX: function (a) {
15824                  return this.createElementNSPlus("sld:AnchorPointX", { value: a });
15825              },
15826              AnchorPointY: function (a) {
15827                  return this.createElementNSPlus("sld:AnchorPointY", { value: a });
15828              },
15829              Displacement: function (a) {
15830                  var b = this.createElementNSPlus("sld:Displacement");
15831                  null != a.labelXOffset && this.writeNode("DisplacementX", a.labelXOffset, b);
15832                  null != a.labelYOffset && this.writeNode("DisplacementY", a.labelYOffset, b);
15833                  return b;
15834              },
15835              DisplacementX: function (a) {
15836                  return this.createElementNSPlus("sld:DisplacementX", { value: a });
15837              },
15838              DisplacementY: function (a) {
15839                  return this.createElementNSPlus("sld:DisplacementY", { value: a });
15840              },
15841              Font: function (a) {
15842                  var b = this.createElementNSPlus("sld:Font");
15843                  a.fontFamily && this.writeNode("CssParameter", { symbolizer: a, key: "fontFamily" }, b);
15844                  a.fontSize && this.writeNode("CssParameter", { symbolizer: a, key: "fontSize" }, b);
15845                  a.fontWeight && this.writeNode("CssParameter", { symbolizer: a, key: "fontWeight" }, b);
15846                  a.fontStyle && this.writeNode("CssParameter", { symbolizer: a, key: "fontStyle" }, b);
15847                  return b;
15848              },
15849              Label: function (a) {
15850                  return this.writers.sld._OGCExpression.call(this, "sld:Label", a);
15851              },
15852              Halo: function (a) {
15853                  var b = this.createElementNSPlus("sld:Halo");
15854                  a.haloRadius && this.writeNode("Radius", a.haloRadius, b);
15855                  (a.haloColor || a.haloOpacity) && this.writeNode("Fill", { fillColor: a.haloColor, fillOpacity: a.haloOpacity }, b);
15856                  return b;
15857              },
15858              Radius: function (a) {
15859                  return this.createElementNSPlus("sld:Radius", { value: a });
15860              },
15861              RasterSymbolizer: function (a) {
15862                  var b = this.createElementNSPlus("sld:RasterSymbolizer");
15863                  a.geometry && this.writeNode("Geometry", a.geometry, b);
15864                  a.opacity && this.writeNode("Opacity", a.opacity, b);
15865                  a.colorMap && this.writeNode("ColorMap", a.colorMap, b);
15866                  return b;
15867              },
15868              Geometry: function (a) {
15869                  var b = this.createElementNSPlus("sld:Geometry");
15870                  a.property && this.writeNode("ogc:PropertyName", a, b);
15871                  return b;
15872              },
15873              ColorMap: function (a) {
15874                  for (var b = this.createElementNSPlus("sld:ColorMap"), c = 0, d = a.length; c < d; ++c) this.writeNode("ColorMapEntry", a[c], b);
15875                  return b;
15876              },
15877              ColorMapEntry: function (a) {
15878                  var b = this.createElementNSPlus("sld:ColorMapEntry");
15879                  b.setAttribute("color", a.color);
15880                  void 0 !== a.opacity && b.setAttribute("opacity", parseFloat(a.opacity));
15881                  void 0 !== a.quantity && b.setAttribute("quantity", parseFloat(a.quantity));
15882                  void 0 !== a.label && b.setAttribute("label", a.label);
15883                  return b;
15884              },
15885              PolygonSymbolizer: function (a) {
15886                  var b = this.createElementNSPlus("sld:PolygonSymbolizer");
15887                  !1 !== a.fill && this.writeNode("Fill", a, b);
15888                  !1 !== a.stroke && this.writeNode("Stroke", a, b);
15889                  return b;
15890              },
15891              Fill: function (a) {
15892                  var b = this.createElementNSPlus("sld:Fill");
15893                  a.fillColor && this.writeNode("CssParameter", { symbolizer: a, key: "fillColor" }, b);
15894                  null != a.fillOpacity && this.writeNode("CssParameter", { symbolizer: a, key: "fillOpacity" }, b);
15895                  return b;
15896              },
15897              PointSymbolizer: function (a) {
15898                  var b = this.createElementNSPlus("sld:PointSymbolizer");
15899                  this.writeNode("Graphic", a, b);
15900                  return b;
15901              },
15902              Graphic: function (a) {
15903                  var b = this.createElementNSPlus("sld:Graphic");
15904                  void 0 != a.externalGraphic ? this.writeNode("ExternalGraphic", a, b) : this.writeNode("Mark", a, b);
15905                  void 0 != a.graphicOpacity && this.writeNode("Opacity", a.graphicOpacity, b);
15906                  void 0 != a.pointRadius ? this.writeNode("Size", 2 * a.pointRadius, b) : void 0 != a.graphicWidth && this.writeNode("Size", a.graphicWidth, b);
15907                  void 0 != a.rotation && this.writeNode("Rotation", a.rotation, b);
15908                  return b;
15909              },
15910              ExternalGraphic: function (a) {
15911                  var b = this.createElementNSPlus("sld:ExternalGraphic");
15912                  this.writeNode("OnlineResource", a.externalGraphic, b);
15913                  a = a.graphicFormat || this.getGraphicFormat(a.externalGraphic);
15914                  this.writeNode("Format", a, b);
15915                  return b;
15916              },
15917              Mark: function (a) {
15918                  var b = this.createElementNSPlus("sld:Mark");
15919                  a.graphicName && this.writeNode("WellKnownName", a.graphicName, b);
15920                  !1 !== a.fill && this.writeNode("Fill", a, b);
15921                  !1 !== a.stroke && this.writeNode("Stroke", a, b);
15922                  return b;
15923              },
15924              WellKnownName: function (a) {
15925                  return this.createElementNSPlus("sld:WellKnownName", { value: a });
15926              },
15927              Opacity: function (a) {
15928                  return this.createElementNSPlus("sld:Opacity", { value: a });
15929              },
15930              Size: function (a) {
15931                  return this.writers.sld._OGCExpression.call(this, "sld:Size", a);
15932              },
15933              Rotation: function (a) {
15934                  return this.createElementNSPlus("sld:Rotation", { value: a });
15935              },
15936              OnlineResource: function (a) {
15937                  return this.createElementNSPlus("sld:OnlineResource", { attributes: { "xlink:type": "simple", "xlink:href": a } });
15938              },
15939              Format: function (a) {
15940                  return this.createElementNSPlus("sld:Format", { value: a });
15941              },
15942          },
15943      },
15944      OpenLayers.Format.Filter.v1_0_0.prototype.writers
15945  ),
15946  CLASS_NAME: "OpenLayers.Format.SLD.v1",
15947});
15948OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
15949  DEFAULT_PARAMS: { service: "WMS", version: "1.1.1", request: "GetMap", styles: "", format: "image/jpeg" },
15950  isBaseLayer: !0,
15951  encodeBBOX: !1,
15952  noMagic: !1,
15953  yx: {},
15954  initialize: function (a, b, c, d) {
15955      var e = [];
15956      c = OpenLayers.Util.upperCaseObject(c);
15957      1.3 <= parseFloat(c.VERSION) && !c.EXCEPTIONS && (c.EXCEPTIONS = "INIMAGE");
15958      e.push(a, b, c, d);
15959      OpenLayers.Layer.Grid.prototype.initialize.apply(this, e);
15960      OpenLayers.Util.applyDefaults(this.params, OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));
15961      !this.noMagic &&
15962          this.params.TRANSPARENT &&
15963          "true" == this.params.TRANSPARENT.toString().toLowerCase() &&
15964          ((null != d && d.isBaseLayer) || (this.isBaseLayer = !1), "image/jpeg" == this.params.FORMAT && (this.params.FORMAT = OpenLayers.Util.alphaHack() ? "image/gif" : "image/png"));
15965  },
15966  clone: function (a) {
15967      null == a && (a = new OpenLayers.Layer.WMS(this.name, this.url, this.params, this.getOptions()));
15968      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
15969  },
15970  reverseAxisOrder: function () {
15971      var a = this.projection.getCode();
15972      return 1.3 <= parseFloat(this.params.VERSION) && !!(this.yx[a] || (OpenLayers.Projection.defaults[a] && OpenLayers.Projection.defaults[a].yx));
15973  },
15974  getURL: function (a) {
15975      a = this.adjustBounds(a);
15976      var b = this.getImageSize(),
15977          c = {},
15978          d = this.reverseAxisOrder();
15979      c.BBOX = this.encodeBBOX ? a.toBBOX(null, d) : a.toArray(d);
15980      c.WIDTH = b.w;
15981      c.HEIGHT = b.h;
15982      return this.getFullRequestString(c);
15983  },
15984  mergeNewParams: function (a) {
15985      a = [OpenLayers.Util.upperCaseObject(a)];
15986      return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this, a);
15987  },
15988  getFullRequestString: function (a, b) {
15989      var c = this.map.getProjectionObject(),
15990          c = this.projection && this.projection.equals(c) ? this.projection.getCode() : c.getCode(),
15991          c = "none" == c ? null : c;
15992      1.3 <= parseFloat(this.params.VERSION) ? (this.params.CRS = c) : (this.params.SRS = c);
15993      "boolean" == typeof this.params.TRANSPARENT && (a.TRANSPARENT = this.params.TRANSPARENT ? "TRUE" : "FALSE");
15994      return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this, arguments);
15995  },
15996  CLASS_NAME: "OpenLayers.Layer.WMS",
15997});
15998OpenLayers.Layer.KaMap = OpenLayers.Class(OpenLayers.Layer.Grid, {
15999  isBaseLayer: !0,
16000  DEFAULT_PARAMS: { i: "jpeg", map: "" },
16001  initialize: function (a, b, c, d) {
16002      OpenLayers.Layer.Grid.prototype.initialize.apply(this, arguments);
16003      this.params = OpenLayers.Util.applyDefaults(this.params, this.DEFAULT_PARAMS);
16004  },
16005  getURL: function (a) {
16006      a = this.adjustBounds(a);
16007      var b = this.map.getResolution(),
16008          c = Math.round(1e4 * this.map.getScale()) / 1e4,
16009          d = Math.round(a.left / b);
16010      a = -Math.round(a.top / b);
16011      return this.getFullRequestString({ t: a, l: d, s: c });
16012  },
16013  calculateGridLayout: function (a, b, c) {
16014      b = c * this.tileSize.w;
16015      c *= this.tileSize.h;
16016      return { tilelon: b, tilelat: c, startcol: Math.floor(a.left / b) - this.buffer, startrow: Math.floor(a.top / c) + this.buffer };
16017  },
16018  getTileBoundsForGridIndex: function (a, b) {
16019      this.getTileOrigin();
16020      var c = this.gridLayout,
16021          d = c.tilelon,
16022          e = c.tilelat,
16023          f = (c.startcol + b) * d,
16024          c = (c.startrow - a) * e;
16025      return new OpenLayers.Bounds(f, c, f + d, c + e);
16026  },
16027  clone: function (a) {
16028      null == a && (a = new OpenLayers.Layer.KaMap(this.name, this.url, this.params, this.getOptions()));
16029      a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]);
16030      null != this.tileSize && (a.tileSize = this.tileSize.clone());
16031      a.grid = [];
16032      return a;
16033  },
16034  getTileBounds: function (a) {
16035      var b = this.getResolution(),
16036          c = b * this.tileSize.w,
16037          b = b * this.tileSize.h,
16038          d = this.getLonLatFromViewPortPx(a);
16039      a = c * Math.floor(d.lon / c);
16040      d = b * Math.floor(d.lat / b);
16041      return new OpenLayers.Bounds(a, d, a + c, d + b);
16042  },
16043  CLASS_NAME: "OpenLayers.Layer.KaMap",
16044});
16045OpenLayers.Format.WMC.v1_1_0 = OpenLayers.Class(OpenLayers.Format.WMC.v1, {
16046  VERSION: "1.1.0",
16047  schemaLocation: "http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd",
16048  initialize: function (a) {
16049      OpenLayers.Format.WMC.v1.prototype.initialize.apply(this, [a]);
16050  },
16051  read_sld_MinScaleDenominator: function (a, b) {
16052      var c = parseFloat(this.getChildValue(b));
16053      0 < c && (a.maxScale = c);
16054  },
16055  read_sld_MaxScaleDenominator: function (a, b) {
16056      a.minScale = parseFloat(this.getChildValue(b));
16057  },
16058  read_wmc_SRS: function (a, b) {
16059      "srs" in a || (a.srs = {});
16060      a.srs[this.getChildValue(b)] = !0;
16061  },
16062  write_wmc_Layer: function (a) {
16063      var b = OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this, [a]);
16064      if (a.maxScale) {
16065          var c = this.createElementNS(this.namespaces.sld, "sld:MinScaleDenominator");
16066          c.appendChild(this.createTextNode(a.maxScale.toPrecision(16)));
16067          b.appendChild(c);
16068      }
16069      a.minScale && ((c = this.createElementNS(this.namespaces.sld, "sld:MaxScaleDenominator")), c.appendChild(this.createTextNode(a.minScale.toPrecision(16))), b.appendChild(c));
16070      if (a.srs) for (var d in a.srs) b.appendChild(this.createElementDefaultNS("SRS", d));
16071      b.appendChild(this.write_wmc_FormatList(a));
16072      b.appendChild(this.write_wmc_StyleList(a));
16073      a.dimensions && b.appendChild(this.write_wmc_DimensionList(a));
16074      b.appendChild(this.write_wmc_LayerExtension(a));
16075      return b;
16076  },
16077  CLASS_NAME: "OpenLayers.Format.WMC.v1_1_0",
16078});
16079OpenLayers.Format.XLS = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { defaultVersion: "1.1.0", stringifyOutput: !0, CLASS_NAME: "OpenLayers.Format.XLS" });
16080OpenLayers.Format.XLS.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
16081  namespaces: { xls: "http://www.opengis.net/xls", gml: "http://www.opengis.net/gml", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
16082  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
16083  xy: !0,
16084  defaultPrefix: "xls",
16085  schemaLocation: null,
16086  read: function (a, b) {
16087      OpenLayers.Util.applyDefaults(b, this.options);
16088      var c = {};
16089      this.readChildNodes(a, c);
16090      return c;
16091  },
16092  readers: {
16093      xls: {
16094          XLS: function (a, b) {
16095              b.version = a.getAttribute("version");
16096              this.readChildNodes(a, b);
16097          },
16098          Response: function (a, b) {
16099              this.readChildNodes(a, b);
16100          },
16101          GeocodeResponse: function (a, b) {
16102              b.responseLists = [];
16103              this.readChildNodes(a, b);
16104          },
16105          GeocodeResponseList: function (a, b) {
16106              var c = { features: [], numberOfGeocodedAddresses: parseInt(a.getAttribute("numberOfGeocodedAddresses")) };
16107              b.responseLists.push(c);
16108              this.readChildNodes(a, c);
16109          },
16110          GeocodedAddress: function (a, b) {
16111              var c = new OpenLayers.Feature.Vector();
16112              b.features.push(c);
16113              this.readChildNodes(a, c);
16114              c.geometry = c.components[0];
16115          },
16116          GeocodeMatchCode: function (a, b) {
16117              b.attributes.matchCode = { accuracy: parseFloat(a.getAttribute("accuracy")), matchType: a.getAttribute("matchType") };
16118          },
16119          Address: function (a, b) {
16120              var c = { countryCode: a.getAttribute("countryCode"), addressee: a.getAttribute("addressee"), street: [], place: [] };
16121              b.attributes.address = c;
16122              this.readChildNodes(a, c);
16123          },
16124          freeFormAddress: function (a, b) {
16125              b.freeFormAddress = this.getChildValue(a);
16126          },
16127          StreetAddress: function (a, b) {
16128              this.readChildNodes(a, b);
16129          },
16130          Building: function (a, b) {
16131              b.building = { number: a.getAttribute("number"), subdivision: a.getAttribute("subdivision"), buildingName: a.getAttribute("buildingName") };
16132          },
16133          Street: function (a, b) {
16134              b.street.push(this.getChildValue(a));
16135          },
16136          Place: function (a, b) {
16137              b.place[a.getAttribute("type")] = this.getChildValue(a);
16138          },
16139          PostalCode: function (a, b) {
16140              b.postalCode = this.getChildValue(a);
16141          },
16142      },
16143      gml: OpenLayers.Format.GML.v3.prototype.readers.gml,
16144  },
16145  write: function (a) {
16146      return this.writers.xls.XLS.apply(this, [a]);
16147  },
16148  writers: {
16149      xls: {
16150          XLS: function (a) {
16151              var b = this.createElementNSPlus("xls:XLS", { attributes: { version: this.VERSION, "xsi:schemaLocation": this.schemaLocation } });
16152              this.writeNode("RequestHeader", a.header, b);
16153              this.writeNode("Request", a, b);
16154              return b;
16155          },
16156          RequestHeader: function (a) {
16157              return this.createElementNSPlus("xls:RequestHeader");
16158          },
16159          Request: function (a) {
16160              var b = this.createElementNSPlus("xls:Request", { attributes: { methodName: "GeocodeRequest", requestID: a.requestID || "", version: this.VERSION } });
16161              this.writeNode("GeocodeRequest", a.addresses, b);
16162              return b;
16163          },
16164          GeocodeRequest: function (a) {
16165              for (var b = this.createElementNSPlus("xls:GeocodeRequest"), c = 0, d = a.length; c < d; c++) this.writeNode("Address", a[c], b);
16166              return b;
16167          },
16168          Address: function (a) {
16169              var b = this.createElementNSPlus("xls:Address", { attributes: { countryCode: a.countryCode } });
16170              a.freeFormAddress
16171                  ? this.writeNode("freeFormAddress", a.freeFormAddress, b)
16172                  : (a.street && this.writeNode("StreetAddress", a, b),
16173                    a.municipality && this.writeNode("Municipality", a.municipality, b),
16174                    a.countrySubdivision && this.writeNode("CountrySubdivision", a.countrySubdivision, b),
16175                    a.postalCode && this.writeNode("PostalCode", a.postalCode, b));
16176              return b;
16177          },
16178          freeFormAddress: function (a) {
16179              return this.createElementNSPlus("freeFormAddress", { value: a });
16180          },
16181          StreetAddress: function (a) {
16182              var b = this.createElementNSPlus("xls:StreetAddress");
16183              a.building && this.writeNode(b, "Building", a.building);
16184              a = a.street;
16185              OpenLayers.Util.isArray(a) || (a = [a]);
16186              for (var c = 0, d = a.length; c < d; c++) this.writeNode("Street", a[c], b);
16187              return b;
16188          },
16189          Building: function (a) {
16190              return this.createElementNSPlus("xls:Building", { attributes: { number: a.number, subdivision: a.subdivision, buildingName: a.buildingName } });
16191          },
16192          Street: function (a) {
16193              return this.createElementNSPlus("xls:Street", { value: a });
16194          },
16195          Municipality: function (a) {
16196              return this.createElementNSPlus("xls:Place", { attributes: { type: "Municipality" }, value: a });
16197          },
16198          CountrySubdivision: function (a) {
16199              return this.createElementNSPlus("xls:Place", { attributes: { type: "CountrySubdivision" }, value: a });
16200          },
16201          PostalCode: function (a) {
16202              return this.createElementNSPlus("xls:PostalCode", { value: a });
16203          },
16204      },
16205  },
16206  CLASS_NAME: "OpenLayers.Format.XLS.v1",
16207});
16208OpenLayers.Format.XLS.v1_1_0 = OpenLayers.Class(OpenLayers.Format.XLS.v1, {
16209  VERSION: "1.1",
16210  schemaLocation: "http://www.opengis.net/xls http://schemas.opengis.net/ols/1.1.0/LocationUtilityService.xsd",
16211  CLASS_NAME: "OpenLayers.Format.XLS.v1_1_0",
16212});
16213OpenLayers.Format.XLS.v1_1 = OpenLayers.Format.XLS.v1_1_0;
16214OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
16215  xmlns: "http://www.w3.org/2000/svg",
16216  xlinkns: "http://www.w3.org/1999/xlink",
16217  MAX_PIXEL: 15e3,
16218  translationParameters: null,
16219  symbolMetrics: null,
16220  initialize: function (a) {
16221      this.supported() && (OpenLayers.Renderer.Elements.prototype.initialize.apply(this, arguments), (this.translationParameters = { x: 0, y: 0 }), (this.symbolMetrics = {}));
16222  },
16223  supported: function () {
16224      return (
16225          document.implementation &&
16226          (document.implementation.hasFeature("org.w3c.svg", "1.0") ||
16227              document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG", "1.1") ||
16228              document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"))
16229      );
16230  },
16231  inValidRange: function (a, b, c) {
16232      a += c ? 0 : this.translationParameters.x;
16233      b += c ? 0 : this.translationParameters.y;
16234      return a >= -this.MAX_PIXEL && a <= this.MAX_PIXEL && b >= -this.MAX_PIXEL && b <= this.MAX_PIXEL;
16235  },
16236  setExtent: function (a, b) {
16237      var c = OpenLayers.Renderer.Elements.prototype.setExtent.apply(this, arguments),
16238          d = this.getResolution(),
16239          e = -a.left / d,
16240          d = a.top / d;
16241      if (b) return (this.left = e), (this.top = d), this.rendererRoot.setAttributeNS(null, "viewBox", "0 0 " + this.size.w + " " + this.size.h), this.translate(this.xOffset, 0), !0;
16242      (e = this.translate(e - this.left + this.xOffset, d - this.top)) || this.setExtent(a, !0);
16243      return c && e;
16244  },
16245  translate: function (a, b) {
16246      if (this.inValidRange(a, b, !0)) {
16247          var c = "";
16248          if (a || b) c = "translate(" + a + "," + b + ")";
16249          this.root.setAttributeNS(null, "transform", c);
16250          this.translationParameters = { x: a, y: b };
16251          return !0;
16252      }
16253      return !1;
16254  },
16255  setSize: function (a) {
16256      OpenLayers.Renderer.prototype.setSize.apply(this, arguments);
16257      this.rendererRoot.setAttributeNS(null, "width", this.size.w);
16258      this.rendererRoot.setAttributeNS(null, "height", this.size.h);
16259  },
16260  getNodeType: function (a, b) {
16261      var c = null;
16262      switch (a.CLASS_NAME) {
16263          case "OpenLayers.Geometry.Point":
16264              c = b.externalGraphic ? "image" : this.isComplexSymbol(b.graphicName) ? "svg" : "circle";
16265              break;
16266          case "OpenLayers.Geometry.Rectangle":
16267              c = "rect";
16268              break;
16269          case "OpenLayers.Geometry.LineString":
16270              c = "polyline";
16271              break;
16272          case "OpenLayers.Geometry.LinearRing":
16273              c = "polygon";
16274              break;
16275          case "OpenLayers.Geometry.Polygon":
16276          case "OpenLayers.Geometry.Curve":
16277              c = "path";
16278      }
16279      return c;
16280  },
16281  setStyle: function (a, b, c) {
16282      b = b || a._style;
16283      c = c || a._options;
16284      var d = b.title || b.graphicTitle;
16285      if (d) {
16286          a.setAttributeNS(null, "title", d);
16287          var e = a.getElementsByTagName("title");
16288          0 < e.length ? (e[0].firstChild.textContent = d) : ((e = this.nodeFactory(null, "title")), (e.textContent = d), a.appendChild(e));
16289      }
16290      var e = parseFloat(a.getAttributeNS(null, "r")),
16291          d = 1,
16292          f;
16293      if ("OpenLayers.Geometry.Point" == a._geometryClass && e) {
16294          a.style.visibility = "";
16295          if (!1 === b.graphic) a.style.visibility = "hidden";
16296          else if (b.externalGraphic) {
16297              f = this.getPosition(a);
16298              b.graphicWidth && b.graphicHeight && a.setAttributeNS(null, "preserveAspectRatio", "none");
16299              var e = b.graphicWidth || b.graphicHeight,
16300                  g = b.graphicHeight || b.graphicWidth,
16301                  e = e ? e : 2 * b.pointRadius,
16302                  g = g ? g : 2 * b.pointRadius,
16303                  h = void 0 != b.graphicYOffset ? b.graphicYOffset : -(0.5 * g),
16304                  k = b.graphicOpacity || b.fillOpacity;
16305              a.setAttributeNS(null, "x", (f.x + (void 0 != b.graphicXOffset ? b.graphicXOffset : -(0.5 * e))).toFixed());
16306              a.setAttributeNS(null, "y", (f.y + h).toFixed());
16307              a.setAttributeNS(null, "width", e);
16308              a.setAttributeNS(null, "height", g);
16309              a.setAttributeNS(this.xlinkns, "xlink:href", b.externalGraphic);
16310              a.setAttributeNS(null, "style", "opacity: " + k);
16311              a.onclick = OpenLayers.Event.preventDefault;
16312          } else if (this.isComplexSymbol(b.graphicName)) {
16313              var e = 3 * b.pointRadius,
16314                  g = 2 * e,
16315                  l = this.importSymbol(b.graphicName);
16316              f = this.getPosition(a);
16317              d = (3 * this.symbolMetrics[l.id][0]) / g;
16318              h = a.parentNode;
16319              k = a.nextSibling;
16320              h && h.removeChild(a);
16321              a.firstChild && a.removeChild(a.firstChild);
16322              a.appendChild(l.firstChild.cloneNode(!0));
16323              a.setAttributeNS(null, "viewBox", l.getAttributeNS(null, "viewBox"));
16324              a.setAttributeNS(null, "width", g);
16325              a.setAttributeNS(null, "height", g);
16326              a.setAttributeNS(null, "x", f.x - e);
16327              a.setAttributeNS(null, "y", f.y - e);
16328              k ? h.insertBefore(a, k) : h && h.appendChild(a);
16329          } else a.setAttributeNS(null, "r", b.pointRadius);
16330          e = b.rotation;
16331          (void 0 === e && void 0 === a._rotation) ||
16332              !f ||
16333              ((a._rotation = e),
16334              (e |= 0),
16335              "svg" !== a.nodeName
16336                  ? a.setAttributeNS(null, "transform", "rotate(" + e + " " + f.x + " " + f.y + ")")
16337                  : ((f = this.symbolMetrics[l.id]), a.firstChild.setAttributeNS(null, "transform", "rotate(" + e + " " + f[1] + " " + f[2] + ")")));
16338      }
16339      c.isFilled ? (a.setAttributeNS(null, "fill", b.fillColor), a.setAttributeNS(null, "fill-opacity", b.fillOpacity)) : a.setAttributeNS(null, "fill", "none");
16340      c.isStroked
16341          ? (a.setAttributeNS(null, "stroke", b.strokeColor),
16342            a.setAttributeNS(null, "stroke-opacity", b.strokeOpacity),
16343            a.setAttributeNS(null, "stroke-width", b.strokeWidth * d),
16344            a.setAttributeNS(null, "stroke-linecap", b.strokeLinecap || "round"),
16345            a.setAttributeNS(null, "stroke-linejoin", "round"),
16346            b.strokeDashstyle && a.setAttributeNS(null, "stroke-dasharray", this.dashStyle(b, d)))
16347          : a.setAttributeNS(null, "stroke", "none");
16348      b.pointerEvents && a.setAttributeNS(null, "pointer-events", b.pointerEvents);
16349      null != b.cursor && a.setAttributeNS(null, "cursor", b.cursor);
16350      return a;
16351  },
16352  dashStyle: function (a, b) {
16353      var c = a.strokeWidth * b,
16354          d = a.strokeDashstyle;
16355      switch (d) {
16356          case "solid":
16357              return "none";
16358          case "dot":
16359              return [1, 4 * c].join();
16360          case "dash":
16361              return [4 * c, 4 * c].join();
16362          case "dashdot":
16363              return [4 * c, 4 * c, 1, 4 * c].join();
16364          case "longdash":
16365              return [8 * c, 4 * c].join();
16366          case "longdashdot":
16367              return [8 * c, 4 * c, 1, 4 * c].join();
16368          default:
16369              return OpenLayers.String.trim(d).replace(/\s+/g, ",");
16370      }
16371  },
16372  createNode: function (a, b) {
16373      var c = document.createElementNS(this.xmlns, a);
16374      b && c.setAttributeNS(null, "id", b);
16375      return c;
16376  },
16377  nodeTypeCompare: function (a, b) {
16378      return b == a.nodeName;
16379  },
16380  createRenderRoot: function () {
16381      var a = this.nodeFactory(this.container.id + "_svgRoot", "svg");
16382      a.style.display = "block";
16383      return a;
16384  },
16385  createRoot: function (a) {
16386      return this.nodeFactory(this.container.id + a, "g");
16387  },
16388  createDefs: function () {
16389      var a = this.nodeFactory(this.container.id + "_defs", "defs");
16390      this.rendererRoot.appendChild(a);
16391      return a;
16392  },
16393  drawPoint: function (a, b) {
16394      return this.drawCircle(a, b, 1);
16395  },
16396  drawCircle: function (a, b, c) {
16397      var d = this.getResolution(),
16398          e = (b.x - this.featureDx) / d + this.left;
16399      b = this.top - b.y / d;
16400      return this.inValidRange(e, b) ? (a.setAttributeNS(null, "cx", e), a.setAttributeNS(null, "cy", b), a.setAttributeNS(null, "r", c), a) : !1;
16401  },
16402  drawLineString: function (a, b) {
16403      var c = this.getComponentsString(b.components);
16404      return c.path ? (a.setAttributeNS(null, "points", c.path), c.complete ? a : null) : !1;
16405  },
16406  drawLinearRing: function (a, b) {
16407      var c = this.getComponentsString(b.components);
16408      return c.path ? (a.setAttributeNS(null, "points", c.path), c.complete ? a : null) : !1;
16409  },
16410  drawPolygon: function (a, b) {
16411      for (var c = "", d = !0, e = !0, f, g, h = 0, k = b.components.length; h < k; h++) (c += " M"), (f = this.getComponentsString(b.components[h].components, " ")), (g = f.path) ? ((c += " " + g), (e = f.complete && e)) : (d = !1);
16412      return d ? (a.setAttributeNS(null, "d", c + " z"), a.setAttributeNS(null, "fill-rule", "evenodd"), e ? a : null) : !1;
16413  },
16414  drawRectangle: function (a, b) {
16415      var c = this.getResolution(),
16416          d = (b.x - this.featureDx) / c + this.left,
16417          e = this.top - b.y / c;
16418      return this.inValidRange(d, e) ? (a.setAttributeNS(null, "x", d), a.setAttributeNS(null, "y", e), a.setAttributeNS(null, "width", b.width / c), a.setAttributeNS(null, "height", b.height / c), a) : !1;
16419  },
16420  drawText: function (a, b, c) {
16421      var d = !!b.labelOutlineWidth;
16422      if (d) {
16423          var e = OpenLayers.Util.extend({}, b);
16424          e.fontColor = e.labelOutlineColor;
16425          e.fontStrokeColor = e.labelOutlineColor;
16426          e.fontStrokeWidth = b.labelOutlineWidth;
16427          b.labelOutlineOpacity && (e.fontOpacity = b.labelOutlineOpacity);
16428          delete e.labelOutlineWidth;
16429          this.drawText(a, e, c);
16430      }
16431      var f = this.getResolution(),
16432          e = (c.x - this.featureDx) / f + this.left,
16433          g = c.y / f - this.top,
16434          d = d ? this.LABEL_OUTLINE_SUFFIX : this.LABEL_ID_SUFFIX,
16435          f = this.nodeFactory(a + d, "text");
16436      f.setAttributeNS(null, "x", e);
16437      f.setAttributeNS(null, "y", -g);
16438      b.fontColor && f.setAttributeNS(null, "fill", b.fontColor);
16439      b.fontStrokeColor && f.setAttributeNS(null, "stroke", b.fontStrokeColor);
16440      b.fontStrokeWidth && f.setAttributeNS(null, "stroke-width", b.fontStrokeWidth);
16441      b.fontOpacity && f.setAttributeNS(null, "opacity", b.fontOpacity);
16442      b.fontFamily && f.setAttributeNS(null, "font-family", b.fontFamily);
16443      b.fontSize && f.setAttributeNS(null, "font-size", b.fontSize);
16444      b.fontWeight && f.setAttributeNS(null, "font-weight", b.fontWeight);
16445      b.fontStyle && f.setAttributeNS(null, "font-style", b.fontStyle);
16446      !0 === b.labelSelect ? (f.setAttributeNS(null, "pointer-events", "visible"), (f._featureId = a)) : f.setAttributeNS(null, "pointer-events", "none");
16447      g = b.labelAlign || OpenLayers.Renderer.defaultSymbolizer.labelAlign;
16448      f.setAttributeNS(null, "text-anchor", OpenLayers.Renderer.SVG.LABEL_ALIGN[g[0]] || "middle");
16449      !0 === OpenLayers.IS_GECKO && f.setAttributeNS(null, "dominant-baseline", OpenLayers.Renderer.SVG.LABEL_ALIGN[g[1]] || "central");
16450      for (var h = b.label.split("\n"), k = h.length; f.childNodes.length > k; ) f.removeChild(f.lastChild);
16451      for (var l = 0; l < k; l++) {
16452          var m = this.nodeFactory(a + d + "_tspan_" + l, "tspan");
16453          !0 === b.labelSelect && ((m._featureId = a), (m._geometry = c), (m._geometryClass = c.CLASS_NAME));
16454          !1 === OpenLayers.IS_GECKO && m.setAttributeNS(null, "baseline-shift", OpenLayers.Renderer.SVG.LABEL_VSHIFT[g[1]] || "-35%");
16455          m.setAttribute("x", e);
16456          if (0 == l) {
16457              var n = OpenLayers.Renderer.SVG.LABEL_VFACTOR[g[1]];
16458              null == n && (n = -0.5);
16459              m.setAttribute("dy", n * (k - 1) + "em");
16460          } else m.setAttribute("dy", "1em");
16461          m.textContent = "" === h[l] ? " " : h[l];
16462          m.parentNode || f.appendChild(m);
16463      }
16464      f.parentNode || this.textRoot.appendChild(f);
16465  },
16466  getComponentsString: function (a, b) {
16467      for (var c = [], d = !0, e = a.length, f = [], g, h = 0; h < e; h++)
16468          (g = a[h]),
16469              c.push(g),
16470              (g = this.getShortString(g)) ? f.push(g) : (0 < h && this.getShortString(a[h - 1]) && f.push(this.clipLine(a[h], a[h - 1])), h < e - 1 && this.getShortString(a[h + 1]) && f.push(this.clipLine(a[h], a[h + 1])), (d = !1));
16471      return { path: f.join(b || ","), complete: d };
16472  },
16473  clipLine: function (a, b) {
16474      if (b.equals(a)) return "";
16475      var c = this.getResolution(),
16476          d = this.MAX_PIXEL - this.translationParameters.x,
16477          e = this.MAX_PIXEL - this.translationParameters.y,
16478          f = (b.x - this.featureDx) / c + this.left,
16479          g = this.top - b.y / c,
16480          h = (a.x - this.featureDx) / c + this.left,
16481          c = this.top - a.y / c,
16482          k;
16483      if (h < -d || h > d) (k = (c - g) / (h - f)), (h = 0 > h ? -d : d), (c = g + (h - f) * k);
16484      if (c < -e || c > e) (k = (h - f) / (c - g)), (c = 0 > c ? -e : e), (h = f + (c - g) * k);
16485      return h + "," + c;
16486  },
16487  getShortString: function (a) {
16488      var b = this.getResolution(),
16489          c = (a.x - this.featureDx) / b + this.left;
16490      a = this.top - a.y / b;
16491      return this.inValidRange(c, a) ? c + "," + a : !1;
16492  },
16493  getPosition: function (a) {
16494      return { x: parseFloat(a.getAttributeNS(null, "cx")), y: parseFloat(a.getAttributeNS(null, "cy")) };
16495  },
16496  importSymbol: function (a) {
16497      this.defs || (this.defs = this.createDefs());
16498      var b = this.container.id + "-" + a,
16499          c = document.getElementById(b);
16500      if (null != c) return c;
16501      var d = OpenLayers.Renderer.symbol[a];
16502      if (!d) throw Error(a + " is not a valid symbol name");
16503      a = this.nodeFactory(b, "symbol");
16504      var e = this.nodeFactory(null, "polygon");
16505      a.appendChild(e);
16506      for (var c = new OpenLayers.Bounds(Number.MAX_VALUE, Number.MAX_VALUE, 0, 0), f = [], g, h, k = 0; k < d.length; k += 2)
16507          (g = d[k]), (h = d[k + 1]), (c.left = Math.min(c.left, g)), (c.bottom = Math.min(c.bottom, h)), (c.right = Math.max(c.right, g)), (c.top = Math.max(c.top, h)), f.push(g, ",", h);
16508      e.setAttributeNS(null, "points", f.join(" "));
16509      d = c.getWidth();
16510      e = c.getHeight();
16511      a.setAttributeNS(null, "viewBox", [c.left - d, c.bottom - e, 3 * d, 3 * e].join(" "));
16512      this.symbolMetrics[b] = [Math.max(d, e), c.getCenterLonLat().lon, c.getCenterLonLat().lat];
16513      this.defs.appendChild(a);
16514      return a;
16515  },
16516  getFeatureIdFromEvent: function (a) {
16517      var b = OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this, arguments);
16518      b || ((b = a.target), (b = b.parentNode && b != this.rendererRoot ? b.parentNode._featureId : void 0));
16519      return b;
16520  },
16521  CLASS_NAME: "OpenLayers.Renderer.SVG",
16522});
16523OpenLayers.Renderer.SVG.LABEL_ALIGN = { l: "start", r: "end", b: "bottom", t: "hanging" };
16524OpenLayers.Renderer.SVG.LABEL_VSHIFT = { t: "-70%", b: "0" };
16525OpenLayers.Renderer.SVG.LABEL_VFACTOR = { t: 0, b: -1 };
16526OpenLayers.Renderer.SVG.preventDefault = function (a) {
16527  OpenLayers.Event.preventDefault(a);
16528};
16529OpenLayers.Format.SLD.v1_0_0 = OpenLayers.Class(OpenLayers.Format.SLD.v1, {
16530  VERSION: "1.0.0",
16531  schemaLocation: "http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd",
16532  CLASS_NAME: "OpenLayers.Format.SLD.v1_0_0",
16533});
16534OpenLayers.Format.OWSContext = OpenLayers.Class(OpenLayers.Format.Context, {
16535  defaultVersion: "0.3.1",
16536  getVersion: function (a, b) {
16537      var c = OpenLayers.Format.XML.VersionedOGC.prototype.getVersion.apply(this, arguments);
16538      "0.3.0" === c && (c = this.defaultVersion);
16539      return c;
16540  },
16541  toContext: function (a) {
16542      var b = {};
16543      "OpenLayers.Map" == a.CLASS_NAME && ((b.bounds = a.getExtent()), (b.maxExtent = a.maxExtent), (b.projection = a.projection), (b.size = a.getSize()), (b.layers = a.layers));
16544      return b;
16545  },
16546  CLASS_NAME: "OpenLayers.Format.OWSContext",
16547});
16548OpenLayers.Format.OWSContext.v0_3_1 = OpenLayers.Class(OpenLayers.Format.XML, {
16549  namespaces: {
16550      owc: "http://www.opengis.net/ows-context",
16551      gml: "http://www.opengis.net/gml",
16552      kml: "http://www.opengis.net/kml/2.2",
16553      ogc: "http://www.opengis.net/ogc",
16554      ows: "http://www.opengis.net/ows",
16555      sld: "http://www.opengis.net/sld",
16556      xlink: "http://www.w3.org/1999/xlink",
16557      xsi: "http://www.w3.org/2001/XMLSchema-instance",
16558  },
16559  VERSION: "0.3.1",
16560  schemaLocation: "http://www.opengis.net/ows-context http://www.ogcnetwork.net/schemas/owc/0.3.1/owsContext.xsd",
16561  defaultPrefix: "owc",
16562  extractAttributes: !0,
16563  xy: !0,
16564  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
16565  featureNS: "http://mapserver.gis.umn.edu/mapserver",
16566  featureType: "vector",
16567  geometryName: "geometry",
16568  nestingLayerLookup: null,
16569  initialize: function (a) {
16570      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
16571      OpenLayers.Format.GML.v2.prototype.setGeometryTypes.call(this);
16572  },
16573  setNestingPath: function (a) {
16574      if (a.layersContext)
16575          for (var b = 0, c = a.layersContext.length; b < c; b++) {
16576              var d = a.layersContext[b],
16577                  e = [],
16578                  f = a.title || "";
16579              a.metadata && a.metadata.nestingPath && (e = a.metadata.nestingPath.slice());
16580              "" != f && e.push(f);
16581              d.metadata.nestingPath = e;
16582              d.layersContext && this.setNestingPath(d);
16583          }
16584  },
16585  decomposeNestingPath: function (a) {
16586      var b = [];
16587      if (OpenLayers.Util.isArray(a)) {
16588          for (a = a.slice(); 0 < a.length; ) b.push(a.slice()), a.pop();
16589          b.reverse();
16590      }
16591      return b;
16592  },
16593  read: function (a) {
16594      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
16595      a && 9 == a.nodeType && (a = a.documentElement);
16596      var b = {};
16597      this.readNode(a, b);
16598      this.setNestingPath({ layersContext: b.layersContext });
16599      a = [];
16600      this.processLayer(a, b);
16601      delete b.layersContext;
16602      b.layersContext = a;
16603      return b;
16604  },
16605  processLayer: function (a, b) {
16606      if (b.layersContext)
16607          for (var c = 0, d = b.layersContext.length; c < d; c++) {
16608              var e = b.layersContext[c];
16609              a.push(e);
16610              e.layersContext && this.processLayer(a, e);
16611          }
16612  },
16613  write: function (a, b) {
16614      this.nestingLayerLookup = {};
16615      b = b || {};
16616      OpenLayers.Util.applyDefaults(b, a);
16617      var c = this.writeNode("OWSContext", b);
16618      this.nestingLayerLookup = null;
16619      this.setAttributeNS(c, this.namespaces.xsi, "xsi:schemaLocation", this.schemaLocation);
16620      return OpenLayers.Format.XML.prototype.write.apply(this, [c]);
16621  },
16622  readers: {
16623      kml: {
16624          Document: function (a, b) {
16625              b.features = new OpenLayers.Format.KML({ kmlns: this.namespaces.kml, extractStyles: !0 }).read(a);
16626          },
16627      },
16628      owc: {
16629          OWSContext: function (a, b) {
16630              this.readChildNodes(a, b);
16631          },
16632          General: function (a, b) {
16633              this.readChildNodes(a, b);
16634          },
16635          ResourceList: function (a, b) {
16636              this.readChildNodes(a, b);
16637          },
16638          Layer: function (a, b) {
16639              var c = {
16640                  metadata: {},
16641                  visibility: "1" != a.getAttribute("hidden"),
16642                  queryable: "1" == a.getAttribute("queryable"),
16643                  opacity: null != a.getAttribute("opacity") ? parseFloat(a.getAttribute("opacity")) : null,
16644                  name: a.getAttribute("name"),
16645                  categoryLayer: null == a.getAttribute("name"),
16646                  formats: [],
16647                  styles: [],
16648              };
16649              b.layersContext || (b.layersContext = []);
16650              b.layersContext.push(c);
16651              this.readChildNodes(a, c);
16652          },
16653          InlineGeometry: function (a, b) {
16654              b.features = [];
16655              var c = this.getElementsByTagNameNS(a, this.namespaces.gml, "featureMember"),
16656                  d;
16657              1 <= c.length && (d = c[0]);
16658              d &&
16659                  d.firstChild &&
16660                  ((c = d.firstChild.nextSibling ? d.firstChild.nextSibling : d.firstChild), this.setNamespace("feature", c.namespaceURI), (this.featureType = c.localName || c.nodeName.split(":").pop()), this.readChildNodes(a, b));
16661          },
16662          Server: function (a, b) {
16663              if ((!b.service && !b.version) || b.service != OpenLayers.Format.Context.serviceTypes.WMS) (b.service = a.getAttribute("service")), (b.version = a.getAttribute("version")), this.readChildNodes(a, b);
16664          },
16665          Name: function (a, b) {
16666              b.name = this.getChildValue(a);
16667              this.readChildNodes(a, b);
16668          },
16669          Title: function (a, b) {
16670              b.title = this.getChildValue(a);
16671              this.readChildNodes(a, b);
16672          },
16673          StyleList: function (a, b) {
16674              this.readChildNodes(a, b.styles);
16675          },
16676          Style: function (a, b) {
16677              var c = {};
16678              b.push(c);
16679              this.readChildNodes(a, c);
16680          },
16681          LegendURL: function (a, b) {
16682              var c = {};
16683              b.legend = c;
16684              this.readChildNodes(a, c);
16685          },
16686          OnlineResource: function (a, b) {
16687              b.url = this.getAttributeNS(a, this.namespaces.xlink, "href");
16688              this.readChildNodes(a, b);
16689          },
16690      },
16691      ows: OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows,
16692      gml: OpenLayers.Format.GML.v2.prototype.readers.gml,
16693      sld: OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld,
16694      feature: OpenLayers.Format.GML.v2.prototype.readers.feature,
16695  },
16696  writers: {
16697      owc: {
16698          OWSContext: function (a) {
16699              var b = this.createElementNSPlus("OWSContext", { attributes: { version: this.VERSION, id: a.id || OpenLayers.Util.createUniqueID("OpenLayers_OWSContext_") } });
16700              this.writeNode("General", a, b);
16701              this.writeNode("ResourceList", a, b);
16702              return b;
16703          },
16704          General: function (a) {
16705              var b = this.createElementNSPlus("General");
16706              this.writeNode("ows:BoundingBox", a, b);
16707              this.writeNode("ows:Title", a.title || "OpenLayers OWSContext", b);
16708              return b;
16709          },
16710          ResourceList: function (a) {
16711              for (var b = this.createElementNSPlus("ResourceList"), c = 0, d = a.layers.length; c < d; c++) {
16712                  var e = a.layers[c],
16713                      f = this.decomposeNestingPath(e.metadata.nestingPath);
16714                  this.writeNode("_Layer", { layer: e, subPaths: f }, b);
16715              }
16716              return b;
16717          },
16718          Server: function (a) {
16719              var b = this.createElementNSPlus("Server", { attributes: { version: a.version, service: a.service } });
16720              this.writeNode("OnlineResource", a, b);
16721              return b;
16722          },
16723          OnlineResource: function (a) {
16724              return this.createElementNSPlus("OnlineResource", { attributes: { "xlink:href": a.url } });
16725          },
16726          InlineGeometry: function (a) {
16727              var b = this.createElementNSPlus("InlineGeometry"),
16728                  c = a.getDataExtent();
16729              null !== c && this.writeNode("gml:boundedBy", c, b);
16730              for (var c = 0, d = a.features.length; c < d; c++) this.writeNode("gml:featureMember", a.features[c], b);
16731              return b;
16732          },
16733          StyleList: function (a) {
16734              for (var b = this.createElementNSPlus("StyleList"), c = 0, d = a.length; c < d; c++) this.writeNode("Style", a[c], b);
16735              return b;
16736          },
16737          Style: function (a) {
16738              var b = this.createElementNSPlus("Style");
16739              this.writeNode("Name", a, b);
16740              this.writeNode("Title", a, b);
16741              a.legend && this.writeNode("LegendURL", a, b);
16742              return b;
16743          },
16744          Name: function (a) {
16745              return this.createElementNSPlus("Name", { value: a.name });
16746          },
16747          Title: function (a) {
16748              return this.createElementNSPlus("Title", { value: a.title });
16749          },
16750          LegendURL: function (a) {
16751              var b = this.createElementNSPlus("LegendURL");
16752              this.writeNode("OnlineResource", a.legend, b);
16753              return b;
16754          },
16755          _WMS: function (a) {
16756              var b = this.createElementNSPlus("Layer", { attributes: { name: a.params.LAYERS, queryable: a.queryable ? "1" : "0", hidden: a.visibility ? "0" : "1", opacity: a.hasOwnProperty("opacity") ? a.opacity : null } });
16757              this.writeNode("ows:Title", a.name, b);
16758              this.writeNode("ows:OutputFormat", a.params.FORMAT, b);
16759              this.writeNode("Server", { service: OpenLayers.Format.Context.serviceTypes.WMS, version: a.params.VERSION, url: a.url }, b);
16760              a.metadata.styles && 0 < a.metadata.styles.length && this.writeNode("StyleList", a.metadata.styles, b);
16761              return b;
16762          },
16763          _Layer: function (a) {
16764              var b, c, d;
16765              b = a.layer;
16766              c = a.subPaths;
16767              d = null;
16768              0 < c.length
16769                  ? ((b = c[0].join("/")),
16770                    (c = b.lastIndexOf("/")),
16771                    (d = this.nestingLayerLookup[b]),
16772                    (c = 0 < c ? b.substring(c + 1, b.length) : b),
16773                    d || ((d = this.createElementNSPlus("Layer")), this.writeNode("ows:Title", c, d), (this.nestingLayerLookup[b] = d)),
16774                    a.subPaths.shift(),
16775                    this.writeNode("_Layer", a, d))
16776                  : (b instanceof OpenLayers.Layer.WMS
16777                        ? (d = this.writeNode("_WMS", b))
16778                        : b instanceof OpenLayers.Layer.Vector &&
16779                          (b.protocol instanceof OpenLayers.Protocol.WFS.v1
16780                              ? (d = this.writeNode("_WFS", b))
16781                              : b.protocol instanceof OpenLayers.Protocol.HTTP
16782                              ? b.protocol.format instanceof OpenLayers.Format.GML
16783                                  ? ((b.protocol.format.version = "2.1.2"), (d = this.writeNode("_GML", b)))
16784                                  : b.protocol.format instanceof OpenLayers.Format.KML && ((b.protocol.format.version = "2.2"), (d = this.writeNode("_KML", b)))
16785                              : (this.setNamespace("feature", this.featureNS), (d = this.writeNode("_InlineGeometry", b)))),
16786                    b.options.maxScale && this.writeNode("sld:MinScaleDenominator", b.options.maxScale, d),
16787                    b.options.minScale && this.writeNode("sld:MaxScaleDenominator", b.options.minScale, d),
16788                    (this.nestingLayerLookup[b.name] = d));
16789              return d;
16790          },
16791          _WFS: function (a) {
16792              var b = this.createElementNSPlus("Layer", { attributes: { name: a.protocol.featurePrefix + ":" + a.protocol.featureType, hidden: a.visibility ? "0" : "1" } });
16793              this.writeNode("ows:Title", a.name, b);
16794              this.writeNode("Server", { service: OpenLayers.Format.Context.serviceTypes.WFS, version: a.protocol.version, url: a.protocol.url }, b);
16795              return b;
16796          },
16797          _InlineGeometry: function (a) {
16798              var b = this.createElementNSPlus("Layer", { attributes: { name: this.featureType, hidden: a.visibility ? "0" : "1" } });
16799              this.writeNode("ows:Title", a.name, b);
16800              this.writeNode("InlineGeometry", a, b);
16801              return b;
16802          },
16803          _GML: function (a) {
16804              var b = this.createElementNSPlus("Layer");
16805              this.writeNode("ows:Title", a.name, b);
16806              this.writeNode("Server", { service: OpenLayers.Format.Context.serviceTypes.GML, url: a.protocol.url, version: a.protocol.format.version }, b);
16807              return b;
16808          },
16809          _KML: function (a) {
16810              var b = this.createElementNSPlus("Layer");
16811              this.writeNode("ows:Title", a.name, b);
16812              this.writeNode("Server", { service: OpenLayers.Format.Context.serviceTypes.KML, version: a.protocol.format.version, url: a.protocol.url }, b);
16813              return b;
16814          },
16815      },
16816      gml: OpenLayers.Util.applyDefaults(
16817          {
16818              boundedBy: function (a) {
16819                  var b = this.createElementNSPlus("gml:boundedBy");
16820                  this.writeNode("gml:Box", a, b);
16821                  return b;
16822              },
16823          },
16824          OpenLayers.Format.GML.v2.prototype.writers.gml
16825      ),
16826      ows: OpenLayers.Format.OWSCommon.v1_0_0.prototype.writers.ows,
16827      sld: OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld,
16828      feature: OpenLayers.Format.GML.v2.prototype.writers.feature,
16829  },
16830  CLASS_NAME: "OpenLayers.Format.OWSContext.v0_3_1",
16831});
16832OpenLayers.Popup = OpenLayers.Class({
16833  events: null,
16834  id: "",
16835  lonlat: null,
16836  div: null,
16837  contentSize: null,
16838  size: null,
16839  contentHTML: null,
16840  backgroundColor: "",
16841  opacity: "",
16842  border: "",
16843  contentDiv: null,
16844  groupDiv: null,
16845  closeDiv: null,
16846  autoSize: !1,
16847  minSize: null,
16848  maxSize: null,
16849  displayClass: "olPopup",
16850  contentDisplayClass: "olPopupContent",
16851  padding: 0,
16852  disableFirefoxOverflowHack: !1,
16853  fixPadding: function () {
16854      "number" == typeof this.padding && (this.padding = new OpenLayers.Bounds(this.padding, this.padding, this.padding, this.padding));
16855  },
16856  panMapIfOutOfView: !1,
16857  keepInMap: !1,
16858  closeOnMove: !1,
16859  map: null,
16860  initialize: function (a, b, c, d, e, f) {
16861      null == a && (a = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"));
16862      this.id = a;
16863      this.lonlat = b;
16864      this.contentSize = null != c ? c : new OpenLayers.Size(OpenLayers.Popup.WIDTH, OpenLayers.Popup.HEIGHT);
16865      null != d && (this.contentHTML = d);
16866      this.backgroundColor = OpenLayers.Popup.COLOR;
16867      this.opacity = OpenLayers.Popup.OPACITY;
16868      this.border = OpenLayers.Popup.BORDER;
16869      this.div = OpenLayers.Util.createDiv(this.id, null, null, null, null, null, "hidden");
16870      this.div.className = this.displayClass;
16871      this.groupDiv = OpenLayers.Util.createDiv(this.id + "_GroupDiv", null, null, null, "relative", null, "hidden");
16872      a = this.div.id + "_contentDiv";
16873      this.contentDiv = OpenLayers.Util.createDiv(a, null, this.contentSize.clone(), null, "relative");
16874      this.contentDiv.className = this.contentDisplayClass;
16875      this.groupDiv.appendChild(this.contentDiv);
16876      this.div.appendChild(this.groupDiv);
16877      e && this.addCloseBox(f);
16878      this.registerEvents();
16879  },
16880  destroy: function () {
16881      this.border = this.opacity = this.backgroundColor = this.contentHTML 
16881= this.size = this.lonlat = this.id = null;
16882      this.closeOnMove && this.map && this.map.events.unregister("movestart", this, this.hide);
16883      this.events.destroy();
16884      this.events = null;
16885      this.closeDiv && (OpenLayers.Event.stopObservingElement(this.closeDiv), this.groupDiv.removeChild(this.closeDiv));
16886      this.closeDiv = null;
16887      this.div.removeChild(this.groupDiv);
16888      this.groupDiv = null;
16889      null != this.map && this.map.removePopup(this);
16890      this.panMapIfOutOfView = this.padding = this.maxSize = this.minSize = this.autoSize = this.div = this.map = null;
16891  },
16892  draw: function (a) {
16893      null == a && null != this.lonlat && null != this.map && (a = this.map.getLayerPxFromLonLat(this.lonlat));
16894      this.closeOnMove && this.map.events.register("movestart", this, this.hide);
16895      this.disableFirefoxOverflowHack ||
16896          "firefox" != OpenLayers.BROWSER_NAME ||
16897          (this.map.events.register("movestart", this, function () {
16898              var a = document.defaultView.getComputedStyle(this.contentDiv, null).getPropertyValue("overflow");
16899              "hidden" != a && ((this.contentDiv._oldOverflow = a), (this.contentDiv.style.overflow = "hidden"));
16900          }),
16901          this.map.events.register("moveend", this, function () {
16902              var a = this.contentDiv._oldOverflow;
16903              a && ((this.contentDiv.style.overflow = a), (this.contentDiv._oldOverflow = null));
16904          }));
16905      this.moveTo(a);
16906      this.autoSize || this.size || this.setSize(this.contentSize);
16907      this.setBackgroundColor();
16908      this.setOpacity();
16909      this.setBorder();
16910      this.setContentHTML();
16911      this.panMapIfOutOfView && this.panIntoView();
16912      return this.div;
16913  },
16914  updatePosition: function () {
16915      if (this.lonlat && this.map) {
16916          var a = this.map.getLayerPxFromLonLat(this.lonlat);
16917          a && this.moveTo(a);
16918      }
16919  },
16920  moveTo: function (a) {
16921      null != a && null != this.div && ((this.div.style.left = a.x + "px"), (this.div.style.top = a.y + "px"));
16922  },
16923  visible: function () {
16924      return OpenLayers.Element.visible(this.div);
16925  },
16926  toggle: function () {
16927      this.visible() ? this.hide() : this.show();
16928  },
16929  show: function () {
16930      this.div.style.display = "";
16931      this.panMapIfOutOfView && this.panIntoView();
16932  },
16933  hide: function () {
16934      this.div.style.display = "none";
16935  },
16936  setSize: function (a) {
16937      this.size = a.clone();
16938      var b = this.getContentDivPadding(),
16939          c = b.left + b.right,
16940          d = b.top + b.bottom;
16941      this.fixPadding();
16942      c += this.padding.left + this.padding.right;
16943      d += this.padding.top + this.padding.bottom;
16944      if (this.closeDiv)
16945          var e = parseInt(this.closeDiv.style.width),
16946              c = c + (e + b.right);
16947      this.size.w += c;
16948      this.size.h += d;
16949      "msie" == OpenLayers.BROWSER_NAME && ((this.contentSize.w += b.left + b.right), (this.contentSize.h += b.bottom + b.top));
16950      null != this.div && ((this.div.style.width = this.size.w + "px"), (this.div.style.height = this.size.h + "px"));
16951      null != this.contentDiv && ((this.contentDiv.style.width = a.w + "px"), (this.contentDiv.style.height = a.h + "px"));
16952  },
16953  updateSize: function () {
16954      var a = "<div class='" + this.contentDisplayClass + "'>" + this.contentDiv.innerHTML + "</div>",
16955          b = this.map ? this.map.div : document.body,
16956          c = OpenLayers.Util.getRenderedDimensions(a, null, { displayClass: this.displayClass, containerElement: b }),
16957          d = this.getSafeContentSize(c),
16958          e = null;
16959      d.equals(c)
16960          ? (e = c)
16961          : ((c = { w: d.w < c.w ? d.w : null, h: d.h < c.h ? d.h : null }),
16962            c.w && c.h
16963                ? (e = d)
16964                : ((a = OpenLayers.Util.getRenderedDimensions(a, c, { displayClass: this.contentDisplayClass, containerElement: b })),
16965                  "hidden" != OpenLayers.Element.getStyle(this.contentDiv, "overflow") && a.equals(d) && ((d = OpenLayers.Util.getScrollbarWidth()), c.w ? (a.h += d) : (a.w += d)),
16966                  (e = this.getSafeContentSize(a))));
16967      this.setSize(e);
16968  },
16969  setBackgroundColor: function (a) {
16970      void 0 != a && (this.backgroundColor = a);
16971      null != this.div && (this.div.style.backgroundColor = this.backgroundColor);
16972  },
16973  setOpacity: function (a) {
16974      void 0 != a && (this.opacity = a);
16975      null != this.div && ((this.div.style.opacity = this.opacity), (this.div.style.filter = "alpha(opacity=" + 100 * this.opacity + ")"));
16976  },
16977  setBorder: function (a) {
16978      void 0 != a && (this.border = a);
16979      null != this.div && (this.div.style.border = this.border);
16980  },
16981  setContentHTML: function (a) {
16982      null != a && (this.contentHTML = a);
16983      null != this.contentDiv && null != this.contentHTML && this.contentHTML != this.contentDiv.innerHTML && ((this.contentDiv.innerHTML = this.contentHTML), this.autoSize && (this.registerImageListeners(), this.updateSize()));
16984  },
16985  registerImageListeners: function () {
16986      for (
16987          var a = function () {
16988                  null !== this.popup.id && (this.popup.updateSize(), this.popup.visible() && this.popup.panMapIfOutOfView && this.popup.panIntoView(), OpenLayers.Event.stopObserving(this.img, "load", this.img._onImgLoad));
16989              },
16990              b = this.contentDiv.getElementsByTagName("img"),
16991              c = 0,
16992              d = b.length;
16993          c < d;
16994          c++
16995      ) {
16996          var e = b[c];
16997          if (0 == e.width || 0 == e.height) (e._onImgLoad = OpenLayers.Function.bind(a, { popup: this, img: e })), OpenLayers.Event.observe(e, "load", e._onImgLoad);
16998      }
16999  },
17000  getSafeContentSize: function (a) {
17001      a = a.clone();
17002      var b = this.getContentDivPadding(),
17003          c = b.left + b.right,
17004          d = b.top + b.bottom;
17005      this.fixPadding();
17006      c += this.padding.left + this.padding.right;
17007      d += this.padding.top + this.padding.bottom;
17008      if (this.closeDiv)
17009          var e = parseInt(this.closeDiv.style.width),
17010              c = c + (e + b.right);
17011      this.minSize && ((a.w = Math.max(a.w, this.minSize.w - c)), (a.h = Math.max(a.h, this.minSize.h - d)));
17012      this.maxSize && ((a.w = Math.min(a.w, this.maxSize.w - c)), (a.h = Math.min(a.h, this.maxSize.h - d)));
17013      if (this.map && this.map.size) {
17014          e = b = 0;
17015          if (this.keepInMap && !this.panMapIfOutOfView)
17016              switch (((e = this.map.getPixelFromLonLat(this.lonlat)), this.relativePosition)) {
17017                  case "tr":
17018                      b = e.x;
17019                      e = this.map.size.h - e.y;
17020                      break;
17021                  case "tl":
17022                      b = this.map.size.w - e.x;
17023                      e = this.map.size.h - e.y;
17024                      break;
17025                  case "bl":
17026                      b = this.map.size.w - e.x;
17027                      e = e.y;
17028                      break;
17029                  case "br":
17030                      b = e.x;
17031                      e = e.y;
17032                      break;
17033                  default:
17034                      (b = e.x), (e = this.map.size.h - e.y);
17035              }
17036          d = this.map.size.h - this.map.paddingForPopups.top - this.map.paddingForPopups.bottom - d - e;
17037          a.w = Math.min(a.w, this.map.size.w - this.map.paddingForPopups.left - this.map.paddingForPopups.right - c - b);
17038          a.h = Math.min(a.h, d);
17039      }
17040      return a;
17041  },
17042  getContentDivPadding: function () {
17043      var a = this._contentDivPadding;
17044      a ||
17045          (null == this.div.parentNode && ((this.div.style.display = "none"), document.body.appendChild(this.div)),
17046          (this._contentDivPadding = a = new OpenLayers.Bounds(
17047              OpenLayers.Element.getStyle(this.contentDiv, "padding-left"),
17048              OpenLayers.Element.getStyle(this.contentDiv, "padding-bottom"),
17049              OpenLayers.Element.getStyle(this.contentDiv, "padding-right"),
17050              OpenLayers.Element.getStyle(this.contentDiv, "padding-top")
17051          )),
17052          this.div.parentNode == document.body && (document.body.removeChild(this.div), (this.div.style.display = "")));
17053      return a;
17054  },
17055  addCloseBox: function (a) {
17056      this.closeDiv = OpenLayers.Util.createDiv(this.id + "_close", null, { w: 17, h: 17 });
17057      this.closeDiv.className = "olPopupCloseBox";
17058      var b = this.getContentDivPadding();
17059      this.closeDiv.style.right = b.right + "px";
17060      this.closeDiv.style.top = b.top + "px";
17061      this.groupDiv.appendChild(this.closeDiv);
17062      a =
17063          a ||
17064          function (a) {
17065              this.hide();
17066              OpenLayers.Event.stop(a);
17067          };
17068      OpenLayers.Event.observe(this.closeDiv, "touchend", OpenLayers.Function.bindAsEventListener(a, this));
17069      OpenLayers.Event.observe(this.closeDiv, "click", OpenLayers.Function.bindAsEventListener(a, this));
17070  },
17071  panIntoView: function () {
17072      var a = this.map.getSize(),
17073          b = this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left), parseInt(this.div.style.top))),
17074          c = b.clone();
17075      b.x < this.map.paddingForPopups.left ? (c.x = this.map.paddingForPopups.left) : b.x + this.size.w > a.w - this.map.paddingForPopups.right && (c.x = a.w - this.map.paddingForPopups.right - this.size.w);
17076      b.y < this.map.paddingForPopups.top ? (c.y = this.map.paddingForPopups.top) : b.y + this.size.h > a.h - this.map.paddingForPopups.bottom && (c.y = a.h - this.map.paddingForPopups.bottom - this.size.h);
17077      this.map.pan(b.x - c.x, b.y - c.y);
17078  },
17079  registerEvents: function () {
17080      this.events = new OpenLayers.Events(this, this.div, null, !0);
17081      this.events.on({
17082          mousedown: this.onmousedown,
17083          mousemove: this.onmousemove,
17084          mouseup: this.onmouseup,
17085          click: this.onclick,
17086          mouseout: this.onmouseout,
17087          dblclick: this.ondblclick,
17088          touchstart: function (a) {
17089              OpenLayers.Event.stop(a, !0);
17090          },
17091          scope: this,
17092      });
17093  },
17094  onmousedown: function (a) {
17095      this.mousedown = !0;
17096      OpenLayers.Event.stop(a, !0);
17097  },
17098  onmousemove: function (a) {
17099      this.mousedown && OpenLayers.Event.stop(a, !0);
17100  },
17101  onmouseup: function (a) {
17102      this.mousedown && ((this.mousedown = !1), OpenLayers.Event.stop(a, !0));
17103  },
17104  onclick: function (a) {
17105      OpenLayers.Event.stop(a, !0);
17106  },
17107  onmouseout: function (a) {
17108      this.mousedown = !1;
17109  },
17110  ondblclick: function (a) {
17111      OpenLayers.Event.stop(a, !0);
17112  },
17113  CLASS_NAME: "OpenLayers.Popup",
17114});
17115OpenLayers.Popup.WIDTH = 200;
17116OpenLayers.Popup.HEIGHT = 200;
17117OpenLayers.Popup.COLOR = "white";
17118OpenLayers.Popup.OPACITY = 1;
17119OpenLayers.Popup.BORDER = "0px";
17120OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
17121  maxWidth: 100,
17122  topOutUnits: "km",
17123  topInUnits: "m",
17124  bottomOutUnits: "mi",
17125  bottomInUnits: "ft",
17126  eTop: null,
17127  eBottom: null,
17128  geodesic: !1,
17129  draw: function () {
17130      OpenLayers.Control.prototype.draw.apply(this, arguments);
17131      this.eTop ||
17132          ((this.eTop = document.createElement("div")),
17133          (this.eTop.className = this.displayClass + "Top"),
17134          this.div.appendChild(this.eTop),
17135          (this.eTop.style.visibility = "" == this.topOutUnits || "" == this.topInUnits ? "hidden" : "visible"),
17136          (this.eBottom = document.createElement("div")),
17137          (this.eBottom.className = this.displayClass + "Bottom"),
17138          this.div.appendChild(this.eBottom),
17139          (this.eBottom.style.visibility = "" == this.bottomOutUnits || "" == this.bottomInUnits ? "hidden" : "visible"));
17140      this.map.events.register("moveend", this, this.update);
17141      this.update();
17142      return this.div;
17143  },
17144  getBarLen: function (a) {
17145      var b = parseInt(Math.log(a) / Math.log(10)),
17146          b = Math.pow(10, b);
17147      a = parseInt(a / b);
17148      return (5 < a ? 5 : 2 < a ? 2 : 1) * b;
17149  },
17150  update: function () {
17151      var a = this.map.getResolution();
17152      if (a) {
17153          var b = this.map.getUnits(),
17154              c = OpenLayers.INCHES_PER_UNIT,
17155              d = this.maxWidth * a * c[b],
17156              e = 1;
17157          !0 === this.geodesic && ((e = ((this.map.getGeodesicPixelSize().w || 1e-6) * this.maxWidth) / (d / c.km)), (d *= e));
17158          var f, g;
17159          1e5 < d ? ((f = this.topOutUnits), (g = this.bottomOutUnits)) : ((f = this.topInUnits), (g = this.bottomInUnits));
17160          var h = d / c[f],
17161              k = d / c[g],
17162              d = this.getBarLen(h),
17163              l = this.getBarLen(k),
17164              h = (d / c[b]) * c[f],
17165              k = (l / c[b]) * c[g],
17166              b = h / a / e,
17167              a = k / a / e;
17168          "visible" == this.eBottom.style.visibility && ((this.eBottom.style.width = Math.round(a) + "px"), (this.eBottom.innerHTML = l + " " + g));
17169          "visible" == this.eTop.style.visibility && ((this.eTop.style.width = Math.round(b) + "px"), (this.eTop.innerHTML = d + " " + f));
17170      }
17171  },
17172  CLASS_NAME: "OpenLayers.Control.ScaleLine",
17173});
17174OpenLayers.Icon = OpenLayers.Class({
17175  url: null,
17176  size: null,
17177  offset: null,
17178  calculateOffset: null,
17179  imageDiv: null,
17180  px: null,
17181  initialize: function (a, b, c, d) {
17182      this.url = a;
17183      this.size = b || { w: 20, h: 20 };
17184      this.offset = c || { x: -(this.size.w / 2), y: -(this.size.h / 2) };
17185      this.calculateOffset = d;
17186      a = OpenLayers.Util.createUniqueID("OL_Icon_");
17187      this.imageDiv = OpenLayers.Util.createAlphaImageDiv(a);
17188  },
17189  destroy: function () {
17190      this.erase();
17191      OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);
17192      this.imageDiv.innerHTML = "";
17193      this.imageDiv = null;
17194  },
17195  clone: function () {
17196      return new OpenLayers.Icon(this.url, this.size, this.offset, this.calculateOffset);
17197  },
17198  setSize: function (a) {
17199      null != a && (this.size = a);
17200      this.draw();
17201  },
17202  setUrl: function (a) {
17203      null != a && (this.url = a);
17204      this.draw();
17205  },
17206  draw: function (a) {
17207      OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv, null, null, this.size, this.url, "absolute");
17208      this.moveTo(a);
17209      return this.imageDiv;
17210  },
17211  erase: function () {
17212      null != this.imageDiv && null != this.imageDiv.parentNode && OpenLayers.Element.remove(this.imageDiv);
17213  },
17214  setOpacity: function (a) {
17215      OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv, null, null, null, null, null, null, null, a);
17216  },
17217  moveTo: function (a) {
17218      null != a && (this.px = a);
17219      null != this.imageDiv &&
17220          (null == this.px
17221              ? this.display(!1)
17222              : (this.calculateOffset && (this.offset = this.calculateOffset(this.size)), OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv, null, { x: this.px.x + this.offset.x, y: this.px.y + this.offset.y })));
17223  },
17224  display: function (a) {
17225      this.imageDiv.style.display = a ? "" : "none";
17226  },
17227  isDrawn: function () {
17228      return this.imageDiv && this.imageDiv.parentNode && 11 != this.imageDiv.parentNode.nodeType;
17229  },
17230  CLASS_NAME: "OpenLayers.Icon",
17231});
17232OpenLayers.Marker = OpenLayers.Class({
17233  icon: null,
17234  lonlat: null,
17235  events: null,
17236  map: null,
17237  initialize: function (a, b) {
17238      this.lonlat = a;
17239      var c = b ? b : OpenLayers.Marker.defaultIcon();
17240      null == this.icon ? (this.icon = c) : ((this.icon.url = c.url), (this.icon.size = c.size), (this.icon.offset = c.offset), (this.icon.calculateOffset = c.calculateOffset));
17241      this.events = new OpenLayers.Events(this, this.icon.imageDiv);
17242  },
17243  destroy: function () {
17244      this.erase();
17245      this.map = null;
17246      this.events.destroy();
17247      this.events = null;
17248      null != this.icon && (this.icon.destroy(), (this.icon = null));
17249  },
17250  draw: function (a) {
17251      return this.icon.draw(a);
17252  },
17253  erase: function () {
17254      null != this.icon && this.icon.erase();
17255  },
17256  moveTo: function (a) {
17257      null != a && null != this.icon && this.icon.moveTo(a);
17258      this.lonlat = this.map.getLonLatFromLayerPx(a);
17259  },
17260  isDrawn: function () {
17261      return this.icon && this.icon.isDrawn();
17262  },
17263  onScreen: function () {
17264      var a = !1;
17265      this.map && (a = this.map.getExtent().containsLonLat(this.lonlat));
17266      return a;
17267  },
17268  inflate: function (a) {
17269      this.icon && this.icon.setSize({ w: this.icon.size.w * a, h: this.icon.size.h * a });
17270  },
17271  setOpacity: function (a) {
17272      this.icon.setOpacity(a);
17273  },
17274  setUrl: function (a) {
17275      this.icon.setUrl(a);
17276  },
17277  display: function (a) {
17278      this.icon.display(a);
17279  },
17280  CLASS_NAME: "OpenLayers.Marker",
17281});
17282OpenLayers.Marker.defaultIcon = function () {
17283  return new OpenLayers.Icon(OpenLayers.Util.getImageLocation("marker.png"), { w: 21, h: 25 }, { x: -10.5, y: -25 });
17284};
17285OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, {
17286  isBaseLayer: !0,
17287  format: "image/png",
17288  serverResolutions: null,
17289  initialize: function (a, b, c, d) {
17290      this.layername = c;
17291      OpenLayers.Layer.Grid.prototype.initialize.apply(this, [a, b, {}, d]);
17292      this.extension = this.format.split("/")[1].toLowerCase();
17293      this.extension = "jpg" == this.extension ? "jpeg" : this.extension;
17294  },
17295  clone: function (a) {
17296      null == a && (a = new OpenLayers.Layer.TileCache(this.name, this.url, this.layername, this.getOptions()));
17297      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
17298  },
17299  getURL: function (a) {
17300      var b = this.getServerResolution(),
17301          c = this.maxExtent,
17302          d = this.tileSize,
17303          e = Math.round((a.left - c.left) / (b * d.w));
17304      a = Math.round((a.bottom - c.bottom) / (b * d.h));
17305      b = null != this.serverResolutions ? OpenLayers.Util.indexOf(this.serverResolutions, b) : this.map.getZoom();
17306      e = [
17307          this.layername,
17308          OpenLayers.Number.zeroPad(b, 2),
17309          OpenLayers.Number.zeroPad(parseInt(e / 1e6), 3),
17310          OpenLayers.Number.zeroPad(parseInt(e / 1e3) % 1e3, 3),
17311          OpenLayers.Number.zeroPad(parseInt(e) % 1e3, 3),
17312          OpenLayers.Number.zeroPad(parseInt(a / 1e6), 3),
17313          OpenLayers.Number.zeroPad(parseInt(a / 1e3) % 1e3, 3),
17314          OpenLayers.Number.zeroPad(parseInt(a) % 1e3, 3) + "." + this.extension,
17315      ].join("/");
17316      b = this.url;
17317      OpenLayers.Util.isArray(b) && (b = this.selectUrl(e, b));
17318      b = "/" == b.charAt(b.length - 1) ? b : b + "/";
17319      return b + e;
17320  },
17321  CLASS_NAME: "OpenLayers.Layer.TileCache",
17322});
17323OpenLayers.Strategy.Paging = OpenLayers.Class(OpenLayers.Strategy, {
17324  features: null,
17325  length: 10,
17326  num: null,
17327  paging: !1,
17328  activate: function () {
17329      var a = OpenLayers.Strategy.prototype.activate.call(this);
17330      if (a) this.layer.events.on({ beforefeaturesadded: this.cacheFeatures, scope: this });
17331      return a;
17332  },
17333  deactivate: function () {
17334      var a = OpenLayers.Strategy.prototype.deactivate.call(this);
17335      a && (this.clearCache(), this.layer.events.un({ beforefeaturesadded: this.cacheFeatures, scope: this }));
17336      return a;
17337  },
17338  cacheFeatures: function (a) {
17339      this.paging || (this.clearCache(), (this.features = a.features), this.pageNext(a));
17340  },
17341  clearCache: function () {
17342      if (this.features) for (var a = 0; a < this.features.length; ++a) this.features[a].destroy();
17343      this.num = this.features = null;
17344  },
17345  pageCount: function () {
17346      return Math.ceil((this.features ? this.features.length : 0) / this.length);
17347  },
17348  pageNum: function () {
17349      return this.num;
17350  },
17351  pageLength: function (a) {
17352      a && 0 < a && (this.length = a);
17353      return this.length;
17354  },
17355  pageNext: function (a) {
17356      var b = !1;
17357      this.features && (null === this.num && (this.num = -1), (b = this.page((this.num + 1) * this.length, a)));
17358      return b;
17359  },
17360  pagePrevious: function () {
17361      var a = !1;
17362      this.features && (null === this.num && (this.num = this.pageCount()), (a = this.page((this.num - 1) * this.length)));
17363      return a;
17364  },
17365  page: function (a, b) {
17366      var c = !1;
17367      if (this.features && 0 <= a && a < this.features.length) {
17368          var d = Math.floor(a / this.length);
17369          d != this.num &&
17370              ((this.paging = !0),
17371              (c = this.features.slice(a, a + this.length)),
17372              this.layer.removeFeatures(this.layer.features),
17373              (this.num = d),
17374              b && b.features ? (b.features = c) : this.layer.addFeatures(c),
17375              (this.paging = !1),
17376              (c = !0));
17377      }
17378      return c;
17379  },
17380  CLASS_NAME: "OpenLayers.Strategy.Paging",
17381});
17382OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
17383  geometryTypes: null,
17384  onStart: function (a, b) {},
17385  onDrag: function (a, b) {},
17386  onComplete: function (a, b) {},
17387  onEnter: function (a) {},
17388  onLeave: function (a) {},
17389  documentDrag: !1,
17390  layer: null,
17391  feature: null,
17392  dragCallbacks: {},
17393  featureCallbacks: {},
17394  lastPixel: null,
17395  initialize: function (a, b) {
17396      OpenLayers.Control.prototype.initialize.apply(this, [b]);
17397      this.layer = a;
17398      this.handlers = {
17399          drag: new OpenLayers.Handler.Drag(this, OpenLayers.Util.extend({ down: this.downFeature, move: this.moveFeature, up: this.upFeature, out: this.cancel, done: this.doneDragging }, this.dragCallbacks), {
17400              documentDrag: this.documentDrag,
17401          }),
17402          feature: new OpenLayers.Handler.Feature(this, this.layer, OpenLayers.Util.extend({ click: this.clickFeature, clickout: this.clickoutFeature, over: this.overFeature, out: this.outFeature }, this.featureCallbacks), {
17403              geometryTypes: this.geometryTypes,
17404          }),
17405      };
17406  },
17407  clickFeature: function (a) {
17408      this.handlers.feature.touch && !this.over && this.overFeature(a) && (this.handlers.drag.dragstart(this.handlers.feature.evt), (this.handlers.drag.stopDown = !1));
17409  },
17410  clickoutFeature: function (a) {
17411      this.handlers.feature.touch && this.over && (this.outFeature(a), (this.handlers.drag.stopDown = !0));
17412  },
17413  destroy: function () {
17414      this.layer = null;
17415      OpenLayers.Control.prototype.destroy.apply(this, []);
17416  },
17417  activate: function () {
17418      return this.handlers.feature.activate() && OpenLayers.Control.prototype.activate.apply(this, arguments);
17419  },
17420  deactivate: function () {
17421      this.handlers.drag.deactivate();
17422      this.handlers.feature.deactivate();
17423      this.feature = null;
17424      this.dragging = !1;
17425      this.lastPixel = null;
17426      OpenLayers.Element.removeClass(this.map.viewPortDiv, this.displayClass + "Over");
17427      return OpenLayers.Control.prototype.deactivate.apply(this, arguments);
17428  },
17429  overFeature: function (a) {
17430      var b = !1;
17431      this.handlers.drag.dragging
17432          ? (this.over = this.feature.id == a.id ? !0 : !1)
17433          : ((this.feature = a), this.handlers.drag.activate(), (this.over = b = !0), OpenLayers.Element.addClass(this.map.viewPortDiv, this.displayClass + "Over"), this.onEnter(a
17433));
17434      return b;
17435  },
17436  downFeature: function (a) {
17437      this.lastPixel = a;
17438      this.onStart(this.feature, a);
17439  },
17440  moveFeature: function (a) {
17441      var b = this.map.getResolution();
17442      this.feature.geometry.move(b * (a.x - this.lastPixel.x), b * (this.lastPixel.y - a.y));
17443      this.layer.drawFeature(this.feature);
17444      this.lastPixel = a;
17445      this.onDrag(this.feature, a);
17446  },
17447  upFeature: function (a) {
17448      this.over || this.handlers.drag.deactivate();
17449  },
17450  doneDragging: function (a) {
17451      this.onComplete(this.feature, a);
17452  },
17453  outFeature: function (a) {
17454      this.handlers.drag.dragging
17455          ? this.feature.id == a.id && (this.over = !1)
17456          : ((this.over = !1), this.handlers.drag.deactivate(), OpenLayers.Element.removeClass(this.map.viewPortDiv, this.displayClass + "Over"), this.onLeave(a), (this.feature = null));
17457  },
17458  cancel: function () {
17459      this.handlers.drag.deactivate();
17460      this.over = !1;
17461  },
17462  setMap: function (a) {
17463      this.handlers.drag.setMap(a);
17464      this.handlers.feature.setMap(a);
17465      OpenLayers.Control.prototype.setMap.apply(this, arguments);
17466  },
17467  CLASS_NAME: "OpenLayers.Control.DragFeature",
17468});
17469OpenLayers.Control.TransformFeature = OpenLayers.Class(OpenLayers.Control, {
17470  geometryTypes: null,
17471  layer: null,
17472  preserveAspectRatio: !1,
17473  rotate: !0,
17474  feature: null,
17475  renderIntent: "temporary",
17476  rotationHandleSymbolizer: null,
17477  box: null,
17478  center: null,
17479  scale: 1,
17480  ratio: 1,
17481  rotation: 0,
17482  handles: null,
17483  rotationHandles: null,
17484  dragControl: null,
17485  irregular: !1,
17486  initialize: function (a, b) {
17487      OpenLayers.Control.prototype.initialize.apply(this, [b]);
17488      this.layer = a;
17489      this.rotationHandleSymbolizer || (this.rotationHandleSymbolizer = { stroke: !1, pointRadius: 10, fillOpacity: 0, cursor: "pointer" });
17490      this.createBox();
17491      this.createControl();
17492  },
17493  activate: function () {
17494      var a = !1;
17495      OpenLayers.Control.prototype.activate.apply(this, arguments) &&
17496          (this.dragControl.activate(), this.layer.addFeatures([this.box]), this.rotate && this.layer.addFeatures(this.rotationHandles), this.layer.addFeatures(this.handles), (a = !0));
17497      return a;
17498  },
17499  deactivate: function () {
17500      var a = !1;
17501      OpenLayers.Control.prototype.deactivate.apply(this, arguments) &&
17502          (this.layer.removeFeatures(this.handles), this.rotate && this.layer.removeFeatures(this.rotationHandles), this.layer.removeFeatures([this.box]), this.dragControl.deactivate(), (a = !0));
17503      return a;
17504  },
17505  setMap: function (a) {
17506      this.dragControl.setMap(a);
17507      OpenLayers.Control.prototype.setMap.apply(this, arguments);
17508  },
17509  setFeature: function (a, b) {
17510      b = OpenLayers.Util.applyDefaults(b, { rotation: 0, scale: 1, ratio: 1 });
17511      var c = this.rotation,
17512          d = this.center;
17513      OpenLayers.Util.extend(this, b);
17514      if (!1 !== this.events.triggerEvent("beforesetfeature", { feature: a })) {
17515          this.feature = a;
17516          this.activate();
17517          this._setfeature = !0;
17518          var e = this.feature.geometry.getBounds();
17519          this.box.move(e.getCenterLonLat());
17520          this.box.geometry.rotate(-c, d);
17521          this._angle = 0;
17522          this.rotation
17523              ? ((c = a.geometry.clone()),
17524                c.rotate(-this.rotation, this.center),
17525                (c = new OpenLayers.Feature.Vector(c.getBounds().toGeometry())),
17526                c.geometry.rotate(this.rotation, this.center),
17527                this.box.geometry.rotate(this.rotation, this.center),
17528                this.box.move(c.geometry.getBounds().getCenterLonLat()),
17529                (c = c.geometry.components[0].components[0].getBounds().getCenterLonLat()))
17530              : (c = new OpenLayers.LonLat(e.left, e.bottom));
17531          this.handles[0].move(c);
17532          delete this._setfeature;
17533          this.events.triggerEvent("setfeature", { feature: a });
17534      }
17535  },
17536  unsetFeature: function () {
17537      this.active ? this.deactivate() : ((this.feature = null), (this.rotation = 0), (this.ratio = this.scale = 1));
17538  },
17539  createBox: function () {
17540      var a = this;
17541      this.center = new OpenLayers.Geometry.Point(0, 0);
17542      this.box = new OpenLayers.Feature.Vector(
17543          new OpenLayers.Geometry.LineString([
17544              new OpenLayers.Geometry.Point(-1, -1),
17545              new OpenLayers.Geometry.Point(0, -1),
17546              new OpenLayers.Geometry.Point(1, -1),
17547              new OpenLayers.Geometry.Point(1, 0),
17548              new OpenLayers.Geometry.Point(1, 1),
17549              new OpenLayers.Geometry.Point(0, 1),
17550              new OpenLayers.Geometry.Point(-1, 1),
17551              new OpenLayers.Geometry.Point(-1, 0),
17552              new OpenLayers.Geometry.Point(-1, -1),
17553          ]),
17554          null,
17555          "string" == typeof this.renderIntent ? null : this.renderIntent
17556      );
17557      this.box.geometry.move = function (b, c) {
17558          a._moving = !0;
17559          OpenLayers.Geometry.LineString.prototype.move.apply(this, arguments);
17560          a.center.move(b, c);
17561          delete a._moving;
17562      };
17563      for (
17564          var b = function (a, b) {
17565                  OpenLayers.Geometry.Point.prototype.move.apply(this, arguments);
17566                  this._rotationHandle && this._rotationHandle.geometry.move(a, b);
17567                  this._handle.geometry.move(a, b);
17568              },
17569              c = function (a, b, c) {
17570                  OpenLayers.Geometry.Point.prototype.resize.apply(this, arguments);
17571                  this._rotationHandle && this._rotationHandle.geometry.resize(a, b, c);
17572                  this._handle.geometry.resize(a, b, c);
17573              },
17574              d = function (a, b) {
17575                  OpenLayers.Geometry.Point.prototype.rotate.apply(this, arguments);
17576                  this._rotationHandle && this._rotationHandle.geometry.rotate(a, b);
17577                  this._handle.geometry.rotate(a, b);
17578              },
17579              e = function (b, c) {
17580                  var d = this.x,
17581                      e = this.y;
17582                  OpenLayers.Geometry.Point.prototype.move.call(this, b, c);
17583                  if (!a._moving) {
17584                      var f = a.dragControl.handlers.drag.evt,
17585                          g = !(!a._setfeature && a.preserveAspectRatio) && !(f && f.shiftKey),
17586                          h = new OpenLayers.Geometry.Point(d, e),
17587                          f = a.center;
17588                      this.rotate(-a.rotation, f);
17589                      h.rotate(-a.rotation, f);
17590                      var k = this.x - f.x,
17591                          l = this.y - f.y,
17592                          m = k - (this.x - h.x),
17593                          n = l - (this.y - h.y);
17594                      a.irregular && !a._setfeature && ((k -= (this.x - h.x) / 2), (l -= (this.y - h.y) / 2));
17595                      this.x = d;
17596                      this.y = e;
17597                      h = 1;
17598                      g ? ((l = 1e-5 > Math.abs(n) ? 1 : l / n), (h = (1e-5 > Math.abs(m) ? 1 : k / m) / l)) : ((m = Math.sqrt(m * m + n * n)), (l = Math.sqrt(k * k + l * l) / m));
17599                      a._moving = !0;
17600                      a.box.geometry.rotate(-a.rotation, f);
17601                      delete a._moving;
17602                      a.box.geometry.resize(l, f, h);
17603                      a.box.geometry.rotate(a.rotation, f);
17604                      a.transformFeature({ scale: l, ratio: h });
17605                      a.irregular &&
17606                          !a._setfeature &&
17607                          ((k = f.clone()), (k.x += 1e-5 > Math.abs(d - f.x) ? 0 : this.x - d), (k.y += 1e-5 > Math.abs(e - f.y) ? 0 : this.y - e), a.box.geometry.move(this.x - d, this.y - e), a.transformFeature({ center: k }));
17608                  }
17609              },
17610              f = function (b, c) {
17611                  var d = this.x,
17612                      e = this.y;
17613                  OpenLayers.Geometry.Point.prototype.move.call(this, b, c);
17614                  if (!a._moving) {
17615                      var f = a.dragControl.handlers.drag.evt,
17616                          f = f && f.shiftKey ? 45 : 1,
17617                          g = a.center,
17618                          h = this.x - g.x,
17619                          k = this.y - g.y;
17620                      this.x = d;
17621                      this.y = e;
17622                      d = Math.atan2(k - c, h - b);
17623                      d = Math.atan2(k, h) - d;
17624                      d *= 180 / Math.PI;
17625                      a._angle = (a._angle + d) % 360;
17626                      d = a.rotation % f;
17627                      if (Math.abs(a._angle) >= f || 0 !== d) (d = Math.round(a._angle / f) * f - d), (a._angle = 0), a.box.geometry.rotate(d, g), a.transformFeature({ rotation: d });
17628                  }
17629              },
17630              g = Array(8),
17631              h = Array(4),
17632              k,
17633              l,
17634              m,
17635              n = "sw s se e ne n nw w".split(" "),
17636              p = 0;
17637          8 > p;
17638          ++p
17639      )
17640          (k = this.box.geometry.components[p]),
17641              (l = new OpenLayers.Feature.Vector(k.clone(), { role: n[p] + "-resize" }, "string" == typeof this.renderIntent ? null : this.renderIntent)),
17642              0 == p % 2 &&
17643                  ((m = new OpenLayers.Feature.Vector(k.clone(), { role: n[p] + "-rotate" }, "string" == typeof this.rotationHandleSymbolizer ? null : this.rotationHandleSymbolizer)),
17644                  (m.geometry.move = f),
17645                  (k._rotationHandle = m),
17646                  (h[p / 2] = m)),
17647              (k.move = b),
17648              (k.resize = c),
17649              (k.rotate = d),
17650              (l.geometry.move = e),
17651              (k._handle = l),
17652              (g[p] = l);
17653      this.rotationHandles = h;
17654      this.handles = g;
17655  },
17656  createControl: function () {
17657      var a = this;
17658      this.dragControl = new OpenLayers.Control.DragFeature(this.layer, {
17659          documentDrag: !0,
17660          moveFeature: function (b) {
17661              this.feature === a.feature && (this.feature = a.box);
17662              OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this, arguments);
17663          },
17664          onDrag: function (b, c) {
17665              b === a.box && a.transformFeature({ center: a.center });
17666          },
17667          onStart: function (b, c) {
17668              var d = !a.geometryTypes || -1 !== OpenLayers.Util.indexOf(a.geometryTypes, b.geometry.CLASS_NAME),
17669                  e = OpenLayers.Util.indexOf(a.handles, b),
17670                  e = e + OpenLayers.Util.indexOf(a.rotationHandles, b);
17671              b !== a.feature && b !== a.box && -2 == e && d && a.setFeature(b);
17672          },
17673          onComplete: function (b, c) {
17674              a.events.triggerEvent("transformcomplete", { feature: a.feature });
17675          },
17676      });
17677  },
17678  drawHandles: function () {
17679      for (var a = this.layer, b = 0; 8 > b; ++b) this.rotate && 0 === b % 2 && a.drawFeature(this.rotationHandles[b / 2], this.rotationHandleSymbolizer), a.drawFeature(this.handles[b], this.renderIntent);
17680  },
17681  transformFeature: function (a) {
17682      if (!this._setfeature) {
17683          this.scale *= a.scale || 1;
17684          this.ratio *= a.ratio || 1;
17685          var b = this.rotation;
17686          this.rotation = (this.rotation + (a.rotation || 0)) % 360;
17687          if (!1 !== this.events.triggerEvent("beforetransform", a)) {
17688              var c = this.feature,
17689                  d = c.geometry,
17690                  e = this.center;
17691              d.rotate(-b, e);
17692              a.scale || a.ratio ? d.resize(a.scale, e, a.ratio) : a.center && c.move(a.center.getBounds().getCenterLonLat());
17693              d.rotate(this.rotation, e);
17694              this.layer.drawFeature(c);
17695              c.toState(OpenLayers.State.UPDATE);
17696              this.events.triggerEvent("transform", a);
17697          }
17698      }
17699      this.layer.drawFeature(this.box, this.renderIntent);
17700      this.drawHandles();
17701  },
17702  destroy: function () {
17703      for (var a, b = 0; 8 > b;
17703 ++b) (a = this.box.geometry.components[b]), a._handle.destroy(), (a._handle = null), a._rotationHandle && a._rotationHandle.destroy(), (a._rotationHandle = null);
17704      this.rotationHandles = this.rotationHandleSymbolizer = this.handles = this.feature = this.center = null;
17705      this.box.destroy();
17706      this.layer = this.box = null;
17707      this.dragControl.destroy();
17708      this.dragControl = null;
17709      OpenLayers.Control.prototype.destroy.apply(this, arguments);
17710  },
17711  CLASS_NAME: "OpenLayers.Control.TransformFeature",
17712});
17713OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, {
17714  dragHandler: null,
17715  boxDivClassName: "olHandlerBoxZoomBox",
17716  boxOffsets: null,
17717  initialize: function (a, b, c) {
17718      OpenLayers.Handler.prototype.initialize.apply(this, arguments);
17719      this.dragHandler = new OpenLayers.Handler.Drag(this, { down: this.startBox, move: this.moveBox, out: this.removeBox, up: this.endBox }, { keyMask: this.keyMask });
17720  },
17721  destroy: function () {
17722      OpenLayers.Handler.prototype.destroy.apply(this, arguments);
17723      this.dragHandler && (this.dragHandler.destroy(), (this.dragHandler = null));
17724  },
17725  setMap: function (a) {
17726      OpenLayers.Handler.prototype.setMap.apply(this, arguments);
17727      this.dragHandler && this.dragHandler.setMap(a);
17728  },
17729  startBox: function (a) {
17730      this.callback("start", []);
17731      this.zoomBox = OpenLayers.Util.createDiv("zoomBox", { x: -9999, y: -9999 });
17732      this.zoomBox.className = this.boxDivClassName;
17733      this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE.Popup - 1;
17734      this.map.viewPortDiv.appendChild(this.zoomBox);
17735      OpenLayers.Element.addClass(this.map.viewPortDiv, "olDrawBox");
17736  },
17737  moveBox: function (a) {
17738      var b = this.dragHandler.start.x,
17739          c = this.dragHandler.start.y,
17740          d = Math.abs(b - a.x),
17741          e = Math.abs(c - a.y),
17742          f = this.getBoxOffsets();
17743      this.zoomBox.style.width = d + f.width + 1 + "px";
17744      this.zoomBox.style.height = e + f.height + 1 + "px";
17745      this.zoomBox.style.left = (a.x < b ? b - d - f.left : b - f.left) + "px";
17746      this.zoomBox.style.top = (a.y < c ? c - e - f.top : c - f.top) + "px";
17747  },
17748  endBox: function (a) {
17749      var b;
17750      if (5 < Math.abs(this.dragHandler.start.x - a.x) || 5 < Math.abs(this.dragHandler.start.y - a.y)) {
17751          var c = this.dragHandler.start;
17752          b = Math.min(c.y, a.y);
17753          var d = Math.max(c.y, a.y),
17754              e = Math.min(c.x, a.x);
17755          a = Math.max(c.x, a.x);
17756          b = new OpenLayers.Bounds(e, d, a, b);
17757      } else b = this.dragHandler.start.clone();
17758      this.removeBox();
17759      this.callback("done", [b]);
17760  },
17761  removeBox: function () {
17762      this.map.viewPortDiv.removeChild(this.zoomBox);
17763      this.boxOffsets = this.zoomBox = null;
17764      OpenLayers.Element.removeClass(this.map.viewPortDiv, "olDrawBox");
17765  },
17766  activate: function () {
17767      return OpenLayers.Handler.prototype.activate.apply(this, arguments) ? (this.dragHandler.activate(), !0) : !1;
17768  },
17769  deactivate: function () {
17770      return OpenLayers.Handler.prototype.deactivate.apply(this, arguments) ? (this.dragHandler.deactivate() && this.zoomBox && this.removeBox(), !0) : !1;
17771  },
17772  getBoxOffsets: function () {
17773      if (!this.boxOffsets) {
17774          var a = document.createElement("div");
17775          a.style.position = "absolute";
17776          a.style.border = "1px solid black";
17777          a.style.width = "3px";
17778          document.body.appendChild(a);
17779          var b = 3 == a.clientWidth;
17780          document.body.removeChild(a);
17781          var a = parseInt(OpenLayers.Element.getStyle(this.zoomBox, "border-left-width")),
17782              c = parseInt(OpenLayers.Element.getStyle(this.zoomBox, "border-right-width")),
17783              d = parseInt(OpenLayers.Element.getStyle(this.zoomBox, "border-top-width")),
17784              e = parseInt(OpenLayers.Element.getStyle(this.zoomBox, "border-bottom-width"));
17785          this.boxOffsets = { left: a, right: c, top: d, bottom: e, width: !1 === b ? a + c : 0, height: !1 === b ? d + e : 0 };
17786      }
17787      return this.boxOffsets;
17788  },
17789  CLASS_NAME: "OpenLayers.Handler.Box",
17790});
17791OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
17792  type: OpenLayers.Control.TYPE_TOOL,
17793  out: !1,
17794  keyMask: null,
17795  alwaysZoom: !1,
17796  zoomOnClick: !0,
17797  draw: function () {
17798      this.handler = new OpenLayers.Handler.Box(this, { done: this.zoomBox }, { keyMask: this.keyMask });
17799  },
17800  zoomBox: function (a) {
17801      if (a instanceof OpenLayers.Bounds) {
17802          var b,
17803              c = a.getCenterPixel();
17804          if (this.out) {
17805              b = Math.min(this.map.size.h / (a.bottom - a.top), this.map.size.w / (a.right - a.left));
17806              var d = this.map.getExtent(),
17807                  e = this.map.getLonLatFromPixel(c),
17808                  f = e.lon - (d.getWidth() / 2) * b;
17809              a = e.lon + (d.getWidth() / 2) * b;
17810              var g = e.lat - (d.getHeight() / 2) * b;
17811              b = e.lat + (d.getHeight() / 2) * b;
17812              b = new OpenLayers.Bounds(f, g, a, b);
17813          } else (f = this.map.getLonLatFromPixel({ x: a.left, y: a.bottom })), (a = this.map.getLonLatFromPixel({ x: a.right, y: a.top })), (b = new OpenLayers.Bounds(f.lon, f.lat, a.lon, a.lat));
17814          f = this.map.getZoom();
17815          g = this.map.getSize();
17816          a = g.w / 2;
17817          g = g.h / 2;
17818          b = this.map.getZoomForExtent(b);
17819          d = this.map.getResolution();
17820          e = this.map.getResolutionForZoom(b);
17821          d == e ? this.map.setCenter(this.map.getLonLatFromPixel(c)) : this.map.zoomTo(b, { x: (d * c.x - e * a) / (d - e), y: (d * c.y - e * g) / (d - e) });
17822          f == this.map.getZoom() && !0 == this.alwaysZoom && this.map.zoomTo(f + (this.out ? -1 : 1));
17823      } else this.zoomOnClick && (this.out ? this.map.zoomTo(this.map.getZoom() - 1, a) : this.map.zoomTo(this.map.getZoom() + 1, a));
17824  },
17825  CLASS_NAME: "OpenLayers.Control.ZoomBox",
17826});
17827OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, {
17828  type: OpenLayers.Control.TYPE_TOOL,
17829  panned: !1,
17830  interval: 0,
17831  documentDrag: !1,
17832  kinetic: null,
17833  enableKinetic: !0,
17834  kineticInterval: 10,
17835  draw: function () {
17836      if (this.enableKinetic && OpenLayers.Kinetic) {
17837          var a = { interval: this.kineticInterval };
17838          "object" === typeof this.enableKinetic && (a = OpenLayers.Util.extend(a, this.enableKinetic));
17839          this.kinetic = new OpenLayers.Kinetic(a);
17840      }
17841      this.handler = new OpenLayers.Handler.Drag(this, { move: this.panMap, done: this.panMapDone, down: this.panMapStart }, { interval: this.interval, documentDrag: this.documentDrag });
17842  },
17843  panMapStart: function () {
17844      this.kinetic && this.kinetic.begin();
17845  },
17846  panMap: function (a) {
17847      this.kinetic && this.kinetic.update(a);
17848      this.panned = !0;
17849      this.map.pan(this.handler.last.x - a.x, this.handler.last.y - a.y, { dragging: !0, animate: !1 });
17850  },
17851  panMapDone: function (a) {
17852      if (this.panned) {
17853          var b = null;
17854          this.kinetic && (b = this.kinetic.end(a));
17855          this.map.pan(this.handler.last.x - a.x, this.handler.last.y - a.y, { dragging: !!b, animate: !1 });
17856          if (b) {
17857              var c = this;
17858              this.kinetic.move(b, function (a, b, f) {
17859                  c.map.pan(a, b, { dragging: !f, animate: !1 });
17860              });
17861          }
17862          this.panned = !1;
17863      }
17864  },
17865  CLASS_NAME: "OpenLayers.Control.DragPan",
17866});
17867OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
17868  dragPan: null,
17869  dragPanOptions: null,
17870  pinchZoom: null,
17871  pinchZoomOptions: null,
17872  documentDrag: !1,
17873  zoomBox: null,
17874  zoomBoxEnabled: !0,
17875  zoomWheelEnabled: !0,
17876  mouseWheelOptions: null,
17877  handleRightClicks: !1,
17878  zoomBoxKeyMask: OpenLayers.Handler.MOD_SHIFT,
17879  autoActivate: !0,
17880  initialize: function (a) {
17881      this.handlers = {};
17882      OpenLayers.Control.prototype.initialize.apply(this, arguments);
17883  },
17884  destroy: function () {
17885      this.deactivate();
17886      this.dragPan && this.dragPan.destroy();
17887      this.dragPan = null;
17888      this.zoomBox && this.zoomBox.destroy();
17889      this.zoomBox = null;
17890      this.pinchZoom && this.pinchZoom.destroy();
17891      this.pinchZoom = null;
17892      OpenLayers.Control.prototype.destroy.apply(this, arguments);
17893  },
17894  activate: function () {
17895      this.dragPan.activate();
17896      this.zoomWheelEnabled && this.handlers.wheel.activate();
17897      this.handlers.click.activate();
17898      this.zoomBoxEnabled && this.zoomBox.activate();
17899      this.pinchZoom && this.pinchZoom.activate();
17900      return OpenLayers.Control.prototype.activate.apply(this, arguments);
17901  },
17902  deactivate: function () {
17903      this.pinchZoom && this.pinchZoom.deactivate();
17904      this.zoomBox.deactivate();
17905      this.dragPan.deactivate();
17906      this.handlers.click.deactivate();
17907      this.handlers.wheel.deactivate();
17908      return OpenLayers.Control.prototype.deactivate.apply(this, arguments);
17909  },
17910  draw: function () {
17911      this.handleRightClicks && (this.map.viewPortDiv.oncontextmenu = OpenLayers.Function.False);
17912      this.handlers.click = new OpenLayers.Handler.Click(this, { click: this.defaultClick, dblclick: this.defaultDblClick, dblrightclick: this.defaultDblRightClick }, { double: !0, stopDouble: !0 });
17913      this.dragPan = new OpenLayers.Control.DragPan(OpenLayers.Util.extend({ map: this.map, documentDrag: this.documentDrag }, this.dragPanOptions));
17914      this.zoomBox = new OpenLayers.Control.ZoomBox({ map: this.map, keyMask: this.zoomBoxKeyMask });
17915      this.dragPan.draw();
17916      this.zoomBox.draw();
17917      this.handlers.wheel = new OpenLayers.Handler.MouseWheel(this, { up: this.wheelUp, down: this.wheelDown }, OpenLayers.Util.extend(this.map.fractionalZoom ? {} : { cumulative: !1, interval: 50, maxDelta: 6 }, this.mouseWheelOptions));
17918      OpenLayers.Control.PinchZoom && (this.pinchZoom = new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({ map: this.map }, this.pinchZoomOptions)));
17919  },
17920  defaultClick: function (a) {
17921      a.lastTouches && 2 == a.lastTouches.length && this.map.zoomOut();
17922  },
17923  defaultDblClick: function (a) {
17924      this.map.zoomTo(this.map.zoom + 1, a.xy);
17925  },
17926  defaultDblRightClick: function (a) {
17927      this.map.zoomTo(this.map.zoom - 1, a.xy);
17928  },
17929  wheelChange: function (a, b) {
17930      this.map.fractionalZoom || (b = Math.round(b));
17931      var c = this.map.getZoom(),
17932          d;
17933      d = Math.max(c + b, 0);
17934      d = Math.min(d, this.map.getNumZoomLevels());
17935      d !== c && this.map.zoomTo(d, a.xy);
17936  },
17937  wheelUp: function (a, b) {
17938      this.wheelChange(a, b || 1);
17939  },
17940  wheelDown: function (a, b) {
17941      this.wheelChange(a, b || -1);
17942  },
17943  disableZoomBox: function () {
17944      this.zoomBoxEnabled = !1;
17945      this.zoomBox.deactivate();
17946  },
17947  enableZoomBox: function () {
17948      this.zoomBoxEnabled = !0;
17949      this.active && this.zoomBox.activate();
17950  },
17951  disableZoomWheel: function () {
17952      this.zoomWheelEnabled = !1;
17953      this.handlers.wheel.deactivate();
17954  },
17955  enableZoomWheel: function () {
17956      this.zoomWheelEnabled = !0;
17957      this.active && this.handlers.wheel.activate();
17958  },
17959  CLASS_NAME: "OpenLayers.Control.Navigation",
17960});
17961OpenLayers.Control.DrawFeature = OpenLayers.Class(OpenLayers.Control, {
17962  layer: null,
17963  callbacks: null,
17964  multi: !1,
17965  featureAdded: function () {},
17966  initialize: function (a, b, c) {
17967      OpenLayers.Control.prototype.initialize.apply(this, [c]);
17968      this.callbacks = OpenLayers.Util.extend(
17969          {
17970              done: this.drawFeature,
17971              modify: function (a, b) {
17972                  this.layer.events.triggerEvent("sketchmodified", { vertex: a, feature: b });
17973              },
17974              create: function (a, b) {
17975                  this.layer.events.triggerEvent("sketchstarted", { vertex: a, feature: b });
17976              },
17977          },
17978          this.callbacks
17979      );
17980      this.layer = a;
17981      this.handlerOptions = this.handlerOptions || {};
17982      this.handlerOptions.layerOptions = OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions, { renderers: a.renderers, rendererOptions: a.rendererOptions });
17983      "multi" in this.handlerOptions || (this.handlerOptions.multi = this.multi);
17984      if ((a = this.layer.styleMap && this.layer.styleMap.styles.temporary)) this.handlerOptions.layerOptions = OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions, { styleMap: new OpenLayers.StyleMap({ default: a }) });
17985      this.handler = new b(this, this.callbacks, this.handlerOptions);
17986  },
17987  drawFeature: function (a) {
17988      a = new OpenLayers.Feature.Vector(a);
17989      !1 !== this.layer.events.triggerEvent("sketchcomplete", { feature: a }) && ((a.state = OpenLayers.State.INSERT), this.layer.addFeatures([a]), this.featureAdded(a), this.events.triggerEvent("featureadded", { feature: a }));
17990  },
17991  insertXY: function (a, b) {
17992      this.handler && this.handler.line && this.handler.insertXY(a, b);
17993  },
17994  insertDeltaXY: function (a, b) {
17995      this.handler && this.handler.line && this.handler.insertDeltaXY(a, b);
17996  },
17997  insertDirectionLength: function (a, b) {
17998      this.handler && this.handler.line && this.handler.insertDirectionLength(a, b);
17999  },
18000  insertDeflectionLength: function (a, b) {
18001      this.handler && this.handler.line && this.handler.insertDeflectionLength(a, b);
18002  },
18003  undo: function () {
18004      return this.handler.undo && this.handler.undo();
18005  },
18006  redo: function () {
18007      return this.handler.redo && this.handler.redo();
18008  },
18009  finishSketch: function () {
18010      this.handler.finishGeometry();
18011  },
18012  cancel: function () {
18013      this.handler.cancel();
18014  },
18015  CLASS_NAME: "OpenLayers.Control.DrawFeature",
18016});
18017OpenLayers.Handler.Polygon = OpenLayers.Class(OpenLayers.Handler.Path, {
18018  holeModifier: null,
18019  drawingHole: !1,
18020  polygon: null,
18021  createFeature: function (a) {
18022      a = this.layer.getLonLatFromViewPortPx(a);
18023      a = new OpenLayers.Geometry.Point(a.lon, a.lat);
18024      this.point = new OpenLayers.Feature.Vector(a);
18025      this.line = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));
18026      this.polygon = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));
18027      this.callback("create", [this.point.geometry, this.getSketch()]);
18028      this.point.geometry.clearBounds();
18029      this.layer.addFeatures([this.polygon, this.point], { silent: !0 });
18030  },
18031  addPoint: function (a) {
18032      if (!this.drawingHole && this.holeModifier && this.evt && this.evt[this.holeModifier])
18033          for (var b = this.point.geometry, c = this.control.layer.features, d, e = c.length - 1; 0 <= e; --e)
18034              if (((d = c[e].geometry), (d instanceof OpenLayers.Geometry.Polygon || d instanceof OpenLayers.Geometry.MultiPolygon) && d.intersects(b))) {
18035                  b = c[e];
18036                  this.control.layer.removeFeatures([b], { silent: !0 });
18037                  this.control.layer.events.registerPriority("sketchcomplete", this, this.finalizeInteriorRing);
18038                  this.control.layer.events.registerPriority("sketchmodified", this, this.enforceTopology);
18039                  b.geometry.addComponent(this.line.geometry);
18040                  this.polygon = b;
18041                  this.drawingHole = !0;
18042                  break;
18043              }
18044      OpenLayers.Handler.Path.prototype.addPoint.apply(this, arguments);
18045  },
18046  getCurrentPointIndex: function () {
18047      return this.line.geometry.components.length - 2;
18048  },
18049  enforceTopology: function (a) {
18050      a = a.vertex;
18051      var b = this.line.geometry.components;
18052      this.polygon.geometry.intersects(a) || ((b = b[b.length - 3]), (a.x = b.x), (a.y = b.y));
18053  },
18054  finishGeometry: function () {
18055      this.line.geometry.removeComponent(this.line.geometry.components[this.line.geometry.components.length - 2]);
18056      this.removePoint();
18057      this.finalize();
18058  },
18059  finalizeInteriorRing: function () {
18060      var a = this.line.geometry,
18061          b = 0 !== a.getArea();
18062      if (b) {
18063          for (var c = this.polygon.geometry.components, d = c.length - 2; 0 <= d; --d)
18064              if (a.intersects(c[d])) {
18065                  b = !1;
18066                  break;
18067              }
18068          if (b)
18069              a: for (d = c.length - 2; 0 < d; --d)
18070                  for (var e = c[d].components, f = 0, g = e.length; f < g; ++f)
18071                      if (a.containsPoint(e[f])) {
18072                          b = !1;
18073                          break a;
18074                      }
18075      }
18076      b ? this.polygon.state !== OpenLayers.State.INSERT && (this.polygon.state = OpenLayers.State.UPDATE) : this.polygon.geometry.removeComponent(a);
18077      this.restoreFeature();
18078      return !1;
18079  },
18080  cancel: function () {
18081      this.drawingHole && (this.polygon.geometry.removeComponent(this.line.geometry), this.restoreFeature(!0));
18082      return OpenLayers.Handler.Path.prototype.cancel.apply(this, arguments);
18083  },
18084  restoreFeature: function (a) {
18085      this.control.layer.events.unregister("sketchcomplete", this, this.finalizeInteriorRing);
18086      this.control.layer.events.unregister("sketchmodified", this, this.enforceTopology);
18087      this.layer.removeFeatures([this.polygon], { silent: !0 });
18088      this.control.layer.addFeatures([this.polygon], { silent: !0 });
18089      this.drawingHole = !1;
18090      a || this.control.layer.events.triggerEvent("sketchcomplete", { feature: this.polygon });
18091  },
18092  destroyFeature: function (a) {
18093      OpenLayers.Handler.Path.prototype.destroyFeature.call(this, a);
18094      this.polygon = null;
18095  },
18096  drawFeature: function () {
18097      this.layer.drawFeature(this.polygon, this.style);
18098      this.layer.drawFeature(this.point, this.style);
18099  },
18100  getSketch: function () {
18101      return this.polygon;
18102  },
18103  getGeometry: function () {
18104      var a = this.polygon && this.polygon.geometry;
18105      a && this.multi && (a = new OpenLayers.Geometry.MultiPolygon([a]));
18106      return a;
18107  },
18108  CLASS_NAME: "OpenLayers.Handler.Polygon",
18109});
18110OpenLayers.Control.EditingToolbar = OpenLayers.Class(OpenLayers.Control.Panel, {
18111  citeCompliant: !1,
18112  initialize: function (a, b) {
18113      OpenLayers.Control.Panel.prototype.initialize.apply(this, [b]);
18114      this.addControls([new OpenLayers.Control.Navigation()]);
18115      var c = [
18116          new OpenLayers.Control.DrawFeature(a, OpenLayers.Handler.Point, { displayClass: "olControlDrawFeaturePoint", handlerOptions: { citeCompliant: this.citeCompliant } }),
18117          new OpenLayers.Control.DrawFeature(a, OpenLayers.Handler.Path, { displayClass: "olControlDrawFeaturePath", handlerOptions: { citeCompliant: this.citeCompliant } }),
18118          new OpenLayers.Control.DrawFeature(a, OpenLayers.Handler.Polygon, { displayClass: "olControlDrawFeaturePolygon", handlerOptions: { citeCompliant: this.citeCompliant } }),
18119      ];
18120      this.addControls(c);
18121  },
18122  draw: function () {
18123      var a = OpenLayers.Control.Panel.prototype.draw.apply(this, arguments);
18124      null === this.defaultControl && (this.defaultControl = this.controls[0]);
18125      return a;
18126  },
18127  CLASS_NAME: "OpenLayers.Control.EditingToolbar",
18128});
18129OpenLayers.Strategy.BBOX = OpenLayers.Class(OpenLayers.Strategy, {
18130  bounds: null,
18131  resolution: null,
18132  ratio: 2,
18133  resFactor: null,
18134  response: null,
18135  activate: function () {
18136      var a = OpenLayers.Strategy.prototype.activate.call(this);
18137      a && (this.layer.events.on({ moveend: this.update, refresh: this.update, visibilitychanged: this.update, scope: this }), this.update());
18138      return a;
18139  },
18140  deactivate: function () {
18141      var a = OpenLayers.Strategy.prototype.deactivate.call(this);
18142      a && this.layer.events.un({ moveend: this.update, refresh: this.update, visibilitychanged: this.update, scope: this });
18143      return a;
18144  },
18145  update: function (a) {
18146      var b = this.getMapBounds();
18147      null !== b && ((a && a.force) || (this.layer.visibility && this.layer.calculateInRange() && this.invalidBounds(b))) && (this.calculateBounds(b), (this.resolution = this.layer.map.getResolution()), this.triggerRead(a));
18148  },
18149  getMapBounds: function () {
18150      if (null === this.layer.map) return null;
18151      var a = this.layer.map.getExtent();
18152      a && !this.layer.projection.equals(this.layer.map.getProjectionObject()) && (a = a.clone().transform(this.layer.map.getProjectionObject(), this.layer.projection));
18153      return a;
18154  },
18155  invalidBounds: function (a) {
18156      a || (a = this.getMapBounds());
18157      a = !this.bounds || !this.bounds.containsBounds(a);
18158      !a && this.resFactor && ((a = this.resolution / this.layer.map.getResolution()), (a = a >= this.resFactor || a <= 1 / this.resFactor));
18159      return a;
18160  },
18161  calculateBounds: function (a) {
18162      a || (a = this.getMapBounds());
18163      var b = a.getCenterLonLat(),
18164          c = a.getWidth() * this.ratio;
18165      a = a.getHeight() * this.ratio;
18166      this.bounds = new OpenLayers.Bounds(b.lon - c / 2, b.lat - a / 2, b.lon + c / 2, b.lat + a / 2);
18167  },
18168  triggerRead: function (a) {
18169      !this.response || (a && !0 === a.noAbort) || (this.layer.protocol.abort(this.response), this.layer.events.triggerEvent("loadend"));
18170      var b = { filter: this.createFilter() };
18171      this.layer.events.triggerEvent("loadstart", b);
18172      this.response = this.layer.protocol.read(OpenLayers.Util.applyDefaults({ filter: b.filter, callback: this.merge, scope: this }, a));
18173  },
18174  createFilter: function () {
18175      var a = new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.BBOX, value: this.bounds, projection: this.layer.projection });
18176      this.layer.filter && (a = new OpenLayers.Filter.Logical({ type: OpenLayers.Filter.Logical.AND, filters: [this.layer.filter, a] }));
18177      return a;
18178  },
18179  merge: function (a) {
18180      this.layer.destroyFeatures();
18181      if (a.success()) {
18182          var b = a.features;
18183          if (b && 0 < b.length) {
18184              var c = this.layer.projection,
18185                  d = this.layer.map.getProjectionObject();
18186              if (!d.equals(c)) for (var e, f = 0, g = b.length; f < g; ++f) (e = b[f].geometry) && e.transform(c, d);
18187              this.layer.addFeatures(b);
18188          }
18189      } else this.bounds = null;
18190      this.response = null;
18191      this.layer.events.triggerEvent("loadend", { response: a });
18192  },
18193  CLASS_NAME: "OpenLayers.Strategy.BBOX",
18194});
18195OpenLayers.Layer.WorldWind = OpenLayers.Class(OpenLayers.Layer.Grid, {
18196  DEFAULT_PARAMS: {},
18197  isBaseLayer: !0,
18198  lzd: null,
18199  zoomLevels: null,
18200  initialize: function (a, b, c, d, e, f) {
18201      this.lzd = c;
18202      this.zoomLevels = d;
18203      c = [];
18204      c.push(a, b, e, f);
18205      OpenLayers.Layer.Grid.prototype.initialize.apply(this, c);
18206      this.params = OpenLayers.Util.applyDefaults(this.params, this.DEFAULT_PARAMS);
18207  },
18208  getZoom: function () {
18209      var a = this.map.getZoom();
18210      this.map.getMaxExtent();
18211      return (a -= Math.log(this.maxResolution / (this.lzd / 512)) / Math.log(2));
18212  },
18213  getURL: function (a) {
18214      a = this.adjustBounds(a);
18215      var b = this.getZoom(),
18216          c = this.map.getMaxExtent(),
18217          d = this.lzd / Math.pow(2, this.getZoom()),
18218          e = Math.floor((a.left - c.left) / d);
18219      a = Math.floor((a.bottom - c.bottom) / d);
18220      return this.map.getResolution() <= this.lzd / 512 && this.getZoom() <= this.zoomLevels ? this.getFullRequestString({ L: b, X: e, Y: a }) : OpenLayers.Util.getImageLocation("blank.gif");
18221  },
18222  CLASS_NAME: "OpenLayers.Layer.WorldWind",
18223});
18224OpenLayers.Protocol.CSW = function (a) {
18225  a = OpenLayers.Util.applyDefaults(a, OpenLayers.Protocol.CSW.DEFAULTS);
18226  var b = OpenLayers.Protocol.CSW["v" + a.version.replace(/\./g, "_")];
18227  if (!b) throw "Unsupported CSW version: " + a.version;
18228  return new b(a);
18229};
18230OpenLayers.Protocol.CSW.DEFAULTS = { version: "2.0.2" };
18231OpenLayers.Format.WMTSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, {
18232  defaultVersion: "1.0.0",
18233  yx: { "urn:ogc:def:crs:EPSG::4326": !0 },
18234  createLayer: function (a, b) {
18235      if (!("layer" in b)) throw Error("Missing property 'layer' in configuration.");
18236      for (var c = a.contents, d, e = 0, f = c.layers.length; e < f; ++e)
18237          if (c.layers[e].identifier === b.layer) {
18238              d = c.layers[e];
18239              break;
18240          }
18241      if (!d) throw Error("Layer not found");
18242      var g = b.format;
18243      !g && d.formats && d.formats.length && (g = d.formats[0]);
18244      var h;
18245      b.matrixSet ? (h = c.tileMatrixSets[b.matrixSet]) : 1 <= d.tileMatrixSetLinks.length && (h = c.tileMatrixSets[d.tileMatrixSetLinks[0].tileMatrixSet]);
18246      if (!h) throw Error("matrixSet not found");
18247      for (var k, e = 0, f = d.styles.length; e < f && ((k = d.styles[e]), !k.isDefault); ++e);
18248      c = b.requestEncoding;
18249      if (!c && ((c = "KVP"), a.operationsMetadata.GetTile.dcp.http)) {
18250          var l = a.operationsMetadata.GetTile.dcp.http;
18251          l.get[0].constraints && ((l = l.get[0].constraints.GetEncoding.allowedValues), l.KVP || (!l.REST && !l.RESTful) || (c = "REST"));
18252      }
18253      var l = [],
18254          m = b.params || {};
18255      delete b.params;
18256      for (var n = 0, p = d.dimensions.length; n < p; n++) {
18257          var q = d.dimensions[n];
18258          l.push(q.identifier);
18259          m.hasOwnProperty(q.identifier) || (m[q.identifier] = q["default"]);
18260      }
18261      var n = b.projection || h.supportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/, "$1:$3"),
18262          p = b.units || ("EPSG:4326" === n ? "degrees" : "m"),
18263          q = [],
18264          r;
18265      for (r in h.matrixIds) h.matrixIds.hasOwnProperty(r) && q.push((2.8e-4 * h.matrixIds[r].scaleDenominator) / OpenLayers.METERS_PER_INCH / OpenLayers.INCHES_PER_UNIT[p]);
18266      if ("REST" === c && d.resourceUrls) {
18267          r = [];
18268          for (var f = 0, s = d.resourceUrls.length; f < s; ++f) (e = d.resourceUrls[f]), e.format === g && "tile" === e.resourceType && r.push(e.template);
18269      } else {
18270          s = a.operationsMetadata.GetTile.dcp.http.get;
18271          r = [];
18272          for (var t, e = 0, f = s.length; e < f; e++) (t = s[e].constraints), (!t || (t && t.GetEncoding.allowedValues[c])) && r.push(s[e].url);
18273      }
18274      return new OpenLayers.Layer.WMTS(
18275          OpenLayers.Util.applyDefaults(b, {
18276              url: r,
18277              requestEncoding: c,
18278              name: d.title,
18279              style: k.identifier,
18280              format: g,
18281              matrixIds: h.matrixIds,
18282              matrixSet: h.identifier,
18283              projection: n,
18284              units: p,
18285              resolutions: !1 === b.isBaseLayer ? void 0 : q,
18286              serverResolutions: q,
18287              tileFullExtent: h.bounds,
18288              dimensions: l,
18289              params: m,
18290          })
18291      );
18292  },
18293  CLASS_NAME: "OpenLayers.Format.WMTSCapabilities",
18294});
18295OpenLayers.Layer.Google.v3 = {
18296  DEFAULTS: { sphericalMercator: !0, projection: "EPSG:900913" },
18297  animationEnabled: !0,
18298  loadMapObject: function () {
18299      this.type || (this.type = google.maps.MapTypeId.ROADMAP);
18300      var a,
18301          b = OpenLayers.Layer.Google.cache[this.map.id];
18302      b
18303          ? ((a = b.mapObject), ++b.count)
18304          : ((a = this.map.getCenter()),
18305            (b = document.createElement("div")),
18306            (b.className = "olForeignContainer"),
18307            (b.style.width = "100%"),
18308            (b.style.height = "100%"),
18309            (a = new google.maps.Map(b, {
18310                center: a ? new google.maps.LatLng(a.lat, a.lon) : new google.maps.LatLng(0, 0),
18311                zoom: this.map.getZoom() || 0,
18312                mapTypeId: this.type,
18313                disableDefaultUI: !0,
18314                keyboardShortcuts: !1,
18315                draggable: !1,
18316                disableDoubleClickZoom: !0,
18317                scrollwheel: !1,
18318                streetViewControl: !1,
18319            })),
18320            (b = document.createElement("div")),
18321            (b.style.width = "100%"),
18322            (b.style.height = "100%"),
18323            a.controls[google.maps.ControlPosition.TOP_LEFT].push(b),
18324            (b = { googleControl: b, mapObject: a, count: 1 }),
18325            (OpenLayers.Layer.Google.cache[this.map.id] = b));
18326      this.mapObject = a;
18327      this.setGMapVisibility(this.visibility);
18328  },
18329  onMapResize: function () {
18330      this.visibility && google.maps.event.trigger(this.mapObject, "resize");
18331  },
18332  setGMapVisibility: function (a) {
18333      var b = OpenLayers.Layer.Google.cache[this.map.id],
18334          c = this.map;
18335      if (b) {
18336          for (var d = this.type, e = c.layers, f, g = e.length - 1; 0 <= g; --g)
18337              if (((f = e[g]), f instanceof OpenLayers.Layer.Google && !0 === f.visibility && !0 === f.inRange)) {
18338                  d = f.type;
18339                  a = !0;
18340                  break;
18341              }
18342          e = this.mapObject.getDiv();
18343          if (!0 === a) {
18344              if (e.parentNode !== c.div)
18345                  if (b.rendered) c.div.appendChild(e), b.googleControl.appendChild(c.viewPortDiv), google.maps.event.trigger(this.mapObject, "resize");
18346                  else {
18347                      var h = this;
18348                      google.maps.event.addListenerOnce(this.mapObject, "tilesloaded", function () {
18349                          b.rendered = !0;
18350                          h.setGMapVisibility(h.getVisibility());
18351                          h.moveTo(h.map.getCenter());
18352                      });
18353                  }
18354              this.mapObject.setMapTypeId(d);
18355          } else b.googleControl.hasChildNodes() && (c.div.appendChild(c.viewPortDiv), c.div.removeChild(e));
18356      }
18357  },
18358  getMapContainer: function () {
18359      return this.mapObject.getDiv();
18360  },
18361  getMapObjectBoundsFromOLBounds: function (a) {
18362      var b = null;
18363      null != a &&
18364          ((b = this.sphericalMercator ? this.inverseMercator(a.bottom, a.left) : new OpenLayers.LonLat(a.bottom, a.left)),
18365          (a = this.sphericalMercator ? this.inverseMercator(a.top, a.right) : new OpenLayers.LonLat(a.top, a.right)),
18366          (b = new google.maps.LatLngBounds(new google.maps.LatLng(b.lat, b.lon), new google.maps.LatLng(a.lat, a.lon))));
18367      return b;
18368  },
18369  getMapObjectLonLatFromMapObjectPixel: function (a) {
18370      var b = this.map.getSize(),
18371          c = this.getLongitudeFromMapObjectLonLat(this.mapObject.center),
18372          d = this.getLatitudeFromMapObjectLonLat(this.mapObject.center),
18373          e = this.map.getResolution();
18374      a = new OpenLayers.LonLat(c + (a.x - b.w / 2) * e, d - (a.y - b.h / 2) * e);
18375      this.wrapDateLine && (a = a.wrapDateLine(this.maxExtent));
18376      return this.getMapObjectLonLatFromLonLat(a.lon, a.lat);
18377  },
18378  getMapObjectPixelFromMapObjectLonLat: function (a) {
18379      var b = this.getLongitudeFromMapObjectLonLat(a);
18380      a = this.getLatitudeFromMapObjectLonLat(a);
18381      var c = this.map.getResolution(),
18382          d = this.map.getExtent();
18383      return this.getMapObjectPixelFromXY((1 / c) * (b - d.left), (1 / c) * (d.top - a));
18384  },
18385  setMapObjectCenter: function (a, b) {
18386      if (!1 === this.animationEnabled && b != this.mapObject.zoom) {
18387          var c = this.getMapContainer();
18388          google.maps.event.addListenerOnce(this.mapObject, "idle", function () {
18389              c.style.visibility = "";
18390          });
18391          c.style.visibility = "hidden";
18392      }
18393      this.mapObject.setOptions({ center: a, zoom: b });
18394  },
18395  getMapObjectZoomFromMapObjectBounds: function (a) {
18396      return this.mapObject.getBoundsZoomLevel(a);
18397  },
18398  getMapObjectLonLatFromLonLat: function (a, b) {
18399      var c;
18400      this.sphericalMercator ? ((c = this.inverseMercator(a, b)), (c = new google.maps.LatLng(c.lat, c.lon))) : (c = new google.maps.LatLng(b, a));
18401      return c;
18402  },
18403  getMapObjectPixelFromXY: function (a, b) {
18404      return new google.maps.Point(a, b);
18405  },
18406};
18407OpenLayers.Format.WPSDescribeProcess = OpenLayers.Class(OpenLayers.Format.XML, {
18408  VERSION: "1.0.0",
18409  namespaces: { wps: "http://www.opengis.net/wps/1.0.0", ows: "http://www.opengis.net/ows/1.1", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
18410  schemaLocation: "http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",
18411  defaultPrefix: "wps",
18412  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
18413  read: function (a) {
18414      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
18415      a && 9 == a.nodeType && (a = a.documentElement);
18416      var b = {};
18417      this.readNode(a, b);
18418      return b;
18419  },
18420  readers: {
18421      wps: {
18422          ProcessDescriptions: function (a, b) {
18423              b.processDescriptions = {};
18424              this.readChildNodes(a, b.processDescriptions);
18425          },
18426          ProcessDescription: function (a, b) {
18427              var c = { processVersion: this.getAttributeNS(a, this.namespaces.wps, "processVersion"), statusSupported: "true" === a.getAttribute("statusSupported"), storeSupported: "true" === a.getAttribute("storeSupported") };
18428              this.readChildNodes(a, c);
18429              b[c.identifier] = c;
18430          },
18431          DataInputs: function (a, b) {
18432              b.dataInputs = [];
18433              this.readChildNodes(a, b.dataInputs);
18434          },
18435          ProcessOutputs: function (a, b) {
18436              b.processOutputs = [];
18437              this.readChildNodes(a, b.processOutputs);
18438          },
18439          Output: function (a, b) {
18440              var c = {};
18441              this.readChildNodes(a, c);
18442              b.push(c);
18443          },
18444          ComplexOutput: function (a, b) {
18445              b.complexOutput = {};
18446              this.readChildNodes(a, b.complexOutput);
18447          },
18448          LiteralOutput: function (a, b) {
18449              b.literalOutput = {};
18450              this.readChildNodes(a, b.literalOutput);
18451          },
18452          Input: function (a, b) {
18453              var c = { maxOccurs: parseInt(a.getAttribute("maxOccurs")), minOccurs: parseInt(a.getAttribute("minOccurs")) };
18454              this.readChildNodes(a, c);
18455              b.push(c);
18456          },
18457          BoundingBoxData: function (a, b) {
18458              b.boundingBoxData = {};
18459              this.readChildNodes(a, b.boundingBoxData);
18460          },
18461          CRS: function (a, b) {
18462              b.CRSs || (b.CRSs = {});
18463              b.CRSs[this.getChildValue(a)] = !0;
18464          },
18465          LiteralData: function (a, b) {
18466              b.literalData = {};
18467              this.readChildNodes(a, b.literalData);
18468          },
18469          ComplexData: function (a, b) {
18470              b.complexData = {};
18471              this.readChildNodes(a, b.complexData);
18472          },
18473          Default: function (a, b) {
18474              b["default"] = {};
18475              this.readChildNodes(a, b["default"]);
18476          },
18477          Supported: function (a, b) {
18478              b.supported = {};
18479              this.readChildNodes(a, b.supported);
18480          },
18481          Format: function (a, b) {
18482              var c = {};
18483              this.readChildNodes(a, c);
18484              b.formats || (b.formats = {});
18485              b.formats[c.mimeType] = !0;
18486          },
18487          MimeType: function (a, b) {
18488              b.mimeType = this.getChildValue(a);
18489          },
18490      },
18491      ows: OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows,
18492  },
18493  CLASS_NAME: "OpenLayers.Format.WPSDescribeProcess",
18494});
18495OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
18496  initialize: function (a) {
18497      this.regExes = { typeStr: /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/, spaces: /\s+/, parenComma: /\)\s*,\s*\(/, doubleParenComma: /\)\s*\)\s*,\s*\(\s*\(/, trimParens: /^\s*\(?(.*?)\)?\s*$/ };
18498      OpenLayers.Format.prototype.initialize.apply(this, [a]);
18499  },
18500  read: function (a) {
18501      var b, c;
18502      a = a.replace(/[\n\r]/g, " ");
18503      if ((c = this.regExes.typeStr.exec(a)))
18504          if (((a = c[1].toLowerCase()), (c = c[2]), this.parse[a] && (b = this.parse[a].apply(this, [c])), this.internalProjection && this.externalProjection))
18505              if (b && "OpenLayers.Feature.Vector" == b.CLASS_NAME) b.geometry.transform(this.externalProjection, this.internalProjection);
18506              else if (b && "geometrycollection" != a && "object" == typeof b) for (a = 0, c = b.length; a < c; a++) b[a].geometry.transform(this.externalProjection, this.internalProjection);
18507      return b;
18508  },
18509  write: function (a) {
18510      var b, c;
18511      a.constructor == Array ? (c = !0) : ((a = [a]), (c = !1));
18512      var d = [];
18513      c && d.push("GEOMETRYCOLLECTION(");
18514      for (var e = 0, f = a.length; e < f; ++e) c && 0 < e && d.push(","), (b = a[e].geometry), d.push(this.extractGeometry(b));
18515      c && d.push(")");
18516      return d.join("");
18517  },
18518  extractGeometry: function (a) {
18519      var b = a.CLASS_NAME.split(".")[2].toLowerCase();
18520      if (!this.extract[b]) return null;
18521      this.internalProjection && this.externalProjection && ((a = a.clone()), a.transform(this.internalProjection, this.externalProjection));
18522      return ("collection" == b ? "GEOMETRYCOLLECTION" : b.toUpperCase()) + "(" + this.extract[b].apply(this, [a]) + ")";
18523  },
18524  extract: {
18525      point: function (a) {
18526          return a.x + " " + a.y;
18527      },
18528      multipoint: function (a) {
18529          for (var b = [], c = 0, d = a.components.length; c < d;
18529 ++c) b.push("(" + this.extract.point.apply(this, [a.components[c]]) + ")");
18530          return b.join(",");
18531      },
18532      linestring: function (a) {
18533          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push(this.extract.point.apply(this, [a.components[c]]));
18534          return b.join(",");
18535      },
18536      multilinestring: function (a) {
18537          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push("(" + this.extract.linestring.apply(this, [a.components[c]]) + ")");
18538          return b.join(",");
18539      },
18540      polygon: function (a) {
18541          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push("(" + this.extract.linestring.apply(this, [a.components[c]]) + ")");
18542          return b.join(",");
18543      },
18544      multipolygon: function (a) {
18545          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push("(" + this.extract.polygon.apply(this, [a.components[c]]) + ")");
18546          return b.join(",");
18547      },
18548      collection: function (a) {
18549          for (var b = [], c = 0, d = a.components.length; c < d; ++c) b.push(this.extractGeometry.apply(this, [a.components[c]]));
18550          return b.join(",");
18551      },
18552  },
18553  parse: {
18554      point: function (a) {
18555          a = OpenLayers.String.trim(a).split(this.regExes.spaces);
18556          return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[0], a[1]));
18557      },
18558      multipoint: function (a) {
18559          for (var b = OpenLayers.String.trim(a).split(","), c = [], d = 0, e = b.length; d < e; ++d) (a = b[d].replace(this.regExes.trimParens, "$1")), c.push(this.parse.point.apply(this, [a]).geometry);
18560          return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(c));
18561      },
18562      linestring: function (a) {
18563          a = OpenLayers.String.trim(a).split(",");
18564          for (var b = [], c = 0, d = a.length; c < d; ++c) b.push(this.parse.point.apply(this, [a[c]]).geometry);
18565          return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(b));
18566      },
18567      multilinestring: function (a) {
18568          for (var b = OpenLayers.String.trim(a).split(this.regExes.parenComma), c = [], d = 0, e = b.length; d < e; ++d) (a = b[d].replace(this.regExes.trimParens, "$1")), c.push(this.parse.linestring.apply(this, [a]).geometry);
18569          return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(c));
18570      },
18571      polygon: function (a) {
18572          var b;
18573          a = OpenLayers.String.trim(a).split(this.regExes.parenComma);
18574          for (var c = [], d = 0, e = a.length; d < e; ++d) (b = a[d].replace(this.regExes.trimParens, "$1")), (b = this.parse.linestring.apply(this, [b]).geometry), (b = new OpenLayers.Geometry.LinearRing(b.components)), c.push(b);
18575          return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(c));
18576      },
18577      multipolygon: function (a) {
18578          for (var b = OpenLayers.String.trim(a).split(this.regExes.doubleParenComma), c = [], d = 0, e = b.length; d < e; ++d) (a = b[d].replace(this.regExes.trimParens, "$1")), c.push(this.parse.polygon.apply(this, [a]).geometry);
18579          return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(c));
18580      },
18581      geometrycollection: function (a) {
18582          a = a.replace(/,\s*([A-Za-z])/g, "|$1");
18583          a = OpenLayers.String.trim(a).split("|");
18584          for (var b = [], c = 0, d = a.length; c < d; ++c) b.push(OpenLayers.Format.WKT.prototype.read.apply(this, [a[c]]));
18585          return b;
18586      },
18587  },
18588  CLASS_NAME: "OpenLayers.Format.WKT",
18589});
18590OpenLayers.WPSProcess = OpenLayers.Class({
18591  client: null,
18592  server: null,
18593  identifier: null,
18594  description: null,
18595  localWPS: "http://geoserver/wps",
18596  formats: null,
18597  chained: 0,
18598  executeCallbacks: null,
18599  initialize: function (a) {
18600      OpenLayers.Util.extend(this, a);
18601      this.executeCallbacks = [];
18602      this.formats = { "application/wkt": new OpenLayers.Format.WKT(), "application/json": new OpenLayers.Format.GeoJSON() };
18603  },
18604  describe: function (a) {
18605      a = a || {};
18606      if (!this.description)
18607          this.client.describeProcess(
18608              this.server,
18609              this.identifier,
18610              function (b) {
18611                  this.description || this.parseDescription(b);
18612                  a.callback && a.callback.call(a.scope, this.description);
18613              },
18614              this
18615          );
18616      else if (a.callback) {
18617          var b = this.description;
18618          window.setTimeout(function () {
18619              a.callback.call(a.scope, b);
18620          }, 0);
18621      }
18622  },
18623  configure: function (a) {
18624      this.describe({
18625          callback: function () {
18626              var b = this.description,
18627                  c = a.inputs,
18628                  d,
18629                  e,
18630                  f;
18631              e = 0;
18632              for (f = b.dataInputs.length; e < f; ++e) (d = b.dataInputs[e]), this.setInputData(d, c[d.identifier]);
18633              a.callback && a.callback.call(a.scope);
18634          },
18635          scope: this,
18636      });
18637      return this;
18638  },
18639  execute: function (a) {
18640      this.configure({
18641          inputs: a.inputs,
18642          callback: function () {
18643              var b = this,
18644                  c = this.getOutputIndex(b.description.processOutputs, a.output);
18645              b.setResponseForm({ outputIndex: c });
18646              (function e() {
18647                  OpenLayers.Util.removeItem(b.executeCallbacks, e);
18648                  0 !== b.chained
18649                      ? b.executeCallbacks.push(e)
18650                      : OpenLayers.Request.POST({
18651                            url: b.client.servers[b.server].url,
18652                            data: new OpenLayers.Format.WPSExecute().write(b.description),
18653                            success: function (e) {
18654                                var g = b.findMimeType(b.description.processOutputs[c].c
18654omplexOutput.supported.formats);
18655                                e = b.formats[g].read(e.responseText);
18656                                e instanceof OpenLayers.Feature.Vector && (e = [e]);
18657                                a.success && ((g = {}), (g[a.output || "result"] = e), a.success.call(a.scope, g));
18658                            },
18659                            scope: b,
18660                        });
18661              })();
18662          },
18663          scope: this,
18664      });
18665  },
18666  output: function (a) {
18667      return new OpenLayers.WPSProcess.ChainLink({ process: this, output: a });
18668  },
18669  parseDescription: function (a) {
18670      a = this.client.servers[this.server];
18671      this.description = new OpenLayers.Format.WPSDescribeProcess().read(a.processDescription[this.identifier]).processDescriptions[this.identifier];
18672  },
18673  setInputData: function (a, b) {
18674      delete a.data;
18675      delete a.reference;
18676      if (b instanceof OpenLayers.WPSProcess.ChainLink)
18677          ++this.chained,
18678              (a.reference = { method: "POST", href: b.process.server === this.server ? this.localWPS : this.client.servers[b.process.server].url }),
18679              b.process.describe({
18680                  callback: function () {
18681                      --this.chained;
18682                      this.chainProcess(a, b);
18683                  },
18684                  scope: this,
18685              });
18686      else {
18687          a.data = {};
18688          var c = a.complexData;
18689          c ? ((c = this.findMimeType(c.supported.formats)), (a.data.complexData = { mimeType: c, value: this.formats[c].write(this.toFeatures(b)) })) : (a.data.literalData = { value: b });
18690      }
18691  },
18692  setResponseForm: function (a) {
18693      a = a || {};
18694      var b = this.description.processOutputs[a.outputIndex || 0];
18695      this.description.responseForm = { rawDataOutput: { identifier: b.identifier, mimeType: this.findMimeType(b.complexOutput.supported.formats, a.supportedFormats) } };
18696  },
18697  getOutputIndex: function (a, b) {
18698      var c;
18699      if (b)
18700          for (var d = a.length - 1; 0 <= d; --d) {
18701              if (a[d].identifier === b) {
18702                  c = d;
18703                  break;
18704              }
18705          }
18706      else c = 0;
18707      return c;
18708  },
18709  chainProcess: function (a, b) {
18710      var c = this.getOutputIndex(b.process.description.processOutputs, b.output);
18711      a.reference.mimeType = this.findMimeType(a.complexData.supported.formats, b.process.description.processOutputs[c].complexOutput.supported.formats);
18712      var d = {};
18713      d[a.reference.mimeType] = !0;
18714      b.process.setResponseForm({ outputIndex: c, supportedFormats: d });
18715      for (a.reference.body = b.process.description; 0 < this.executeCallbacks.length; ) this.executeCallbacks[0]();
18716  },
18717  toFeatures: function (a) {
18718      var b = OpenLayers.Util.isArray(a);
18719      b || (a = [a]);
18720      for (var c = Array(a.length), d, e = 0, f = a.length; e < f; ++e) (d = a[e]), (c[e] = d instanceof OpenLayers.Feature.Vector ? d : new OpenLayers.Feature.Vector(d));
18721      return b ? c : c[0];
18722  },
18723  findMimeType: function (a, b) {
18724      b = b || this.formats;
18725      for (var c in a) if (c in b) return c;
18726  },
18727  CLASS_NAME: "OpenLayers.WPSProcess",
18728});
18729OpenLayers.WPSProcess.ChainLink = OpenLayers.Class({
18730  process: null,
18731  output: null,
18732  initialize: function (a) {
18733      OpenLayers.Util.extend(this, a);
18734  },
18735  CLASS_NAME: "OpenLayers.WPSProcess.ChainLink",
18736});
18737OpenLayers.WPSClient = OpenLayers.Class({
18738  servers: null,
18739  version: "1.0.0",
18740  lazy: !1,
18741  events: null,
18742  initialize: function (a) {
18743      OpenLayers.Util.extend(this, a);
18744      this.events = new OpenLayers.Events(this);
18745      this.servers = {};
18746      for (var b in a.servers) this.servers[b] = "string" == typeof a.servers[b] ? { url: a.servers[b], version: this.version, processDescription: {} } : a.servers[b];
18747  },
18748  execute: function (a) {
18749      this.getProcess(a.server, a.process).execute({ inputs: a.inputs, success: a.success, scope: a.scope });
18750  },
18751  getProcess: function (a, b) {
18752      var c = new OpenLayers.WPSProcess({ client: this, server: a, identifier: b });
18753      this.lazy || c.describe();
18754      return c;
18755  },
18756  describeProcess: function (a, b, c, d) {
18757      var e = this.servers[a];
18758      e.processDescription[b]
18759          ? window.setTimeout(function () {
18760                c.call(d, e.processDescription[b]);
18761            }, 0)
18762          : b in e.processDescription
18763          ? this.events.register("describeprocess", this, function g(a
18763) {
18764                a.identifier === b && (this.events.unregister("describeprocess", this, g), c.call(d, a.raw));
18765            })
18766          : ((e.processDescription[b] = null),
18767            OpenLayers.Request.GET({
18768                url: e.url,
18769                params: { SERVICE: "WPS", VERSION: e.version, REQUEST: "DescribeProcess", IDENTIFIER: b },
18770                success: function (a) {
18771                    e.processDescription[b] = a.responseText;
18772                    this.events.triggerEvent("describeprocess", { identifier: b, raw: a.responseText });
18773                },
18774                scope: this,
18775            }));
18776  },
18777  destroy: function () {
18778      this.events.destroy();
18779      this.servers = this.events = null;
18780  },
18781  CLASS_NAME: "OpenLayers.WPSClient",
18782});
18783OpenLayers.Format.CSWGetRecords.v2_0_2 = OpenLayers.Class(OpenLayers.Format.XML, {
18784  namespaces: {
18785      csw: "http://www.opengis.net/cat/csw/2.0.2",
18786      dc: "http://purl.org/dc/elements/1.1/",
18787      dct: "http://purl.org/dc/terms/",
18788      gmd: "http://www.isotc211.org/2005/gmd",
18789      geonet: "http://www.fao.org/geonetwork",
18790      ogc: "http://www.opengis.net/ogc",
18791      ows: "http://www.opengis.net/ows",
18792      xlink: "http://www.w3.org/1999/xlink",
18793      xsi: "http://www.w3.org/2001/XMLSchema-instance",
18794  },
18795  defaultPrefix: "csw",
18796  version: "2.0.2",
18797  schemaLocation: "http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",
18798  requestId: null,
18799  resultType: null,
18800  outputFormat: null,
18801  outputSchema: null,
18802  startPosition: null,
18803  maxRecords: null,
18804  DistributedSearch: null,
18805  ResponseHandler: null,
18806  Query: null,
18807  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
18808  initialize: function (a) {
18809      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
18810  },
18811  read: function (a) {
18812      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
18813      a && 9 == a.nodeType && (a = a.documentElement);
18814      var b = {};
18815      this.readNode(a, b);
18816      return b;
18817  },
18818  readers: {
18819      csw: {
18820          GetRecordsResponse: function (a, b) {
18821              b.records = [];
18822              this.readChildNodes(a, b);
18823              var c = this.getAttributeNS(a, "", "version");
18824              "" != c && (b.version = c);
18825          },
18826          RequestId: function (a, b) {
18827              b.RequestId = this.getChildValue(a);
18828          },
18829          SearchStatus: function (a, b) {
18830              b.SearchStatus = {};
18831              var c = this.getAttributeNS(a, "", "timestamp");
18832              "" != c && (b.SearchStatus.timestamp = c);
18833          },
18834          SearchResults: function (a, b) {
18835              this.readChildNodes(a, b);
18836              for (var c = a.attributes, d = {}, e = 0, f = c.length; e < f; ++e)
18837                  d[c[e].name] = "numberOfRecordsMatched" == c[e].name || "numberOfRecordsReturned" == c[e].name || "nextRecord" == c[e].name ? parseInt(c[e].nodeValue) : c[e].nodeValue;
18838              b.SearchResults = d;
18839          },
18840          SummaryRecord: function (a, b) {
18841              var c = { type: "SummaryRecord" };
18842              this.readChildNodes(a, c);
18843              b.records.push(c);
18844          },
18845          BriefRecord: function (a, b) {
18846              var c = { type: "BriefRecord" };
18847              this.readChildNodes(a, c);
18848              b.records.push(c);
18849          },
18850          DCMIRecord: function (a, b) {
18851              var c = { type: "DCMIRecord" };
18852              this.readChildNodes(a, c);
18853              b.records.push(c);
18854          },
18855          Record: function (a, b) {
18856              var c = { type: "Record" };
18857              this.readChildNodes(a, c);
18858              b.records.push(c);
18859          },
18860          "*": function (a, b) {
18861              var c = a.localName || a.nodeName.split(":").pop();
18862              b[c] = this.getChildValue(a);
18863          },
18864      },
18865      geonet: {
18866          info: function (a, b) {
18867              var c = {};
18868              this.readChildNodes(a, c);
18869              b.gninfo = c;
18870          },
18871      },
18872      dc: {
18873          "*": function (a, b) {
18874              var c = a.localName || a.nodeName.split(":").pop();
18875              OpenLayers.Util.isArray(b[c]) || (b[c] = []);
18876              for (var d = {}, e = a.attributes, f = 0, g = e.length; f < g; ++f) d[e[f].name] = e[f].nodeValue;
18877              d.value = this.getChildValue(a);
18878              "" != d.value && b[c].push(d);
18879          },
18880      },
18881      dct: {
18882          "*": function (a, b) {
18883              var c = a.localName || a.nodeName.split(":").pop();
18884              OpenLayers.Util.isArray(b[c]) || (b[c] = []);
18885              b[c].push(this.getChildValue(a));
18886          },
18887      },
18888      ows: OpenLayers.Util.applyDefaults(
18889          {
18890              BoundingBox: function (a, b) {
18891                  b.bounds && ((b.BoundingBox = [{ crs: b.projection, value: [b.bounds.left, b.bounds.bottom, b.bounds.right, b.bounds.top] }]), delete b.projection, delete b.bounds);
18892                  OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows.BoundingBox.apply(this, arguments);
18893              },
18894          },
18895          OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows
18896      ),
18897  },
18898  write: function (a) {
18899      a = this.writeNode("csw:GetRecords", a);
18900      a.setAttribute("xmlns:gmd", this.namespaces.gmd);
18901      return OpenLayers.Format.XML.prototype.write.apply(this, [a]);
18902  },
18903  writers: {
18904      csw: {
18905          GetRecords: function (a) {
18906              a || (a = {});
18907              var b = this.createElementNSPlus("csw:GetRecords", {
18908                  attributes: {
18909                      service: "CSW",
18910                      version: this.version,
18911                      requestId: a.requestId || this.requestId,
18912                      resultType: a.resultType || this.resultType,
18913                      outputFormat: a.outputFormat || this.outputFormat,
18914                      outputSchema: a.outputSchema || this.outputSchema,
18915                      startPosition: a.startPosition || this.startPosition,
18916                      maxRecords: a.maxRecords || this.maxRecords,
18917                  },
18918              });
18919              (a.DistributedSearch || this.DistributedSearch) && this.writeNode("csw:DistributedSearch", a.DistributedSearch || this.DistributedSearch, b);
18920              var c = a.ResponseHandler || this.ResponseHandler;
18921              if (OpenLayers.Util.isArray(c) && 0 < c.length) for (var d = 0, e = c.length; d < e; d++) this.writeNode("csw:ResponseHandler", c[d], b);
18922              this.writeNode("Query", a.Query || this.Query, b);
18923              return b;
18924          },
18925          DistributedSearch: function (a) {
18926              return this.createElementNSPlus("csw:DistributedSearch", { attributes: { hopCount: a.hopCount } });
18927          },
18928          ResponseHandler: function (a) {
18929              return this.createElementNSPlus("csw:ResponseHandler", { value: a.value });
18930          },
18931          Query: function (a) {
18932              a || (a = {});
18933              var b = this.createElementNSPlus("csw:Query", { attributes: { typeNames: a.typeNames || "csw:Record" } }),
18934                  c = a.ElementName;
18935              if (OpenLayers.Util.isArray(c) && 0 < c.length) for (var d = 0, e = c.length; d < e; d++) this.writeNode("csw:ElementName", c[d], b);
18936              else this.writeNode("csw:ElementSetName", a.ElementSetName || { value: "summary" }, b);
18937              a.Constraint && this.writeNode("csw:Constraint", a.Constraint, b);
18938              a.SortBy && this.writeNode("ogc:SortBy", a.SortBy, b);
18939              return b;
18940          },
18941          ElementName: function (a) {
18942              return this.createElementNSPlus("csw:ElementName", { value: a.value });
18943          },
18944          ElementSetName: function (a) {
18945              return this.createElementNSPlus("csw:ElementSetName", { attributes: { typeNames: a.typeNames }, value: a.value });
18946          },
18947          Constraint: function (a) {
18948              var b = this.createElementNSPlus("csw:Constraint", { attributes: { version: a.version } });
18949              if (a.Filter) {
18950                  var c = new OpenLayers.Format.Filter({ version: a.version });
18951                  b.appendChild(c.write(a.Filter));
18952              } else a.CqlText && ((a = this.createElementNSPlus("CqlText", { value: a.CqlText.value })), b.appendChild(a));
18953              return b;
18954          },
18955      },
18956      ogc: OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc,
18957  },
18958  CLASS_NAME: "OpenLayers.Format.CSWGetRecords.v2_0_2",
18959}); /*
18960Apache 2 
18961
18962Contains portions of Rico <http://openrico.org/>
18963
18964Copyright 2005 Sabre Airline Solutions  
18965
18966Licensed under the Apache License, Version 2.0 (the "License"); you
18967may not use this file except in compliance with the License. You
18968may obtain a copy of the License at
18969
18970   http://www.apache.org/licenses/LICENSE-2.0  
18971
18972Unless required by applicable law or agreed to in writing, software
18973distributed under the License is distributed on an "AS IS" BASIS,
18974WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
18975implied. See the License for the specific language governing
18976permissions and limitations under the License. 
18977*/
18978OpenLayers.Marker.Box = OpenLayers.Class(OpenLayers.Marker, {
18979  bounds: null,
18980  div: null,
18981  initialize: function (a, b, c) {
18982      this.bounds = a;
18983      this.div = OpenLayers.Util.createDiv();
18984      this.div.style.overflow = "hidden";
18985      this.events = new OpenLayers.Events(this, this.div);
18986      this.setBorder(b, c);
18987  },
18988  destroy: function () {
18989      this.div = this.bounds = null;
18990      OpenLayers.Marker.prototype.destroy.apply(this, arguments);
18991  },
18992  setBorder: function (a, b) {
18993      a || (a = "red");
18994      b || (b = 2);
18995      this.div.style.border = b + "px solid " + a;
18996  },
18997  draw: function (a, b) {
18998      OpenLayers.Util.modifyDOMElement(this.div, null, a, b);
18999      return this.div;
19000  },
19001  onScreen: function () {
19002      var a = !1;
19003      this.map && (a = this.map.getExtent().containsBounds(this.bounds, !0, !0));
19004      return a;
19005  },
19006  display: function (a) {
19007      this.div.style.display = a ? "" : "none";
19008  },
19009  CLASS_NAME: "OpenLayers.Marker.Box",
19010});
19011OpenLayers.Format.Text = OpenLayers.Class(OpenLayers.Format, {
19012  defaultStyle: null,
19013  extractStyles: !0,
19014  initialize: function (a) {
19015      a = a || {};
19016      !1 !== a.extractStyles && (a.defaultStyle = { externalGraphic: OpenLayers.Util.getImageLocation("marker.png"), graphicWidth: 21, graphicHeight: 25, graphicXOffset: -10.5, graphicYOffset: -12.5 });
19017      OpenLayers.Format.prototype.initialize.apply(this, [a]);
19018  },
19019  read: function (a) {
19020      a = a.split("\n");
19021      for (var b, c = [], d = 0; d < a.length - 1; d++) {
19022          var e = a[d].replace(/^\s*/, "").replace(/\s*$/, "");
19023          if ("#" != e.charAt(0))
19024              if (b) {
19025                  for (var e = e.split("\t"), f = new OpenLayers.Geometry.Point(0, 0), g = {}, h = this.defaultStyle ? OpenLayers.Util.applyDefaults({}, this.defaultStyle) : null, k = !1, l = 0; l < e.length; l++)
19026                      if (e[l])
19027                          if ("point" == b[l]) (k = e[l].split(",")), (f.y = parseFloat(k[0])), (f.x = parseFloat(k[1])), (k = !0);
19028                          else if ("lat" == b[l]) (f.y = parseFloat(e[l])), (k = !0);
19029                          else if ("lon" == b[l]) (f.x = parseFloat(e[l])), (k = !0);
19030                          else if ("title" == b[l]) g.title = e[l];
19031                          else if ("image" == b[l] || ("icon" == b[l] && h)) h.externalGraphic = e[l];
19032                          else if ("iconSize" == b[l] && h) {
19033                              var m = e[l].split(",");
19034                              h.graphicWidth = parseFloat(m[0]);
19035                              h.graphicHeight = parseFloat(m[1]);
19036                          } else
19037                              "iconOffset" == b[l] && h
19038                                  ? ((m = e[l].split(",")), (h.graphicXOffset = parseFloat(m[0])), (h.graphicYOffset = parseFloat(m[1])))
19039                                  : "description" == b[l]
19040                                  ? (g.description = e[l])
19041                                  : "overflow" == b[l]
19042                                  ? (g.overflow = e[l])
19043                                  : (g[b[l]] = e[l]);
19044                  k && (this.internalProjection && this.externalProjection && f.transform(this.externalProjection, this.internalProjection), (e = new OpenLayers.Feature.Vector(f, g, h)), c.push(e));
19045              } else b = e.split("\t");
19046      }
19047      return c;
19048  },
19049  CLASS_NAME: "OpenLayers.Format.Text",
19050});
19051OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
19052  location: null,
19053  features: null,
19054  formatOptions: null,
19055  selectedFeature: null,
19056  initialize: function (a, b) {
19057      OpenLayers.Layer.Markers.prototype.initialize.apply(this, arguments);
19058      this.features = [];
19059  },
19060  destroy: function () {
19061      OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments);
19062      this.clearFeatures();
19063      this.features = null;
19064  },
19065  loadText: function () {
19066      this.loaded ||
19067          null == this.location ||
19068          (this.events.triggerEvent("loadstart"),
19069          OpenLayers.Request.GET({
19070              url: this.location,
19071              success: this.parseData,
19072              failure: function (a) {
19073                  this.events.triggerEvent("loadend");
19074              },
19075              scope: this,
19076          }),
19077          (this.loaded = !0));
19078  },
19079  moveTo: function (a, b, c) {
19080      OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments);
19081      this.visibility && !this.loaded && this.loadText();
19082  },
19083  parseData: function (a) {
19084      a = a.responseText;
19085      var b = {};
19086      OpenLayers.Util.extend(b, this.formatOptions);
19087      this.map && !this.projection.equals(this.map.getProjectionObject()) && ((b.externalProjection = this.projection), (b.internalProjection = this.map.getProjectionObject()));
19088      a = new OpenLayers.Format.Text(b).read(a);
19089      for (var b = 0, c = a.length; b < c; b++) {
19090          var d = {},
19091              e = a[b],
19092              f,
19093              g,
19094              h;
19095          f = new OpenLayers.LonLat(e.geometry.x, e.geometry.y);
19096          e.style.graphicWidth && e.style.graphicHeight && (g = new OpenLayers.Size(e.style.graphicWidth, e.style.graphicHeight));
19097          void 0 !== e.style.graphicXOffset && void 0 !== e.style.graphicYOffset && (h = new OpenLayers.Pixel(e.style.graphicXOffset, e.style.graphicYOffset));
19098          null != e.style.externalGraphic ? (d.icon = new OpenLayers.Icon(e.style.externalGraphic, g, h)) : ((d.icon = OpenLayers.Marker.defaultIcon()), null != g && d.icon.setSize(g));
19099          null != e.attributes.title && null != e.attributes.description && (d.popupContentHTML = "<h2>" + e.attributes.title + "</h2><p>" + e.attributes.description + "</p>");
19100          d.overflow = e.attributes.overflow || "auto";
19101          d = new OpenLayers.Feature(this, f, d);
19102          this.features.push(d);
19103          f = d.createMarker();
19104          null != e.attributes.title && null != e.attributes.description && f.events.register("click", d, this.markerClick);
19105          this.addMarker(f);
19106      }
19107      this.events.triggerEvent("loadend");
19108  },
19109  markerClick: function (a) {
19110      var b = this == this.layer.selectedFeature;
19111      this.layer.selectedFeature = b ? null : this;
19112      for (var c = 0, d = this.layer.map.popups.length; c < d; c++) this.layer.map.removePopup(this.layer.map.popups[c]);
19113      b || this.layer.map.addPopup(this.createPopup());
19114      OpenLayers.Event.stop(a);
19115  },
19116  clearFeatures: function () {
19117      if (null != this.features)
19118          for (; 0 < this.features.length; ) {
19119              var a = this.features[0];
19120              OpenLayers.Util.removeItem(this.features, a);
19121              a.destroy();
19122          }
19123  },
19124  CLASS_NAME: "OpenLayers.Layer.Text",
19125});
19126OpenLayers.Handler.RegularPolygon = OpenLayers.Class(OpenLayers.Handler.Drag, {
19127  sides: 4,
19128  radius: null,
19129  snapAngle: null,
19130  snapToggle: "shiftKey",
19131  layerOptions: null,
19132  persist: !1,
19133  irregular: !1,
19134  citeCompliant: !1,
19135  angle: null,
19136  fixedRadius: !1,
19137  feature: null,
19138  layer: null,
19139  origin: null,
19140  initialize: function (a, b, c) {
19141      (c && c.layerOptions && c.layerOptions.styleMap) || (this.style = OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"], {}));
19142      OpenLayers.Handler.Drag.prototype.initialize.apply(this, [a, b, c]);
19143      this.options = c ? c : {};
19144  },
19145  setOptions: function (a) {
19146      OpenLayers.Util.extend(this.options, a);
19147      OpenLayers.Util.extend(this, a);
19148  },
19149  activate: function () {
19150      var a = !1;
19151      OpenLayers.Handler.Drag.prototype.activate.apply(this, arguments) &&
19152          ((a = OpenLayers.Util.extend({ displayInLayerSwitcher: !1, calculateInRange: OpenLayers.Function.True, wrapDateLine: this.citeCompliant }, this.layerOptions)),
19153          (this.layer = new OpenLayers.Layer.Vector(this.CLASS_NAME, a)),
19154          this.map.addLayer(this.layer),
19155          (a = !0));
19156      return a;
19157  },
19158  deactivate: function () {
19159      var a = !1;
19160      OpenLayers.Handler.Drag.prototype.deactivate.apply(this, arguments) &&
19161          (this.dragging && this.cancel(), null != this.layer.map && (this.layer.destroy(!1), this.feature && this.feature.destroy()), (this.feature = this.layer = null), (a = !0));
19162      return a;
19163  },
19164  down: function (a) {
19165      this.fixedRadius = !!this.radius;
19166      a = this.layer.getLonLatFromViewPortPx(a.xy);
19167      this.origin = new OpenLayers.Geometry.Point(a.lon, a.lat);
19168      if (!this.fixedRadius || this.irregular) this.radius = this.map.getResolution();
19169      this.persist && this.clear();
19170      this.feature = new OpenLayers.Feature.Vector();
19171      this.createGeometry();
19172      this.callback("create", [this.origin, this.feature]);
19173      this.layer.addFeatures([this.feature], { silent: !0 });
19174      this.layer.drawFeature(this.feature, this.style);
19175  },
19176  move: function (a) {
19177      var b = this.layer.getLonLatFromViewPortPx(a.xy),
19178          b = new OpenLayers.Geometry.Point(b.lon, b.lat);
19179      this.irregular
19180          ? ((a = (Math.sqrt(2) * Math.abs(b.y - this.origin.y)) / 2), (this.radius = Math.max(this.map.getResolution() / 2, a)))
19181          : this.fixedRadius
19182          ? (this.origin = b)
19183          : (this.calculateAngle(b, a), (this.radius = Math.max(this.map.getResolution() / 2, b.distanceTo(this.origin))));
19184      this.modifyGeometry();
19185      if (this.irregular) {
19186          a = b.x - this.origin.x;
19187          var b = b.y - this.origin.y,
19188              c;
19189          c = 0 == b ? a / (this.radius * Math.sqrt(2)) : a / b;
19190          this.feature.geometry.resize(1, this.origin, c);
19191          this.feature.geometry.move(a / 2, b / 2);
19192      }
19193      this.layer.drawFeature(this.feature, this.style);
19194  },
19195  up: function (a) {
19196      this.finalize();
19197      this.start == this.last && this.callback("done", [a.xy]);
19198  },
19199  out: function (a) {
19200      this.finalize();
19201  },
19202  createGeometry: function () {
19203      this.angle = Math.PI * (1 / this.sides - 0.5);
19204      this.snapAngle && (this.angle += this.snapAngle * (Math.PI / 180));
19205      this.feature.geometry = OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin, this.radius, this.sides, this.snapAngle);
19206  },
19207  modifyGeometry: function () {
19208      var a,
19209          b,
19210          c = this.feature.geometry.components[0];
19211      c.components.length != this.sides + 1 && (this.createGeometry(), (c = this.feature.geometry.components[0]));
19212      for (var d = 0; d < this.sides; ++d) (b = c.components[d]), (a = this.angle + (2 * d * Math.PI) / this.sides), (b.x = this.origin.x + this.radius * Math.cos(a)), (b.y = this.origin.y + this.radius * Math.sin(a)), b.clearBounds();
19213  },
19214  calculateAngle: function (a, b) {
19215      var c = Math.atan2(a.y - this.origin.y, a.x - this.origin.x);
19216      if (this.snapAngle && this.snapToggle && !b[this.snapToggle]) {
19217          var d = (Math.PI / 180) * this.snapAngle;
19218          this.angle = Math.round(c / d) * d;
19219      } else this.angle = c;
19220  },
19221  cancel: function () {
19222      this.callback("cancel", null);
19223      this.finalize();
19224  },
19225  finalize: function () {
19226      this.origin = null;
19227      this.radius = this.options.radius;
19228  },
19229  clear: function () {
19230      this.layer && (this.layer.renderer.clear(), this.layer.destroyFeatures());
19231  },
19232  callback: function (a, b) {
19233      this.callbacks[a] && this.callbacks[a].apply(this.control, [this.feature.geometry.clone()]);
19234      this.persist || ("done" != a && "cancel" != a) || this.clear();
19235  },
19236  CLASS_NAME: "OpenLayers.Handler.RegularPolygon",
19237});
19238OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
19239  clearOnDeactivate: !1,
19240  layers: null,
19241  callbacks: null,
19242  selectionSymbolizer: { Polygon: { fillColor: "#FF0000", stroke: !1 }, Line: { strokeColor: "#FF0000", strokeWidth: 2 }, Point: { graphicName: "square", fillColor: "#FF0000", pointRadius: 5 } },
19243  layerOptions: null,
19244  sketchStyle: null,
19245  wfsCache: {},
19246  layerCache: {},
19247  initialize: function (a, b) {
19248      OpenLayers.Control.prototype.initialize.apply(this, [b]);
19249      this.callbacks = OpenLayers.Util.extend({ done: this.select, click: this.select }, this.callbacks);
19250      this.handlerOptions = this.handlerOptions || {};
19251      this.layerOptions = OpenLayers.Util.applyDefaults(this.layerOptions, { displayInLayerSwitcher: !1, tileOptions: { maxGetUrlLength: 2048 } });
19252      this.sketchStyle && (this.handlerOptions.layerOptions = OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions, { styleMap: new OpenLayers.StyleMap({ default: this.sketchStyle }) }));
19253      this.handler = new a(this, this.callbacks, this.handlerOptions);
19254  },
19255  destroy: function () {
19256      for (var a in this.layerCache) delete this.layerCache[a];
19257      for (a in this.wfsCache) delete this.wfsCache[a];
19258      OpenLayers.Control.prototype.destroy.apply(this, arguments);
19259  },
19260  coupleLayerVisiblity: function (a) {
19261      this.setVisibility(a.object.getVisibility());
19262  },
19263  createSelectionLayer: function (a) {
19264      var b;
19265      if (this.layerCache[a.id]) b = this.layerCache[a.id];
19266      else {
19267          b = new OpenLayers.Layer.WMS(a.name, a.url, a.params, OpenLayers.Util.applyDefaults(this.layerOptions, a.getOptions()));
19268          this.layerCache[a.id] = b;
19269          if (!1 === this.layerOptions.displayInLayerSwitcher) a.events.on({ visibilitychanged: this.coupleLayerVisiblity, scope: b });
19270          this.map.addLayer(b);
19271      }
19272      return b;
19273  },
19274  createSLD: function (a, b, c) {
19275      for (var d = { version: "1.0.0", namedLayers: {} }, e = ("" + a.params.LAYERS).split(","), f = 0, g = e.length; f < g; f++) {
19276          var h = e[f];
19277          d.namedLayers[h] = { name: h, userStyles: [] };
19278          var k = this.selectionSymbolizer,
19279              l = c[f];
19280          0 <= l.type.indexOf("Polygon")
19281              ? (k = { Polygon: this.selectionSymbolizer.Polygon })
19282              : 0 <= l.type.indexOf("LineString")
19283              ? (k = { Line: this.selectionSymbolizer.Line })
19284              : 0 <= l.type.indexOf("Point") && (k = { Point: this.selectionSymbolizer.Point });
19285          d.namedLayers[h].userStyles.push({ name: "default", rules: [new OpenLayers.Rule({ symbolizer: k, filter: b[f], maxScaleDenominator: a.options.minScale })] });
19286      }
19287      return new OpenLayers.Format.SLD({ srsName: this.map.getProjection() }).write(d);
19288  },
19289  parseDescribeLayer: function (a) {
19290      var b = new OpenLayers.Format.WMSDescribeLayer(),
19291          c = a.responseXML;
19292      (c && c.documentElement) || (c = a.responseText);
19293      a = b.read(c);
19294      for (var b = [], c = null, d = 0, e = a.length; d < e; d++) "WFS" == a[d].owsType && (b.push(a[d].typeName), (c = a[d].owsURL));
19295      OpenLayers.Request.GET({
19296          url: c,
19297          params: { SERVICE: "WFS", TYPENAME: b.toString(), REQUEST: "DescribeFeatureType", VERSION: "1.0.0" },
19298          callback: function (a) {
19299              var b = new OpenLayers.Format.WFSDescribeFeatureType(),
19300                  c = a.responseXML;
19301              (c && c.documentElement) || (c = a.responseText);
19302              a = b.read(c);
19303              this.control.wfsCache[this.layer.id] = a;
19304              this.control._queue && this.control.applySelection();
19305          },
19306          scope: this,
19307      });
19308  },
19309  getGeometryAttributes: function (a) {
19310      var b = [];
19311      a = this.wfsCache[a.id];
19312      for (var c = 0, d = a.featureTypes.length; c < d; c++)
19313          for (var e = a.featureTypes[c].properties, f = 0, g = e.length; f < g; f++) {
19314              var h = e[f],
19315                  k = h.type;
19316              (0 <= k.indexOf("LineString") || 0 <= k.indexOf("GeometryAssociationType") || 0 <= k.indexOf("GeometryPropertyType") || 0 <= k.indexOf("Point") || 0 <= k.indexOf("Polygon")) && b.push(h);
19317          }
19318      return b;
19319  },
19320  activate: function () {
19321      var a = OpenLayers.Control.prototype.activate.call(this);
19322      if (a)
19323          for (var b = 0, c = this.layers.length; b < c; b++) {
19324              var d = this.layers[b];
19325              d &&
19326                  !this.wfsCache[d.id] &&
19327                  OpenLayers.Request.GET({ url: d.url, params: { SERVICE: "WMS", VERSION: d.params.VERSION, LAYERS: d.params.LAYERS, REQUEST: "DescribeLayer" }, callback: this.parseDescribeLayer, scope: { layer: d, control: this } });
19328          }
19329      return a;
19330  },
19331  deactivate: function () {
19332      var a = OpenLayers.Control.prototype.deactivate.call(this);
19333      if (a)
19334          for (var b = 0, c = this.layers.length; b < c; b++) {
19335              var d = this.layers[b];
19336              if (d && !0 === this.clearOnDeactivate) {
19337                  var e = this.layerCache,
19338                      f = e[d.id];
19339                  f && (d.events.un({ visibilitychanged: this.coupleLayerVisiblity, scope: f }), f.destroy(), delete e[d.id]);
19340              }
19341          }
19342      return a;
19343  },
19344  setLayers: function (a) {
19345      this.active ? (this.deactivate(), (this.layers = a), this.activate()) : (this.layers = a);
19346  },
19347  createFilter: function (a, b) {
19348      var c = null;
19349      this.handler instanceof OpenLayers.Handler.RegularPolygon
19350          ? (c =
19351                !0 === this.handler.irregular
19352                    ? new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.BBOX, property: a.name, value: b.getBounds() })
19353                    : new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.INTERSECTS, property: a.name, value: b }))
19354          : this.handler instanceof OpenLayers.Handler.Polygon
19355          ? (c = new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.INTERSECTS, property: a.name, value: b }))
19356          : this.handler instanceof OpenLayers.Handler.Path
19357          ? (c =
19358                0 <= a.type.indexOf("Point")
19359                    ? new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.DWITHIN, property: a.name, distance: 0.01 * this.map.getExtent().getWidth(), distanceUnits: this.map.getUnits(), value: b })
19360                    : new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.INTERSECTS, property: a.name, value: b }))
19361          : this.handler instanceof OpenLayers.Handler.Click &&
19362            (c =
19363                0 <= a.type.indexOf("Polygon")
19364                    ? new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.INTERSECTS, property: a.name, value: b })
19365                    : new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.DWITHIN, property: a.name, distance: 0.01 * this.map.getExtent().getWidth(), distanceUnits: this.map.getUnits(), value: b }));
19366      return c;
19367  },
19368  select: function (a) {
19369      this._queue = function () {
19370          for (var b = 0, c = this.layers.length; b < c; b++) {
19371              for (var d = this.layers[b], e = this.getGeometryAttributes(d), f = [], g = 0, h = e.length; g < h; g++) {
19372                  var k = e[g];
19373                  if (null !== k) {
19374                      if (!(a instanceof OpenLayers.Geometry)) {
19375                          var l = this.map.getLonLatFromPixel(a.xy);
19376                          a = new OpenLayers.Geometry.Point(l.lon, l.lat);
19377                      }
19378                      k = this.createFilter(k, a);
19379                      null !== k && f.push(k);
19380                  }
19381              }
19382              g = this.createSelectionLayer(d);
19383              this.events.triggerEvent("selected", { layer: d, filters: f });
19384              d = this.createSLD(d, f, e);
19385              g.mergeNewParams({ SLD_BODY: d });
19386              delete this._queue;
19387          }
19388      };
19389      this.applySelection();
19390  },
19391  applySelection: function () {
19392      for (var a = !0, b = 0, c = this.layers.length; b < c; b++)
19393          if (!this.wfsCache[this.layers[b].id]) {
19394              a = !1;
19395              break;
19396          }
19397      a && this._queue.call(this);
19398  },
19399  CLASS_NAME: "OpenLayers.Control.SLDSelect",
19400});
19401OpenLayers.Control.Scale = OpenLayers.Class(OpenLayers.Control, {
19402  element: null,
19403  geodesic: !1,
19404  initialize: function (a, b) {
19405      OpenLayers.Control.prototype.initialize.apply(this, [b]);
19406      this.element = OpenLayers.Util.getElement(a);
19407  },
19408  draw: function () {
19409      OpenLayers.Control.prototype.draw.apply(this, arguments);
19410      this.element || ((this.element = document.createElement("div")), this.div.appendChild(this.element));
19411      this.map.events.register("moveend", this, this.updateScale);
19412      this.updateScale();
19413      return this.div;
19414  },
19415  updateScale: function () {
19416      var a;
19417      if (!0 === this.geodesic) {
19418          if (!this.map.getUnits()) return;
19419          a = OpenLayers.INCHES_PER_UNIT;
19420          a = (this.map.getGeodesicPixelSize().w || 1e-6) * a.km * OpenLayers.DOTS_PER_INCH;
19421      } else a = this.map.getScale();
19422      a && ((a = 9500 <= a && 95e4 >= a ? Math.round(a / 1e3) + "K" : 95e4 <= a ? Math.round(a / 1e6) + "M" : Math.round(a)), (this.element.innerHTML = OpenLayers.i18n("Scale = 1 : ${scaleDenom}", { scaleDenom: a })));
19423  },
19424  CLASS_NAME: "OpenLayers.Control.Scale",
19425});
19426OpenLayers.Layer.MapGuide = OpenLayers.Class(OpenLayers.Layer.Grid, {
19427  isBaseLayer: !0,
19428  useHttpTile: !1,
19429  singleTile: !1,
19430  useOverlay: !1,
19431  useAsyncOverlay: !0,
19432  TILE_PARAMS: { operation: "GETTILEIMAGE", version: "1.2.0" },
19433  SINGLE_TILE_PARAMS: { operation: "GETMAPIMAGE", format: "PNG", locale: "en", clip: "1", version: "1.0.0" },
19434  OVERLAY_PARAMS: { operation: "GETDYNAMICMAPOVERLAYIMAGE", format: "PNG", locale: "en", clip: "1", version: "2.0.0" },
19435  FOLDER_PARAMS: { tileColumnsPerFolder: 30, tileRowsPerFolder: 30, format: "png", querystring: null },
19436  defaultSize: new OpenLayers.Size(300, 300),
19437  tileOriginCorner: "tl",
19438  initialize: function (a, b, c, d) {
19439      OpenLayers.Layer.Grid.prototype.initialize.apply(this, arguments);
19440      if (null == d || null == d.isBaseLayer) this.isBaseLayer = "true" != this.transparent && !0 != this.transparent;
19441      d && null != d.useOverlay && (this.useOverlay = d.useOverlay);
19442      this.singleTile
19443          ? this.useOverlay
19444              ? (OpenLayers.Util.applyDefaults(this.params, this.OVERLAY_PARAMS), this.useAsyncOverlay || (this.params.version = "1.0.0"))
19445              : OpenLayers.Util.applyDefaults(this.params, this.SINGLE_TILE_PARAMS)
19446          : (this.useHttpTile ? OpenLayers.Util.applyDefaults(this.params, this.FOLDER_PARAMS) : OpenLayers.Util.applyDefaults(this.params, this.TILE_PARAMS), this.setTileSize(this.defaultSize));
19447  },
19448  clone: function (a) {
19449      null == a && (a = new OpenLayers.Layer.MapGuide(this.name, this.url, this.params, this.getOptions()));
19450      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
19451  },
19452  getURL: function (a) {
19453      var b;
19454      b = a.getCenterLonLat();
19455      var c = this.map.getSize();
19456      this.singleTile
19457          ? ((a = { setdisplaydpi: OpenLayers.DOTS_PER_INCH, setdisplayheight: c.h * this.ratio, setdisplaywidth: c.w * this.ratio, setviewcenterx: b.lon, setviewcentery: b.lat, setviewscale: this.map.getScale() }),
19458            this.useOverlay &&
19459                !this.useAsyncOverlay &&
19460                ((b = {}),
19461                (b = OpenLayers.Util.extend(b, a)),
19462                (b.operation = "GETVISIBLEMAPEXTENT"),
19463                (b.version = "1.0.0"),
19464                (b.session = this.params.session),
19465                (b.mapName = this.params.mapName),
19466                (b.format = "text/xml"),
19467                (b = this.getFullRequestString(b)),
19468                OpenLayers.Request.GET({ url: b, async: !1 })),
19469            (b = this.getFullRequestString(a)))
19470          : ((c = this.map.getResolution()),
19471            (b = Math.floor((a.left - this.maxExtent.left) / c)),
19472            (b = Math.round(b / this.tileSize.w)),
19473            (a = Math.floor((this.maxExtent.top - a.top) / c)),
19474            (a = Math.round(a / this.tileSize.h)),
19475            (b = this.useHttpTile
19476                ? this.getImageFilePath({ tilecol: b, tilerow: a, scaleindex: this.resolutions.length - this.map.zoom - 1 })
19477                : this.getFullRequestString({ tilecol: b, tilerow: a, scaleindex: this.resolutions.length - this.map.zoom - 1 })));
19478      return b;
19479  },
19480  getFullRequestString: function (a, b) {
19481      var c = null == b ? this.url : b;
19482      "object" == typeof c && (c = c[Math.floor(Math.random() * c.length)]);
19483      var d = c,
19484          e = OpenLayers.Util.extend({}, this.params),
19485          e = OpenLayers.Util.extend(e, a),
19486          f = OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c)),
19487          g;
19488      for (g in e) g.toUpperCase() in f && delete e[g];
19489      e = OpenLayers.Util.getParameterString(e);
19490      e = e.replace(/,/g, "+");
19491      "" != e && ((f = c.charAt(c.length - 1)), (d = "&" == f || "?" == f ? d + e : -1 == c.indexOf("?") ? d + ("?" + e) : d + ("&" + e)));
19492      return d;
19493  },
19494  getImageFilePath: function (a, b) {
19495      var c = null == b ? this.url : b;
19496      "object" == typeof c && (c = c[Math.floor(Math.random() * c.length)]);
19497      var d = "",
19498          e = "";
19499      0 > a.tilerow && (d = "-");
19500      d = 0 == a.tilerow ? d + "0" : d + Math.floor(Math.abs(a.tilerow / this.params.tileRowsPerFolder)) * this.params.tileRowsPerFolder;
19501      0 > a.tilecol && (e = "-");
19502      e = 0 == a.tilecol ? e + "0" : e + Math.floor(Math.abs(a.tilecol / this.params.tileColumnsPerFolder)) * this.params.tileColumnsPerFolder;
19503      d =
19504          "/S" +
19505          Math.floor(a.scaleindex) +
19506          "/" +
19507          this.params.basemaplayergroupname +
19508          "/R" +
19509          d +
19510          "/C" +
19511          e +
19512          "/" +
19513          (a.tilerow % this.params.tileRowsPerFolder) +
19514          "_" +
19515          (a.tilecol % this.params.tileColumnsPerFolder) +
19516          "." +
19517          this.params.format;
19518      this.params.querystring && (d += "?" + this.params.querystring);
19519      return c + d;
19520  },
19521  CLASS_NAME: "OpenLayers.Layer.MapGuide",
19522});
19523OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
19524  callbacks: null,
19525  displaySystem: "metric",
19526  geodesic: !1,
19527  displaySystemUnits: { geographic: ["dd"], english: ["mi", "ft", "in"], metric: ["km", "m"] },
19528  partialDelay: 300,
19529  delayedTrigger: null,
19530  persist: !1,
19531  immediate: !1,
19532  initialize: function (a, b) {
19533      OpenLayers.Control.prototype.initialize.apply(this, [b]);
19534      var c = { done: this.measureComplete, point: this.measurePartial };
19535      this.immediate && (c.modify = this.measureImmediate);
19536      this.callbacks = OpenLayers.Util.extend(c, this.callbacks);
19537      this.handlerOptions = OpenLayers.Util.extend({ persist: this.persist }, this.handlerOptions);
19538      this.handler = new a(this, this.callbacks, this.handlerOptions);
19539  },
19540  deactivate: function () {
19541      this.cancelDelay();
19542      return OpenLayers.Control.prototype.deactivate.apply(this, arguments);
19543  },
19544  cancel: function () {
19545      this.cancelDelay();
19546      this.handler.cancel();
19547  },
19548  setImmediate: function (a) {
19549      (this.immediate = a) ? (this.callbacks.modify = this.measureImmediate) : delete this.callbacks.modify;
19550  },
19551  updateHandler: function (a, b) {
19552      var c = this.active;
19553      c && this.deactivate();
19554      this.handler = new a(this, this.callbacks, b);
19555      c && this.activate();
19556  },
19557  measureComplete: function (a) {
19558      this.cancelDelay();
19559      this.measure(a, "measure");
19560  },
19561  measurePartial: function (a, b) {
19562      this.cancelDelay();
19563      b = b.clone();
19564      this.handler.freehandMode(this.handler.evt)
19565          ? this.measure(b, "measurepartial")
19566          : (this.delayedTrigger = window.setTimeout(
19567                OpenLayers.Function.bind(function () {
19568                    this.delayedTrigger = null;
19569                    this.measure(b, "measurepartial");
19570                }, this),
19571                this.partialDelay
19572            ));
19573  },
19574  measureImmediate: function (a, b, c) {
19575      c && !this.handler.freehandMode(this.handler.evt) && (this.cancelDelay(), this.measure(b.geometry, "measurepartial"));
19576  },
19577  cancelDelay: function () {
19578      null !== this.delayedTrigger && (window.clearTimeout(this.delayedTrigger), (this.delayedTrigger = null));
19579  },
19580  measure: function (a, b) {
19581      var c, d;
19582      -1 < a.CLASS_NAME.indexOf("LineString") ? ((c = this.getBestLength(a)), (d = 1)) : ((c = this.getBestArea(a)), (d = 2));
19583      this.events.triggerEvent(b, { measure: c[0], units: c[1], order: d, geometry: a });
19584  },
19585  getBestArea: function (a) {
19586      for (var b = this.displaySystemUnits[this.displaySystem], c, d, e = 0, f = b.length; e < f && !((c = b[e]), (d = this.getArea(a, c)), 1 < d); ++e);
19587      return [d, c];
19588  },
19589  getArea: function (a, b) {
19590      var c, d;
19591      this.geodesic ? ((c = a.getGeodesicArea(this.map.getProjectionObject())), (d = "m")) : ((c = a.getArea()), (d = this.map.getUnits()));
19592      var e = OpenLayers.INCHES_PER_UNIT[b];
19593      e && (c *= Math.pow(OpenLayers.INCHES_PER_UNIT[d] / e, 2));
19594      return c;
19595  },
19596  getBestLength: function (a) {
19597      for (var b = this.displaySystemUnits[this.displaySystem], c, d, e = 0, f = b.length; e < f && !((c = b[e]), (d = this.getLength(a, c)), 1 < d); ++e);
19598      return [d, c];
19599  },
19600  getLength: function (a, b) {
19601      var c, d;
19602      this.geodesic ? ((c = a.getGeodesicLength(this.map.getProjectionObject())), (d = "m")) : ((c = a.getLength()), (d = this.map.getUnits()));
19603      var e = OpenLayers.INCHES_PER_UNIT[b];
19604      e && (c *= OpenLayers.INCHES_PER_UNIT[d] / e);
19605      return c;
19606  },
19607  CLASS_NAME: "OpenLayers.Control.Measure",
19608});
19609OpenLayers.Format.WMC.v1_0_0 = OpenLayers.Class(OpenLayers.Format.WMC.v1, {
19610  VERSION: "1.0.0",
19611  schemaLocation: "http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd",
19612  initialize: function (a) {
19613      OpenLayers.Format.WMC.v1.prototype.initialize.apply(this, [a]);
19614  },
19615  read_wmc_SRS: function (a, b) {
19616      var c = this.getChildValue(b);
19617      "object" != typeof a.projections && (a.projections = {});
19618      for (var c = c.split(/ +/), d = 0, e = c.length; d < e; d++) a.projections[c[d]] = !0;
19619  },
19620  write_wmc_Layer: function (a) {
19621      var b = OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this, [a]);
19622      if (a.srs) {
19623          var c = [],
19624              d;
19625          for (d in a.srs) c.push(d);
19626          b.appendChild(this.createElementDefaultNS("SRS", c.join(" ")));
19627      }
19628      b.appendChild(this.write_wmc_FormatList(a));
19629      b.appendChild(this.write_wmc_StyleList(a));
19630      a.dimensions && b.appendChild(this.write_wmc_DimensionList(a));
19631      b.appendChild(this.write_wmc_LayerExtension(a));
19632  },
19633  CLASS_NAME: "OpenLayers.Format.WMC.v1_0_0",
19634});
19635OpenLayers.Popup.Anchored = OpenLayers.Class(OpenLayers.Popup, {
19636  relativePosition: null,
19637  keepInMap: !0,
19638  anchor: null,
19639  initialize: function (a, b, c, d, e, f, g) {
19640      OpenLayers.Popup.prototype.initialize.apply(this, [a, b, c, d, f, g]);
19641      this.anchor = null != e ? e : { size: new OpenLayers.Size(0, 0), offset: new OpenLayers.Pixel(0, 0) };
19642  },
19643  destroy: function () {
19644      this.relativePosition = this.anchor = null;
19645      OpenLayers.Popup.prototype.destroy.apply(this, arguments);
19646  },
19647  show: function () {
19648      this.updatePosition();
19649      OpenLayers.Popup.prototype.show.apply(this, arguments);
19650  },
19651  moveTo: function (a) {
19652      var b = this.relativePosition;
19653      this.relativePosition = this.calculateRelativePosition(a);
19654      OpenLayers.Popup.prototype.moveTo.call(this, this.calculateNewPx(a));
19655      this.relativePosition != b && this.updateRelativePosition();
19656  },
19657  setSize: function (a) {
19658      OpenLayers.Popup.prototype.setSize.apply(this, arguments);
19659      if (this.lonlat && this.map) {
19660          var b = this.map.getLayerPxFromLonLat(this.lonlat);
19661          this.moveTo(b);
19662      }
19663  },
19664  calculateRelativePosition: function (a) {
19665      a = this.map.getLonLatFromLayerPx(a);
19666      a = this.map.getExtent().determineQuadrant(a);
19667      return OpenLayers.Bounds.oppositeQuadrant(a);
19668  },
19669  updateRelativePosition: function () {},
19670  calculateNewPx: function (a) {
19671      a = a.offset(this.anchor.offset);
19672      var b = this.size || this.contentSize,
19673          c = "t" == this.relativePosition.charAt(0);
19674      a.y += c ? -b.h : this.anchor.size.h;
19675      c = "l" == this.relativePosition.charAt(1);
19676      a.x += c ? -b.w : this.anchor.size.w;
19677      return a;
19678  },
19679  CLASS_NAME: "OpenLayers.Popup.Anchored",
19680});
19681OpenLayers.Popup.Framed = OpenLayers.Class(OpenLayers.Popup.Anchored, {
19682  imageSrc: null,
19683  imageSize: null,
19684  isAlphaImage: !1,
19685  positionBlocks: null,
19686  blocks: null,
19687  fixedRelativePosition: !1,
19688  initialize: function (a, b, c, d, e, f, g) {
19689      OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments);
19690      this.fixedRelativePosition &&
19691          (this.updateRelativePosition(),
19692          (this.calculateRelativePosition = function (a) {
19693              return this.relativePosition;
19694          }));
19695      this.contentDiv.style.position = "absolute";
19696      this.contentDiv.style.zIndex = 1;
19697      f && (this.closeDiv.style.zIndex = 1);
19698      this.groupDiv.style.position = "absolute";
19699      this.groupDiv.style.top = "0px";
19700      this.groupDiv.style.left = "0px";
19701      this.groupDiv.style.height = "100%";
19702      this.groupDiv.style.width = "100%";
19703  },
19704  destroy: function () {
19705      this.isAlphaImage = this.imageSize = this.imageSrc = null;
19706      this.fixedRelativePosition = !1;
19707      this.positionBlocks = null;
19708      for (var a = 0; a < this.blocks.length; a++) {
19709          var b = this.blocks[a];
19710          b.image && b.div.removeChild(b.image);
19711          b.image = null;
19712          b.div && this.groupDiv.removeChild(b.div);
19713          b.div = null;
19714      }
19715      this.blocks = null;
19716      OpenLayers.Popup.Anchored.prototype.destroy.apply(this, arguments);
19717  },
19718  setBackgroundColor: function (a) {},
19719  setBorder: function () {},
19720  setOpacity: function (a) {},
19721  setSize: function (a) {
19722      OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments);
19723      this.updateBlocks();
19724  },
19725  updateRelativePosition: function () {
19726      this.padding = this.positionBlocks[this.relativePosition].padding;
19727      if (this.closeDiv) {
19728          var a = this.getContentDivPadding();
19729          this.closeDiv.style.right = a.right + this.padding.right + "px";
19730          this.closeDiv.style.top = a.top + this.padding.top + "px";
19731      }
19732      this.updateBlocks();
19733  },
19734  calculateNewPx: function (a) {
19735      var b = OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this, arguments);
19736      return (b = b.offset(this.positionBlocks[this.relativePosition].offset));
19737  },
19738  createBlocks: function () {
19739      this.blocks = [];
19740      var a = null,
19741          b;
19742      for (b in this.positionBlocks) {
19743          a = b;
19744          break;
19745      }
19746      a = this.positionBlocks[a];
19747      for (b = 0; b < a.blocks.length; b++) {
19748          var c = {};
19749          this.blocks.push(c);
19750          c.div = OpenLayers.Util.createDiv(this.id + "_FrameDecorationDiv_" + b, null, null, null, "absolute", null, "hidden", null);
19751          c.image = (this.isAlphaImage ? OpenLayers.Util.createAlphaImageDiv : OpenLayers.Util.createImage)(this.id + "_FrameDecorationImg_" + b, null, this.imageSize, this.imageSrc, "absolute", null, null, null);
19752          c.div.appendChild(c.image);
19753          this.groupDiv.appendChild(c.div);
19754      }
19755  },
19756  updateBlocks: function () {
19757      this.blocks || this.createBlocks();
19758      if (this.size && this.relativePosition) {
19759          for (var a = this.positionBlocks[this.relativePosition], b = 0; b < a.blocks.length; b++) {
19760              var c = a.blocks[b],
19761                  d = this.blocks[b],
19762                  e = c.anchor.left,
19763                  f = c.anchor.bottom,
19764                  g = c.anchor.right,
19765                  h = c.anchor.top,
19766                  k = isNaN(c.size.w) ? this.size.w - (g + e) : c.size.w,
19767                  l = isNaN(c.size.h) ? this.size.h - (f + h) : c.size.h;
19768              d.div.style.width = (0 > k ? 0 : k) + "px";
19769              d.div.style.height = (0 > l ? 0 : l) + "px";
19770              d.div.style.left = null != e ? e + "px" : "";
19771              d.div.style.bottom = null != f ? f + "px" : "";
19772              d.div.style.right = null != g ? g + "px" : "";
19773              d.div.style.top = null != h ? h + "px" : "";
19774              d.image.style.left = c.position.x + "px";
19775              d.image.style.top = c.position.y + "px";
19776          }
19777          this.contentDiv.style.left = this.padding.left + "px";
19778          this.contentDiv.style.top = this.padding.top + "px";
19779      }
19780  },
19781  CLASS_NAME: "OpenLayers.Popup.Framed",
19782});
19783OpenLayers.Popup.FramedCloud = OpenLayers.Class(OpenLayers.Popup.Framed, {
19784  contentDisplayClass: "olFramedCloudPopupContent",
19785  autoSize: !0,
19786  panMapIfOutOfView: !0,
19787  imageSize: new OpenLayers.Size(1276, 736),
19788  isAlphaImage: !1,
19789  fixedRelativePosition: !1,
19790  positionBlocks: {
19791      tl: {
19792          offset: new OpenLayers.Pixel(44, 0),
19793          padding: new OpenLayers.Bounds(8, 40, 8, 9),
19794          blocks: [
19795              { size: new OpenLayers.Size("auto", "auto"), anchor: new OpenLayers.Bounds(0, 51, 22, 0), position: new OpenLayers.Pixel(0, 0) },
19796              { size: new OpenLayers.Size(22, "auto"), anchor: new OpenLayers.Bounds(null, 50, 0, 0), position: new OpenLayers.Pixel(-1238, 0) },
19797              { size: new OpenLayers.Size("auto", 19), anchor: new OpenLayers.Bounds(0, 32, 22, null), position: new OpenLayers.Pixel(0, -631) },
19798              { size: new OpenLayers.Size(22, 18), anchor: new OpenLayers.Bounds(null, 32, 0, null), position: new OpenLayers.Pixel(-1238, -632) },
19799              { size: new OpenLayers.Size(81, 35), anchor: new OpenLayers.Bounds(null, 0, 0, null), position: new OpenLayers.Pixel(0, -688) },
19800          ],
19801      },
19802      tr: {
19803          offset: new OpenLayers.Pixel(-45, 0),
19804          padding: new OpenLayers.Bounds(8, 40, 8, 9),
19805          blocks: [
19806              { size: new OpenLayers.Size("auto", "auto"), anchor: new OpenLayers.Bounds(0, 51, 22, 0), position: new OpenLayers.Pixel(0, 0) },
19807              { size: new OpenLayers.Size(22, "auto"), anchor: new OpenLayers.Bounds(null, 50, 0, 0), position: new OpenLayers.Pixel(-1238, 0) },
19808              { size: new OpenLayers.Size("auto", 19), anchor: new OpenLayers.Bounds(0, 32, 22, null), position: new OpenLayers.Pixel(0, -631) },
19809              { size: new OpenLayers.Size(22, 19), anchor: new OpenLayers.Bounds(null, 32, 0, null), position: new OpenLayers.Pixel(-1238, -631) },
19810              { size: new OpenLayers.Size(81, 35), anchor: new OpenLayers.Bounds(0, 0, null, null), position: new OpenLayers.Pixel(-215, -687) },
19811          ],
19812      },
19813      bl: {
19814          offset: new OpenLayers.Pixel(45, 0),
19815          padding: new OpenLayers.Bounds(8, 9, 8, 40),
19816          blocks: [
19817              { size: new OpenLayers.Size("auto", "auto"), anchor: new OpenLayers.Bounds(0, 21, 22, 32), position: new OpenLayers.Pixel(0, 0) },
19818              { size: new OpenLayers.Size(22, "auto"), anchor: new OpenLayers.Bounds(null, 21, 0, 32), position: new OpenLayers.Pixel(-1238, 0) },
19819              { size: new OpenLayers.Size("auto", 21), anchor: new OpenLayers.Bounds(0, 0, 22, null), position: new OpenLayers.Pixel(0, -629) },
19820              { size: new OpenLayers.Size(22, 21), anchor: new OpenLayers.Bounds(null, 0, 0, null), position: new OpenLayers.Pixel(-1238, -629) },
19821              { size: new OpenLayers.Size(81, 33), anchor: new OpenLayers.Bounds(null, null, 0, 0
19821), position: new OpenLayers.Pixel(-101, -674) },
19822          ],
19823      },
19824      br: {
19825          offset: new OpenLayers.Pixel(-44, 0),
19826          padding: new OpenLayers.Bounds(8, 9, 8, 40),
19827          blocks: [
19828              { size: new OpenLayers.Size("auto", "auto"), anchor: new OpenLayers.Bounds(0, 21, 22, 32), position: new OpenLayers.Pixel(0, 0) },
19829              { size: new OpenLayers.Size(22, "auto"), anchor: new OpenLayers.Bounds(null, 21, 0, 32), position: new OpenLayers.Pixel(-1238, 0) },
19830              { size: new OpenLayers.Size("auto", 21), anchor: new OpenLayers.Bounds(0, 0, 22, null), position: new OpenLayers.Pixel(0, -629) },
19831              { size: new OpenLayers.Size(22, 21), anchor: new OpenLayers.Bounds(null, 0, 0, null), position: new OpenLayers.Pixel(-1238, -629) },
19832              { size: new OpenLayers.Size(81, 33), anchor: new OpenLayers.Bounds(0, null, null, 0), position: new OpenLayers.Pixel(-311, -674) },
19833          ],
19834      },
19835  },
19836  minSize: new OpenLayers.Size(105, 10),
19837  maxSize: new OpenLayers.Size(1200, 660),
19838  initialize: function (a, b, c, d, e, f, g) {
19839      this.imageSrc = OpenLayers.Util.getImageLocation("cloud-popup-relative.png");
19840      OpenLayers.Popup.Framed.prototype.initialize.apply(this, arguments);
19841      this.contentDiv.className = this.contentDisplayClass;
19842  },
19843  CLASS_NAME: "OpenLayers.Popup.FramedCloud",
19844});
19845OpenLayers.Tile.Image.IFrame = {
19846  useIFrame: null,
19847  blankImageUrl: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAQAIBRAA7",
19848  draw: function () {
19849      if (OpenLayers.Tile.Image.prototype.shouldDraw.call(this)) {
19850          var a = this.layer.getURL(this.bounds),
19851              b = this.useIFrame;
19852          this.useIFrame = null !== this.maxGetUrlLength && !this.layer.async && a.length > this.maxGetUrlLength;
19853          a = b && !this.useIFrame;
19854          b = !b && this.useIFrame;
19855          if (a || b) this.imgDiv && this.imgDiv.parentNode === this.frame && this.frame.removeChild(this.imgDiv), (this.imgDiv = null), a && this.frame.removeChild(this.frame.firstChild);
19856      }
19857      return OpenLayers.Tile.Image.prototype.draw.apply(this, arguments);
19858  },
19859  getImage: function () {
19860      if (!0 === this.useIFrame) {
19861          if (!this.frame.childNodes.length) {
19862              var a = document.createElement("div"),
19863                  b = a.style;
19864              b.position = "absolute";
19865              b.width = "100%";
19866              b.height = "100%";
19867              b.zIndex = 1;
19868              b.backgroundImage = "url(" + this.blankImageUrl + ")";
19869              this.frame.appendChild(a);
19870          }
19871          a = this.id + "_iFrame";
19872          9 > parseFloat(navigator.appVersion.split("MSIE")[1])
19873              ? ((b = document.createElement('<iframe name="' + a + '">')), (b.style.backgroundColor = "#FFFFFF"), (b.style.filter = "chroma(color=#FFFFFF)"))
19874              : ((b = document.createElement("iframe")), (b.style.backgroundColor = "transparent"), (b.name = a));
19875          b.scrolling = "no";
19876          b.marginWidth = "0px";
19877          b.marginHeight = "0px";
19878          b.frameBorder = "0";
19879          b.style.position = "absolute";
19880          b.style.width = "100%";
19881          b.style.height = "100%";
19882          1 > this.layer.opacity && OpenLayers.Util.modifyDOMElement(b, null, null, null, null, null, null, this.layer.opacity);
19883          this.frame.appendChild(b);
19884          return (this.imgDiv = b);
19885      }
19886      return OpenLayers.Tile.Image.prototype.getImage.apply(this, arguments);
19887  },
19888  createRequestForm: function () {
19889      var a = document.createElement("form");
19890      a.method = "POST";
19891      var b = this.layer.params._OLSALT,
19892          b = (b ? b + "_" : "") + this.bounds.toBBOX();
19893      a.action = OpenLayers.Util.urlAppend(this.layer.url, b);
19894      a.target = this.id + "_iFrame";
19895      this.layer.getImageSize();
19896      var b = OpenLayers.Util.getParameters(this.url),
19897          c,
19898          d;
19899      for (d in b) (c = document.createElement("input")), (c.type = "hidden"), (c.name = d), (c.value = b[d]), a.appendChild(c);
19900      return a;
19901  },
19902  setImgSrc: function (a) {
19903      if (!0 === this.useIFrame)
19904          if (a) {
19905              var b = this.createRequestForm();
19906              this.frame.appendChild(b);
19907              b.submit();
19908              this.frame.removeChild(b);
19909          } else this.imgDiv.parentNode === this.frame && (this.frame.removeChild(this.imgDiv), (this.imgDiv = null));
19910      else OpenLayers.Tile.Image.prototype.setImgSrc.apply(this, arguments);
19911  },
19912  onImageLoad: function () {
19913      OpenLayers.Tile.Image.prototype.onImageLoad.apply(this, arguments);
19914      !0 === this.useIFrame && ((this.imgDiv.style.opacity = 1), (this.frame.style.opacity = this.layer.opacity));
19915  },
19916  createBackBuffer: function () {
19917      var a;
19918      !1 === this.useIFrame && (a = OpenLayers.Tile.Image.prototype.createBackBuffer.call(this));
19919      return a;
19920  },
19921};
19922OpenLayers.Format.SOSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { defaultVersion: "1.0.0", CLASS_NAME: "OpenLayers.Format.SOSCapabilities" });
19923OpenLayers.Format.SOSCapabilities.v1_0_0 = OpenLayers.Class(OpenLayers.Format.SOSCapabilities, {
19924  namespaces: { ows: "http://www.opengis.net/ows/1.1", sos: "http://www.opengis.net/sos/1.0", gml: "http://www.opengis.net/gml", xlink: "http://www.w3.org/1999/xlink" },
19925  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
19926  initialize: function (a) {
19927      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
19928      this.options = a;
19929  },
19930  read: function (a) {
19931      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
19932      a && 9 == a.nodeType && (a = a.documentElement);
19933      var b = {};
19934      this.readNode(a, b);
19935      return b;
19936  },
19937  readers: {
19938      gml: OpenLayers.Util.applyDefaults(
19939          {
19940              name: function (a, b) {
19941                  b.name = this.getChildValue(a);
19942              },
19943              TimePeriod: function (a, b) {
19944                  b.timePeriod = {};
19945                  this.readChildNodes(a, b.timePeriod);
19946              },
19947              beginPosition: function (a, b) {
19948                  b.beginPosition = this.getChildValue(a);
19949              },
19950              endPosition: function (a, b) {
19951                  b.endPosition = this.getChildValue(a);
19952              },
19953          },
19954          OpenLayers.Format.GML.v3.prototype.readers.gml
19955      ),
19956      sos: {
19957          Capabilities: function (a, b) {
19958              this.readChildNodes(a, b);
19959          },
19960          Contents: function (a, b) {
19961              b.contents = {};
19962              this.readChildNodes(a, b.contents);
19963          },
19964          ObservationOfferingList: function (a, b) {
19965              b.offeringList = {};
19966              this.readChildNodes(a, b.offeringList);
19967          },
19968          ObservationOffering: function (a, b) {
19969              var c = this.getAttributeNS(a, this.namespaces.gml, "id");
19970              b[c] = { procedures: [], observedProperties: [], featureOfInterestIds: [], responseFormats: [], resultModels: [], responseModes: [] };
19971              this.readChildNodes(a, b[c]);
19972          },
19973          time: function (a, b) {
19974              b.time = {};
19975              this.readChildNodes(a, b.time);
19976          },
19977          procedure: function (a, b) {
19978              b.procedures.push(this.getAttributeNS(a, this.namespaces.xlink, "href"));
19979          },
19980          observedProperty: function (a, b) {
19981              b.observedProperties.push(this.getAttributeNS(a, this.namespaces.xlink, "href"));
19982          },
19983          featureOfInterest: function (a, b) {
19984              b.featureOfInterestIds.push(this.getAttributeNS(a, this.namespaces.xlink, "href"));
19985          },
19986          responseFormat: function (a, b) {
19987              b.responseFormats.push(this.getChildValue(a));
19988          },
19989          resultModel: function (a, b) {
19990              b.resultModels.push(this.getChildValue(a));
19991          },
19992          responseMode: function (a, b) {
19993              b.responseModes.push(this.getChildValue(a));
19994          },
19995      },
19996      ows: OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows,
19997  },
19998  CLASS_NAME: "OpenLayers.Format.SOSCapabilities.v1_0_0",
19999});
20000OpenLayers.Handler.Pinch = OpenLayers.Class(OpenLayers.Handler, {
20001  started: !1,
20002  stopDown: !1,
20003  pinching: !1,
20004  last: null,
20005  start: null,
20006  touchstart: function (a) {
20007      var b = !0;
20008      this.pinching = !1;
20009      if (OpenLayers.Event.isMultiTouch(a)) (this.started = !0), (this.last = this.start = { distance: this.getDistance(a.touches), delta: 0, scale: 1 }), this.callback("start", [a, this.start]), (b = !this.stopDown);
20010      else {
20011          if (this.started) return !1;
20012          this.started = !1;
20013          this.last = this.start = null;
20014      }
20015      OpenLayers.Event.preventDefault(a);
20016      return b;
20017  },
20018  touchmove: function (a) {
20019      if (this.started && OpenLayers.Event.isMultiTouch(a)) {
20020          this.pinching = !0;
20021          var b = this.getPinchData(a);
20022          this.callback("move", [a, b]);
20023          this.last = b;
20024          OpenLayers.Event.stop(a);
20025      } else if (this.started) return !1;
20026      return !0;
20027  },
20028  touchend: function (a) {
20029      return this.started && !OpenLayers.Event.isMultiTouch(a) ? ((this.pinching = this.started = !1), this.callback("done", [a, this.start, this.last]), (this.last = this.start = null), !1) : !0;
20030  },
20031  activate: function () {
20032      var a = !1;
20033      OpenLayers.Handler.prototype.activate.apply(this, arguments) && ((this.pinching = !1), (a = !0));
20034      return a;
20035  },
20036  deactivate: function () {
20037      var a = !1;
20038      OpenLayers.Handler.prototype.deactivate.apply(this, arguments) && ((this.pinching = this.started = !1), (this.last = this.start = null), (a = !0));
20039      return a;
20040  },
20041  getDistance: function (a) {
20042      var b = a[0];
20043      a = a[1];
20044      return Math.sqrt(Math.pow(b.olClientX - a.olClientX, 2) + Math.pow(b.olClientY - a.olClientY, 2));
20045  },
20046  getPinchData: function (a) {
20047      a = this.getDistance(a.touches);
20048      return { distance: a, delta: this.last.distance - a, scale: a / this.start.distance };
20049  },
20050  CLASS_NAME: "OpenLayers.Handler.Pinch",
20051});
20052OpenLayers.Control.NavToolbar = OpenLayers.Class(OpenLayers.Control.Panel, {
20053  initialize: function (a) {
20054      OpenLayers.Control.Panel.prototype.initialize.apply(this, [a]);
20055      this.addControls([new OpenLayers.Control.Navigation(), new OpenLayers.Control.ZoomBox()]);
20056  },
20057  draw: function () {
20058      var a = OpenLayers.Control.Panel.prototype.draw.apply(this, arguments);
20059      null === this.defaultControl && (this.defaultControl = this.controls[0]);
20060      return a;
20061  },
20062  CLASS_NAME: "OpenLayers.Control.NavToolbar",
20063});
20064OpenLayers.Strategy.Refresh = OpenLayers.Class(OpenLayers.Strategy, {
20065  force: !1,
20066  interval: 0,
20067  timer: null,
20068  activate: function () {
20069      var a = OpenLayers.Strategy.prototype.activate.call(this);
20070      a && (!0 === this.layer.visibility && this.start(), this.layer.events.on({ visibilitychanged: this.reset, scope: this }));
20071      return a;
20072  },
20073  deactivate: function () {
20074      var a = OpenLayers.Strategy.prototype.deactivate.call(this);
20075      a && (this.stop(), this.layer.events.un({ visibilitychanged: this.reset, scope: this }));
20076      return a;
20077  },
20078  reset: function () {
20079      !0 === this.layer.visibility ? this.start() : this.stop();
20080  },
20081  start: function () {
20082      this.interval && "number" === typeof this.interval && 0 < this.interval && (this.timer = window.setInterval(OpenLayers.Function.bind(this.refresh, this), this.interval));
20083  },
20084  refresh: function () {
20085      this.layer && this.layer.refresh && "function" == typeof this.layer.refresh && this.layer.refresh({ force: this.force });
20086  },
20087  stop: function () {
20088      null !== this.timer && (window.clearInterval(this.timer), (this.timer = null));
20089  },
20090  CLASS_NAME: "OpenLayers.Strategy.Refresh",
20091});
20092OpenLayers.Layer.ArcGIS93Rest = OpenLayers.Class(OpenLayers.Layer.Grid, {
20093  DEFAULT_PARAMS: { format: "png" },
20094  isBaseLayer: !0,
20095  initialize: function (a, b, c, d) {
20096      var e = [];
20097      c = OpenLayers.Util.upperCaseObject(c);
20098      e.push(a, b, c, d);
20099      OpenLayers.Layer.Grid.prototype.initialize.apply(this, e);
20100      OpenLayers.Util.applyDefaults(this.params, OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));
20101      this.params.TRANSPARENT &&
20102          "true" == this.params.TRANSPARENT.toString().toLowerCase() &&
20103          ((null != d && d.isBaseLayer) || (this.isBaseLayer = !1), "jpg" == this.params.FORMAT && (this.params.FORMAT = OpenLayers.Util.alphaHack() ? "gif" : "png"));
20104  },
20105  clone: function (a) {
20106      null == a && (a = new OpenLayers.Layer.ArcGIS93Rest(this.name, this.url, this.params, this.getOptions()));
20107      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
20108  },
20109  getURL: function (a) {
20110      a = this.adjustBounds(a);
20111      var b = this.projection.getCode().split(":"),
20112          b = b[b.length - 1],
20113          c = this.getImageSize();
20114      a = { BBOX: a.toBBOX(), SIZE: c.w + "," + c.h, F: "image", BBOXSR: b, IMAGESR: b };
20115      if (this.layerDefs) {
20116          var b = [],
20117              d;
20118          for (d in this.layerDefs) this.layerDefs.hasOwnProperty(d) && this.layerDefs[d] && (b.push(d), b.push(":"), b.push(this.layerDefs[d]), b.push(";"));
20119          0 < b.length && (a.LAYERDEFS = b.join(""));
20120      }
20121      return this.getFullRequestString(a);
20122  },
20123  setLayerFilter: function (a, b) {
20124      this.layerDefs || (this.layerDefs = {});
20125      b ? (this.layerDefs[a] = b) : delete this.layerDefs[a];
20126  },
20127  clearLayerFilter: function (a) {
20128      a ? delete this.layerDefs[a] : delete this.layerDefs;
20129  },
20130  mergeNewParams: function (a) {
20131      a = [OpenLayers.Util.upperCaseObject(a)];
20132      return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this, a);
20133  },
20134  CLASS_NAME: "OpenLayers.Layer.ArcGIS93Rest",
20135});
20136OpenLayers.Handler.Hover = OpenLayers.Class(OpenLayers.Handler, {
20137  delay: 500,
20138  pixelTolerance: null,
20139  stopMove: !1,
20140  px: null,
20141  timerId: null,
20142  mousemove: function (a) {
20143      this.passesTolerance(a.xy) &&
20144          (this.clearTimer(), this.callback("move", [a]), (this.px = a.xy), (a = OpenLayers.Util.extend({}, a)), (this.timerId = window.setTimeout(OpenLayers.Function.bind(this.delayedCall, this, a), this.delay)));
20145      return !this.stopMove;
20146  },
20147  mouseout: function (a) {
20148      OpenLayers.Util.mouseLeft(a, this.map.viewPortDiv) && (this.clearTimer(), this.callback("move", [a]));
20149      return !0;
20150  },
20151  passesTolerance: function (a) {
20152      var b = !0;
20153      this.pixelTolerance && this.px && Math.sqrt(Math.pow(this.px.x - a.x, 2) + Math.pow(this.px.y - a.y, 2)) < this.pixelTolerance && (b = !1);
20154      return b;
20155  },
20156  clearTimer: function () {
20157      null != this.timerId && (window.clearTimeout(this.timerId), (this.timerId = null));
20158  },
20159  delayedCall: function (a) {
20160      this.callback("pause", [a]);
20161  },
20162  deactivate: function () {
20163      var a = !1;
20164      OpenLayers.Handler.prototype.deactivate.apply(this, arguments) && (this.clearTimer(), (a = !0));
20165      return a;
20166  },
20167  CLASS_NAME: "OpenLayers.Handler.Hover",
20168});
20169OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
20170  protocol: null,
20171  multipleKey: null,
20172  toggleKey: null,
20173  modifiers: null,
20174  multiple: !1,
20175  click: !0,
20176  single: !0,
20177  clickout: !0,
20178  toggle: !1,
20179  clickTolerance: 5,
20180  hover: !1,
20181  box: !1,
20182  maxFeatures: 10,
20183  features: null,
20184  hoverFeature: null,
20185  handlers: null,
20186  hoverResponse: null,
20187  filterType: OpenLayers.Filter.Spatial.BBOX,
20188  initialize: function (a) {
20189      a.handlerOptions = a.handlerOptions || {};
20190      OpenLayers.Control.prototype.initialize.apply(this, [a]);
20191      this.features = {};
20192      this.handlers = {};
20193      this.click && (this.handlers.click = new OpenLayers.Handler.Click(this, { click: this.selectClick }, this.handlerOptions.click || {}));
20194      this.box && (this.handlers.box = new OpenLayers.Handler.Box(this, { done: this.selectBox }, OpenLayers.Util.extend(this.handlerOptions.box, { boxDivClassName: "olHandlerBoxSelectFeature" })));
20195      this.hover && (this.handlers.hover = new OpenLayers.Handler.Hover(this, { move: this.cancelHover, pause: this.selectHover }, OpenLayers.Util.extend(this.handlerOptions.hover, { delay: 250, pixelTolerance: 2 })));
20196  },
20197  activate: function () {
20198      if (!this.active) for (var a in this.handlers) this.handlers[a].activate();
20199      return OpenLayers.Control.prototype.activate.apply(this, arguments);
20200  },
20201  deactivate: function () {
20202      if (this.active) for (var a in this.handlers) this.handlers[a].deactivate();
20203      return OpenLayers.Control.prototype.deactivate.apply(this, arguments);
20204  },
20205  selectClick: function (a) {
20206      var b = this.pixelToBounds(a.xy);
20207      this.setModifiers(a);
20208      this.request(b, { single: this.single });
20209  },
20210  selectBox: function (a) {
20211      var b;
20212      if (a instanceof OpenLayers.Bounds) (b = this.map.getLonLatFromPixel({ x: a.left, y: a.bottom })), (a = this.map.getLonLatFromPixel({ x: a.right, y: a.top })), (b = new OpenLayers.Bounds(b.lon, b.lat, a.lon, a.lat));
20213      else {
20214          if (this.click) return;
20215          b = this.pixelToBounds(a);
20216      }
20217      this.setModifiers(this.handlers.box.dragHandler.evt);
20218      this.request(b);
20219  },
20220  selectHover: function (a) {
20221      a = this.pixelToBounds(a.xy);
20222      this.request(a, { single: !0, hover: !0 });
20223  },
20224  cancelHover: function () {
20225      this.hoverResponse && (this.protocol.abort(this.hoverResponse), (this.hoverResponse = null), OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait"));
20226  },
20227  request: function (a, b) {
20228      b = b || {};
20229      var c = new OpenLayers.Filter.Spatial({ type: this.filterType, value: a });
20230      OpenLayers.Element.addClass(this.map.viewPortDiv, "olCursorWait");
20231      c = this.protocol.read({
20232          maxFeatures: !0 == b.single ? this.maxFeatures : void 0,
20233          filter: c,
20234          callback: function (c) {
20235              c.success() &&
20236                  (c.features.length
20237                      ? !0 == b.single
20238                          ? this.selectBestFeature(c.features, a.getCenterLonLat(), b)
20239                          : this.select(c.features)
20240                      : b.hover
20241                      ? this.hoverSelect()
20242                      : (this.events.triggerEvent("clickout"), this.clickout && this.unselectAll()));
20243              OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
20244          },
20245          scope: this,
20246      });
20247      !0 == b.hover && (this.hoverResponse = c);
20248  },
20249  selectBestFeature: function (a, b, c) {
20250      c = c || {};
20251      if (a.length) {
20252          b = new OpenLayers.Geometry.Point(b.lon, b.lat);
20253          for (var d, e, f, g = Number.MAX_VALUE, h = 0; h < a.length && !((d = a[h]), d.geometry && ((f = b.distanceTo(d.geometry, { edge: !1 })), f < g && ((g = f), (e = d), 0 == g))); ++h);
20254          !0 == c.hover ? this.hoverSelect(e) : this.select(e || a);
20255      }
20256  },
20257  setModifiers: function (a) {
20258      this.modifiers = { multiple: this.multiple || (this.multipleKey && a[this.multipleKey]), toggle: this.toggle || (this.toggleKey && a[this.toggleKey]) };
20259  },
20260  select: function (a) {
20261      this.modifiers.multiple || this.modifiers.toggle || this.unselectAll();
20262      OpenLayers.Util.isArray(a) || (a = [a]);
20263      var b = this.events.triggerEvent("beforefeaturesselected", { features: a });
20264      if (!1 !== b) {
20265          for (var c = [], d, e = 0, f = a.length; e < f; ++e)
20266              (d = a[e]),
20267                  this.features[d.fid || d.id]
20268                      ? this.modifiers.toggle && this.unselect(this.features[d.fid || d.id])
20269                      : ((b = this.events.triggerEvent("beforefeatureselected", { feature: d })), !1 !== b && ((this.features[d.fid || d.id] = d), c.push(d), this.events.triggerEvent("featureselected", { feature: d })));
20270          this.events.triggerEvent("featuresselected", { features: c });
20271      }
20272  },
20273  hoverSelect: function (a) {
20274      var b = a ? a.fid || a.id : null,
20275          c = this.hoverFeature ? this.hoverFeature.fid || this.hoverFeature.id : null;
20276      c && c != b && (this.events.triggerEvent("outfeature", { feature: this.hoverFeature }), (this.hoverFeature = null));
20277      b && b != c && (this.events.triggerEvent("hoverfeature", { feature: a }), (this.hoverFeature = a));
20278  },
20279  unselect: function (a) {
20280      delete this.features[a.fid || a.id];
20281      this.events.triggerEvent("featureunselected", { feature: a });
20282  },
20283  unselectAll: function () {
20284      for (var a in this.features) this.unselect(this.features[a]);
20285  },
20286  setMap: function (a) {
20287      for (var b in this.handlers) this.handlers[b].setMap(a);
20288      OpenLayers.Control.prototype.setMap.apply(this, arguments);
20289  },
20290  pixelToBounds: function (a) {
20291      var b = a.add(-this.clickTolerance / 2, this.clickTolerance / 2);
20292      a = a.add(this.clickTolerance / 2, -this.clickTolerance / 2);
20293      b = this.map.getLonLatFromPixel(b);
20294      a = this.map.getLonLatFromPixel(a);
20295      return new OpenLayers.Bounds(b.lon, b.lat, a.lon, a.lat);
20296  },
20297  CLASS_NAME: "OpenLayers.Control.GetFeature",
20298});
20299OpenLayers.Format.QueryStringFilter = (function () {
20300  function a(a) {
20301      a = a.replace(/%/g, "\\%");
20302      a = a.replace(/\\\\\.(\*)?/g, function (a, b) {
20303          return b ? a : "\\\\_";
20304      });
20305      a = a.replace(/\\\\\.\*/g, "\\\\%");
20306      a = a.replace(/(\\)?\.(\*)?/g, function (a, b, c) {
20307          return b || c ? a : "_";
20308      });
20309      a = a.replace(/(\\)?\.\*/g, function (a, b) {
20310          return b ? a : "%";
20311      });
20312      a = a.replace(/\\\./g, ".");
20313      return (a = a.replace(/(\\)?\\\*/g, function (a, b) {
20314          return b ? a : "*";
20315      }));
20316  }
20317  var b = {};
20318  b[OpenLayers.Filter.Comparison.EQUAL_TO] = "eq";
20319  b[OpenLayers.Filter.Comparison.NOT_EQUAL_TO] = "ne";
20320  b[OpenLayers.Filter.Comparison.LESS_THAN] = "lt";
20321  b[OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO] = "lte";
20322  b[OpenLayers.Filter.Comparison.GREATER_THAN] = "gt";
20323  b[OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO] = "gte";
20324  b[OpenLayers.Filter.Comparison.LIKE] = "ilike";
20325  return OpenLayers.Class(OpenLayers.Format, {
20326      wildcarded: !1,
20327      srsInBBOX: !1,
20328      write: function (c, d) {
20329          d = d || {};
20330          var e = c.CLASS_NAME,
20331              e = e.substring(e.lastIndexOf(".") + 1);
20332          switch (e) {
20333              case "Spatial":
20334                  switch (c.type) {
20335                      case OpenLayers.Filter.Spatial.BBOX:
20336                          d.bbox = c.value.toArray();
20337                          this.srsInBBOX && c.projection && d.bbox.push(c.projection.getCode());
20338                          break;
20339                      case OpenLayers.Filter.Spatial.DWITHIN:
20340                          d.tolerance = c.distance;
20341                      case OpenLayers.Filter.Spatial.WITHIN:
20342                          d.lon = c.value.x;
20343                          d.lat = c.value.y;
20344                          break;
20345                      default:
20346                          OpenLayers.Console.warn("Unknown spatial filter type " + c.type);
20347                  }
20348                  break;
20349              case "Comparison":
20350                  e = b[c.type];
20351                  if (void 0 !== e) {
20352                      var f = c.value;
20353                      c.type == OpenLayers.Filter.Comparison.LIKE && ((f = a(f)), this.wildcarded && (f = "%" + f + "%"));
20354                      d[c.property + "__" + e] = f;
20355                      d.queryable = d.queryable || [];
20356                      d.queryable.push(c.property);
20357                  } else OpenLayers.Console.warn("Unknown comparison filter type " + c.type);
20358                  break;
20359              case "Logical":
20360                  if (c.type === OpenLayers.Filter.Logical.AND) for (e = 0, f = c.filters.length; e < f; e++) d = this.write(c.filters[e], d);
20361                  else OpenLayers.Console.warn("Unsupported logical filter type " + c.type);
20362                  break;
20363              default:
20364                  OpenLayers.Console.warn("Unknown filter type " + e);
20365          }
20366          return d;
20367      },
20368      CLASS_NAME: "OpenLayers.Format.QueryStringFilter",
20369  });
20370})();
20371OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
20372  autoActivate: !0,
20373  element: null,
20374  prefix: "",
20375  separator: ", ",
20376  suffix: "",
20377  numDigits: 5,
20378  granularity: 10,
20379  emptyString: null,
20380  lastXy: null,
20381  displayProjection: null,
20382  destroy: function () {
20383      this.deactivate();
20384      OpenLayers.Control.prototype.destroy.apply(this, arguments);
20385  },
20386  activate: function () {
20387      return OpenLayers.Control.prototype.activate.apply(this, arguments) ? (this.map.events.register("mousemove", this, this.redraw), this.map.events.register("mouseout", this, this.reset), this.redraw(), !0) : !1;
20388  },
20389  deactivate: function () {
20390      return OpenLayers.Control.prototype.deactivate.apply(this, arguments) ? (this.map.events.unregister("mousemove", this, this.redraw), this.map.events.unregister("mouseout", this, this.reset), (this.element.innerHTML = ""), !0) : !1;
20391  },
20392  draw: function () {
20393      OpenLayers.Control.prototype.draw.apply(this, arguments);
20394      this.element || ((this.div.left = ""), (this.div.top = ""), (this.element = this.div));
20395      return this.div;
20396  },
20397  redraw: function (a) {
20398      var b;
20399      if (null == a) this.reset();
20400      else if (null == this.lastXy || Math.abs(a.xy.x - this.lastXy.x) > this.granularity || Math.abs(a.xy.y - this.lastXy.y) > this.granularity) this.lastXy = a.xy;
20401      else if ((b = this.map.getLonLatFromPixel(a.xy)))
20402          this.displayProjection && b.transform(this.map.getProjectionObject(), this.displayProjection), (this.lastXy = a.xy), (a = this.formatOutput(b)), a != this.element.innerHTML && (this.element.innerHTML = a);
20403  },
20404  reset: function (a) {
20405      null != this.emptyString && (this.element.innerHTML = this.emptyString);
20406  },
20407  formatOutput: function (a) {
20408      var b = parseInt(this.numDigits);
20409      return this.prefix + a.lon.toFixed(b) + this.separator + a.lat.toFixed(b) + this.suffix;
20410  },
20411  CLASS_NAME: "OpenLayers.Control.MousePosition",
20412});
20413OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, {
20414  geolocation: null,
20415  available: "geolocation" in navigator,
20416  bind: !0,
20417  watch: !1,
20418  geolocationOptions: null,
20419  destroy: function () {
20420      this.deactivate();
20421      OpenLayers.Control.prototype.destroy.apply(this, arguments);
20422  },
20423  activate: function () {
20424      this.available && !this.geolocation && (this.geolocation = navigator.geolocation);
20425      return this.geolocation
20426          ? OpenLayers.Control.prototype.activate.apply(this, arguments)
20427              ? (this.watch ? (this.watchId = this.geolocation.watchPosition(OpenLayers.Function.bind(this.geolocate, this), OpenLayers.Function.bind(this.failure, this), this.geolocationOptions)) : this.getCurrentLocation(), !0)
20428              : !1
20429          : (this.events.triggerEvent("locationuncapable"), !1);
20430  },
20431  deactivate: function () {
20432      this.active && null !== this.watchId && this.geolocation.clearWatch(this.watchId);
20433      return OpenLayers.Control.prototype.deactivate.apply(this, arguments);
20434  },
20435  geolocate: function (a) {
20436      var b = new OpenLayers.LonLat(a.coords.longitude, a.coords.latitude).transform(new OpenLayers.Projection("EPSG:4326"), this.map.getProjectionObject());
20437      this.bind && this.map.setCenter(b);
20438      this.events.triggerEvent("locationupdated", { position: a, point: new OpenLayers.Geometry.Point(b.lon, b.lat) });
20439  },
20440  getCurrentLocation: function () {
20441      if (!this.active || this.watch) return !1;
20442      this.geolocation.getCurrentPosition(OpenLayers.Function.bind(this.geolocate, this), OpenLayers.Function.bind(this.failure, this), this.geolocationOptions);
20443      return !0;
20444  },
20445  failure: function (a) {
20446      this.events.triggerEvent("locationfailed", { error: a });
20447  },
20448  CLASS_NAME: "OpenLayers.Control.Geolocate",
20449});
20450OpenLayers.Tile.UTFGrid = OpenLayers.Class(OpenLayers.Tile, {
20451  url: null,
20452  utfgridResolution: 2,
20453  json: null,
20454  format: null,
20455  destroy: function () {
20456      this.clear();
20457      OpenLayers.Tile.prototype.destroy.apply(this, arguments);
20458  },
20459  draw: function () {
20460      var a = OpenLayers.Tile.prototype.draw.apply(this, arguments);
20461      if (a)
20462          if ((this.isLoading ? (this.abortLoading(), this.events.triggerEvent("reload")) : ((this.isLoading = !0), this.events.triggerEvent("loadstart")), (this.url = this.layer.getURL(this.bounds)), this.layer.useJSONP)) {
20463              var b = new OpenLayers.Protocol.Script({
20464                  url: this.url,
20465                  callback: function (a) {
20466                      this.isLoading = !1;
20467                      this.events.triggerEvent("loadend");
20468                      this.json = a.data;
20469                  },
20470                  scope: this,
20471              });
20472              b.read();
20473              this.request = b;
20474          } else
20475              this.request = OpenLayers.Request.GET({
20476                  url: this.url,
20477                  callback: function (a) {
20478                      this.isLoading = !1;
20479                      this.events.triggerEvent("loadend");
20480                      200 === a.status && this.parseData(a.responseText);
20481                  },
20482                  scope: this,
20483              });
20484      else this.unload();
20485      return a;
20486  },
20487  abortLoading: function () {
20488      this.request && (this.request.abort(), delete this.request);
20489      this.isLoading = !1;
20490  },
20491  getFeatureInfo: function (a, b) {
20492      var c = null;
20493      if (this.json) {
20494          var d = this.getFeatureId(a, b);
20495          null !== d && (c = { id: d, data: this.json.data[d] });
20496      }
20497      return c;
20498  },
20499  getFeatureId: function (a, b) {
20500      var c = null;
20501      if (this.json) {
20502          var d = this.utfgridResolution,
20503              d = this.json.grid[Math.floor(b / d)].charCodeAt(Math.floor(a / d)),
20504              d = this.indexFromCharCode(d),
20505              e = this.json.keys;
20506          !isNaN(d) && d in e && (c = e[d]);
20507      }
20508      return c;
20509  },
20510  indexFromCharCode: function (a) {
20511      93 <= a && a--;
20512      35 <= a && a--;
20513      return a - 32;
20514  },
20515  parseData: function (a) {
20516      this.format || (this.format = new OpenLayers.Format.JSON());
20517      this.json = this.format.read(a);
20518  },
20519  clear: function () {
20520      this.json = null;
20521  },
20522  CLASS_NAME: "OpenLayers.Tile.UTFGrid",
20523});
20524OpenLayers.Protocol.HTTP = OpenLayers.Class(OpenLayers.Protocol, {
20525  url: null,
20526  headers: null,
20527  params: null,
20528  callback: null,
20529  scope: null,
20530  readWithPOST: !1,
20531  updateWithPOST: !1,
20532  deleteWithPOST: !1,
20533  wildcarded: !1,
20534  srsInBBOX: !1,
20535  initialize: function (a) {
20536      a = a || {};
20537      this.params = {};
20538      this.headers = {};
20539      OpenLayers.Protocol.prototype.initialize.apply(this, arguments);
20540      if (!this.filterToParams && OpenLayers.Format.QueryStringFilter) {
20541          var b = new OpenLayers.Format.QueryStringFilter({ wildcarded: this.wildcarded, srsInBBOX: this.srsInBBOX });
20542          this.filterToParams = function (a, d) {
20543              return b.write(a, d);
20544          };
20545      }
20546  },
20547  destroy: function () {
20548      this.headers = this.params = null;
20549      OpenLayers.Protocol.prototype.destroy.apply(this);
20550  },
20551  read: function (a) {
20552      OpenLayers.Protocol.prototype.read.apply(this, arguments);
20553      a = a || {};
20554      a.params = OpenLayers.Util.applyDefaults(a.params, this.options.params);
20555      a = OpenLayers.Util.applyDefaults(a, this.options);
20556      a.filter && this.filterToParams && (a.params = this.filterToParams(a.filter, a.params));
20557      var b = void 0 !== a.readWithPOST ? a.readWithPOST : this.readWithPOST,
20558          c = new OpenLayers.Protocol.Response({ requestType: "read" });
20559      b
20560          ? ((b = a.headers || {}),
20561            (b["Content-Type"] = "application/x-www-form-urlencoded"),
20562            (c.priv = OpenLayers.Request.POST({ url: a.url, callback: this.createCallback(this.handleRead, c, a), data: OpenLayers.Util.getParameterString(a.params), headers: b })))
20563          : (c.priv = OpenLayers.Request.GET({ url: a.url, callback: this.createCallback(this.handleRead, c, a), params: a.params, headers: a.headers }));
20564      return c;
20565  },
20566  handleRead: function (a, b) {
20567      this.handleResponse(a, b);
20568  },
20569  create: function (a, b) {
20570      b = OpenLayers.Util.applyDefaults(b, this.options);
20571      var c = new OpenLayers.Protocol.Response({ reqFeatures: a, requestType: "create" });
20572      c.priv = OpenLayers.Request.POST({ url: b.url, callback: this.createCallback(this.handleCreate, c, b), headers: b.headers, data: this.format.write(a) });
20573      return c;
20574  },
20575  handleCreate: function (a, b) {
20576      this.handleResponse(a, b);
20577  },
20578  update: function (a, b) {
20579      b = b || {};
20580      var c = b.url || a.url || this.options.url + "/" + a.fid;
20581      b = OpenLayers.Util.applyDefaults(b, this.options);
20582      var d = new OpenLayers.Protocol.Response({ reqFeatures: a, requestType: "update" });
20583      d.priv = OpenLayers.Request[this.updateWithPOST ? "POST" : "PUT"]({ url: c, callback: this.createCallback(this.handleUpdate, d, b), headers: b.headers, data: this.format.write(a) });
20584      return d;
20585  },
20586  handleUpdate: function (a, b) {
20587      this.handleResponse(a, b);
20588  },
20589  delete: function (a, b) {
20590      b = b || {};
20591      var c = b.url || a.url || this.options.url + "/" + a.fid;
20592      b = OpenLayers.Util.applyDefaults(b, this.options);
20593      var d = new OpenLayers.Protocol.Response({ reqFeatures: a, requestType: "delete" }),
20594          e = this.deleteWithPOST ? "POST" : "DELETE",
20595          c = { url: c, callback: this.createCallback(this.handleDelete, d, b), headers: b.headers };
20596      this.deleteWithPOST && (c.data = this.format.write(a));
20597      d.priv = OpenLayers.Request[e](c);
20598      return d;
20599  },
20600  handleDelete: function (a, b) {
20601      this.handleResponse(a, b);
20602  },
20603  handleResponse: function (a, b) {
20604      var c = a.priv;
20605      b.callback &&
20606          (200 <= c.status && 300 > c.status ? ("delete" != a.requestType && (a.features = this.parseFeatures(c)), (a.code = OpenLayers.Protocol.Response.SUCCESS)) : (a.code = OpenLayers.Protocol.Response.FAILURE),
20607          b.callback.call(b.scope, a));
20608  },
20609  parseFeatures: function (a) {
20610      var b = a.responseXML;
20611      (b && b.documentElement) || (b = a.responseText);
20612      return !b || 0 >= b.length ? null : this.format.read(b);
20613  },
20614  commit: function (a, b) {
20615      function c(a) {
20616          for (var b = a.features ? a.features.length : 0, c = Array(b), e = 0; e < b; ++e) c[e] = a.features[e].fid;
20617          r.insertIds = c;
20618          d.apply(this, [a]);
20619      }
20620      function d(a) {
20621          this.callUserCallback(a, b);
20622          q = q && a.success();
20623          f++;
20624          f >= p && b.callback && ((r.code = q ? OpenLayers.Protocol.Response.SUCCESS : OpenLayers.Protocol.Response.FAILURE), b.callback.apply(b.scope, [r]));
20625      }
20626      b = OpenLayers.Util.applyDefaults(b, this.options);
20627      var e = [],
20628          f = 0,
20629          g = {};
20630      g[OpenLayers.State.INSERT] = [];
20631      g[OpenLayers.State.UPDATE] = [];
20632      g[OpenLayers.State.DELETE] = [];
20633      for (var h, k, l = [], m = 0, n = a.length; m < n; ++m) if (((h = a[m]), (k = g[h.state]))) k.push(h), l.push(h);
20634      var p = (0 < g[OpenLayers.State.INSERT].length ? 1 : 0) + g[OpenLayers.State.UPDATE].length + g[OpenLayers.State.DELETE].length,
20635          q = !0,
20636          r = new OpenLayers.Protocol.Response({ reqFeatures: l });
20637      h = g[OpenLayers.State.INSERT];
20638      0 < h.length && e.push(this.create(h, OpenLayers.Util.applyDefaults({ callback: c, scope: this }, b.create)));
20639      h = g[OpenLayers.State.UPDATE];
20640      for (m = h.length - 1; 0 <= m; --m) e.push(this.update(h[m], OpenLayers.Util.applyDefaults({ callback: d, scope: this }, b.update)));
20641      h = g[OpenLayers.State.DELETE];
20642      for (m = h.length - 1; 0 <= m; --m) e.push(this["delete"](h[m], OpenLayers.Util.applyDefaults({ callback: d, scope: this }, b["delete"])));
20643      return e;
20644  },
20645  abort: function (a) {
20646      a && a.priv.abort();
20647  },
20648  callUserCallback: function (a, b) {
20649      var c = b[a.requestType];
20650      c && c.callback && c.callback.call(c.scope, a);
20651  },
20652  CLASS_NAME: "OpenLayers.Protocol.HTTP",
20653});
20654OpenLayers.Strategy.Cluster = OpenLayers.Class(OpenLayers.Strategy, {
20655  distance: 20,
20656  threshold: null,
20657  features: null,
20658  clusters: null,
20659  clustering: !1,
20660  resolution: null,
20661  activate: function () {
20662      var a = OpenLayers.Strategy.prototype.activate.call(this);
20663      if (a) this.layer.events.on({ beforefeaturesadded: this.cacheFeatures, featuresremoved: this.clearCache, moveend: this.cluster, scope: this });
20664      return a;
20665  },
20666  deactivate: function () {
20667      var a = OpenLayers.Strategy.prototype.deactivate.call(this);
20668      a && (this.clearCache(), this.layer.events.un({ beforefeaturesadded: this.cacheFeatures, featuresremoved: this.clearCache, moveend: this.cluster, scope: this }));
20669      return a;
20670  },
20671  cacheFeatures: function (a) {
20672      var b = !0;
20673      this.clustering || (this.clearCache(), (this.features = a.features), this.cluster(), (b = !1));
20674      return b;
20675  },
20676  clearCache: function () {
20677      this.clustering || (this.features = null);
20678  },
20679  cluster: function (a) {
20680      if ((!a || a.zoomChanged) && this.features && ((a = this.layer.map.getResolution()), a != this.resolution || !this.clustersExist())) {
20681          this.resolution = a;
20682          a = [];
20683          for (var b, c, d, e = 0; e < this.features.length; ++e)
20684              if (((b = this.features[e]), b.geometry)) {
20685                  c = !1;
20686                  for (var f = a.length - 1; 0 <= f; --f)
20687                      if (((d = a[f]), this.shouldCluster(d, b))) {
20688                          this.addToCluster(d, b);
20689                          c = !0;
20690                          break;
20691                      }
20692                  c || a.push(this.createCluster(this.features[e]));
20693              }
20694          this.clustering = !0;
20695          this.layer.removeAllFeatures();
20696          this.clustering = !1;
20697          if (0 < a.length) {
20698              if (1 < this.threshold) for (b = a.slice(), a = [], e = 0, d = b.length; e < d; ++e) (c = b[e]), c.attributes.count < this.threshold ? Array.prototype.push.apply(a, c.cluster) : a.push(c);
20699              this.clustering = !0;
20700              this.layer.addFeatures(a);
20701              this.clustering = !1;
20702          }
20703          this.clusters = a;
20704      }
20705  },
20706  clustersExist: function () {
20707      var a = !1;
20708      if (this.clusters && 0 < this.clusters.length && this.clusters.length == this.layer.features.length)
20709          for (var a = !0, b = 0; b < this.clusters.length; ++b)
20710              if (this.clusters[b] != this.layer.features[b]) {
20711                  a = !1;
20712                  break;
20713              }
20714      return a;
20715  },
20716  shouldCluster: function (a, b) {
20717      var c = a.geometry.getBounds().getCenterLonLat(),
20718          d = b.geometry.getBounds().getCenterLonLat();
20719      return Math.sqrt(Math.pow(c.lon - d.lon, 2) + Math.pow(c.lat - d.lat, 2)) / this.resolution <= this.distance;
20720  },
20721  addToCluster: function (a, b) {
20722      a.cluster.push(b);
20723      a.attributes.count += 1;
20724  },
20725  createCluster: function (a) {
20726      var b = a.geometry.getBounds().getCenterLonLat(),
20727          b = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon, b.lat), { count: 1 });
20728      b.cluster = [a];
20729      return b;
20730  },
20731  CLASS_NAME: "OpenLayers.Strategy.Cluster",
20732});
20733OpenLayers.Strategy.Filter = OpenLayers.Class(OpenLayers.Strategy, {
20734  filter: null,
20735  cache: null,
20736  caching: !1,
20737  activate: function () {
20738      var a = OpenLayers.Strategy.prototype.activate.apply(this, arguments);
20739      a && ((this.cache = []), this.layer.events.on({ beforefeaturesadded: this.handleAdd, beforefeaturesremoved: this.handleRemove, scope: this }));
20740      return a;
20741  },
20742  deactivate: function () {
20743      this.cache = null;
20744      this.layer && this.layer.events && this.layer.events.un({ beforefeaturesadded: this.handleAdd, beforefeaturesremoved: this.handleRemove, scope: this });
20745      return OpenLayers.Strategy.prototype.deactivate.apply(this, arguments);
20746  },
20747  handleAdd: function (a) {
20748      if (!this.caching && this.filter) {
20749          var b = a.features;
20750          a.features = [];
20751          for (var c, d = 0, e = b.length; d < e; ++d) (c = b[d]), this.filter.evaluate(c) ? a.features.push(c) : this.cache.push(c);
20752      }
20753  },
20754  handleRemove: function (a) {
20755      this.caching || (this.cache = []);
20756  },
20757  setFilter: function (a) {
20758      this.filter = a;
20759      a = this.cache;
20760      this.cache = [];
20761      this.handleAdd({ features: this.layer.features });
20762      0 < this.cache.length && ((this.caching = !0), this.layer.removeFeatures(this.cache.slice()), (this.caching = !1));
20763      0 < a.length && ((a = { features: a }), this.handleAdd(a), 0 < a.features.length && ((this.caching = !0), this.layer.addFeatures(a.features), (this.caching = !1)));
20764  },
20765  CLASS_NAME: "OpenLayers.Strategy.Filter",
20766});
20767OpenLayers.Protocol.SOS = function (a) {
20768  a = OpenLayers.Util.applyDefaults(a, OpenLayers.Protocol.SOS.DEFAULTS);
20769  var b = OpenLayers.Protocol.SOS["v" + a.version.replace(/\./g, "_")];
20770  if (!b) throw "Unsupported SOS version: " + a.version;
20771  return new b(a);
20772};
20773OpenLayers.Protocol.SOS.DEFAULTS = { version: "1.0.0" };
20774OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class(OpenLayers.Format.XML, {
20775  regExes: { trimSpace: /^\s*|\s*$/g },
20776  namespaces: { xsd: "http://www.w3.org/2001/XMLSchema" },
20777  readers: {
20778      xsd: {
20779          schema: function (a, b) {
20780              var c = [],
20781                  d = {},
20782                  e,
20783                  f;
20784              this.readChildNodes(a, { complexTypes: c, customTypes: d });
20785              var g = a.attributes,
20786                  h,
20787                  k;
20788              e = 0;
20789              for (f = g.length; e < f; ++e) (h = g[e]), (k = h.name), 0 === k.indexOf("xmlns") ? this.setNamespace(k.split(":")[1] || "", h.value) : (b[k] = h.value);
20790              b.featureTypes = c;
20791              b.targetPrefix = this.namespaceAlias[b.targetNamespace];
20792              e = 0;
20793              for (f = c.length; e < f; ++e) (g = c[e]), (h = d[g.typeName]), d[g.typeName] && (g.typeName = h.name);
20794          },
20795          complexType: function (a, b) {
20796              var c = { typeName: a.getAttribute("name") };
20797              this.readChildNodes(a, c);
20798              b.complexTypes.push(c);
20799          },
20800          complexContent: function (a, b) {
20801              this.readChildNodes(a, b);
20802          },
20803          extension: function (a, b) {
20804              this.readChildNodes(a, b);
20805          },
20806          sequence: function (a, b) {
20807              var c = { elements: [] };
20808              this.readChildNodes(a, c);
20809              b.properties = c.elements;
20810          },
20811          element: function (a, b) {
20812              var c;
20813              if (b.elements) {
20814                  var d = {};
20815                  c = a.attributes;
20816                  for (var e, f = 0, g = c.length; f < g; ++f) (e = c[f]), (d[e.name] = e.value);
20817                  c = d.type;
20818                  c || ((c = {}), this.readChildNodes(a, c), (d.restriction = c), (d.type = c.base));
20819                  d.localType = (c.base || c).split(":").pop();
20820                  b.elements.push(d);
20821                  this.readChildNodes(a, d);
20822              }
20823              b.complexTypes && ((c = a.getAttribute("type")), (d = c.split(":").pop()), (b.customTypes[d] = { name: a.getAttribute("name"), type: c }));
20824          },
20825          annotation: function (a, b) {
20826              b.annotation = {};
20827              this.readChildNodes(a, b.annotation);
20828          },
20829          appinfo: function (a, b) {
20830              b.appinfo || (b.appinfo = []);
20831              b.appinfo.push(this.getChildValue(a));
20832          },
20833          documentation: function (a, b) {
20834              b.documentation || (b.documentation = []);
20835              var c = this.getChildValue(a);
20836              b.documentation.push({ lang: a.getAttribute("xml:lang"), textContent: c.replace(this.regExes.trimSpace, "") });
20837          },
20838          simpleType: function (a, b) {
20839              this.readChildNodes(a, b);
20840          },
20841          restriction: function (a, b) {
20842              b.base = a.getAttribute("base");
20843              this.readRestriction(a, b);
20844          },
20845      },
20846  },
20847  readRestriction: function (a, b) {
20848      for (var c = a.childNodes, d, e, f = 0, g = c.length; f < g; ++f)
20849          (d = c[f]), 1 == d.nodeType && ((e = d.nodeName.split(":").pop()), (d = d.getAttribute("value")), b[e] ? ("string" == typeof b[e] && (b[e] = [b[e]]), b[e].push(d)) : (b[e] = d));
20850  },
20851  read: function (a) {
20852      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
20853      a && 9 == a.nodeType && (a = a.documentElement);
20854      var b = {};
20855      if ("ExceptionReport" === a.nodeName.split(":").pop()) {
20856          var c = new OpenLayers.Format.OGCExceptionReport();
20857          b.error = c.read(a);
20858      } else this.readNode(a, b);
20859      return b;
20860  },
20861  CLASS_NAME: "OpenLayers.Format.WFSDescribeFeatureType",
20862});
20863OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
20864  rssns: "http://backend.userland.com/rss2",
20865  featureNS: "http://mapserver.gis.umn.edu/mapserver",
20866  georssns: "http://www.georss.org/georss",
20867  geons: "http://www.w3.org/2003/01/geo/wgs84_pos#",
20868  featureTitle: "Untitled",
20869  featureDescription: "No Description",
20870  gmlParser: null,
20871  xy: !1,
20872  createGeometryFromItem: function (a) {
20873      var b = this.getElementsByTagNameNS(a, this.georssns, "point"),
20874          c = this.getElementsByTagNameNS(a, this.geons, "lat"),
20875          d = this.getElementsByTagNameNS(a, this.geons, "long"),
20876          e = this.getElementsByTagNameNS(a, this.georssns, "line"),
20877          f = this.getElementsByTagNameNS(a, this.georssns, "polygon"),
20878          g = this.getElementsByTagNameNS(a, this.georssns, "where");
20879      a = this.getElementsByTagNameNS(a, this.georssns, "box");
20880      if (0 < b.length || (0 < c.length && 0 < d.length)) {
20881          0 < b.length
20882              ? ((c = OpenLayers.String.trim(b[0].firstChild.nodeValue).split(/\s+/)), 2 != c.length && (c = OpenLayers.String.trim(b[0].firstChild.nodeValue).split(/\s*,\s*/)))
20883              : (c = [parseFloat(c[0].firstChild.nodeValue), parseFloat(d[0].firstChild.nodeValue)]);
20884          var h = new OpenLayers.Geometry.Point(c[1], c[0]);
20885      } else if (0 < e.length) {
20886          c = OpenLayers.String.trim(this.getChildValue(e[0])).split(/\s+/);
20887          d = [];
20888          e = 0;
20889          for (f = c.length; e < f; e += 2) (b = new OpenLayers.Geometry.Point(c[e + 1], c[e])), d.push(b);
20890          h = new OpenLayers.Geometry.LineString(d);
20891      } else if (0 < f.length) {
20892          c = OpenLayers.String.trim(this.getChildValue(f[0])).split(/\s+/);
20893          d = [];
20894          e = 0;
20895          for (f = c.length; e < f; e += 2) (b = new OpenLayers.Geometry.Point(c[e + 1], c[e])), d.push(b);
20896          h = new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(d)]);
20897      } else
20898          0 < g.length
20899              ? (this.gmlParser || (this.gmlParser = new OpenLayers.Format.GML({ xy: this.xy })), (h = this.gmlParser.parseFeature(g[0]).geometry))
20900              : 0 < a.length &&
20901                ((c = OpenLayers.String.trim(a[0].firstChild.nodeValue).split(/\s+/)),
20902                (d = []),
20903                3 < c.length &&
20904                    ((b = new OpenLayers.Geometry.Point(c[1], c[0])),
20905                    d.push(b),
20906                    (b = new OpenLayers.Geometry.Point(c[1], c[2])),
20907                    d.push(b),
20908                    (b = new OpenLayers.Geometry.Point(c[3], c[2])),
20909                    d.push(b),
20910                    (b = new OpenLayers.Geometry.Point(c[3], c[0])),
20911                    d.push(b),
20912                    (b = new OpenLayers.Geometry.Point(c[1], c[0])),
20913                    d.push(b)),
20914                (h = new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(d)])));
20915      h && this.internalProjection && this.externalProjection && h.transform(this.externalProjection, this.internalProjection);
20916      return h;
20917  },
20918  createFeatureFromItem: function (a) {
20919      var b = this.createGeometryFromItem(a),
20920          c = this._getChildValue(a, "*", "title", this.featureTitle),
20921          d = this._getChildValue(a, "*", "description", this._getChildValue(a, "*", "content", this._getChildValue(a, "*", "summary", this.featureDescription))),
20922          e = this._getChildValue(a, "*", "link");
20923      if (!e)
20924          try {
20925              e = this.getElementsByTagNameNS(a, "*", "link")[0].getAttribute("href");
20926          } catch (f) {
20927              e = null;
20928          }
20929      a = this._getChildValue(a, "*", "id", null);
20930      b = new OpenLayers.Feature.Vector(b, { title: c, description: d, link: e });
20931      b.fid = a;
20932      return b;
20933  },
20934  _getChildValue: function (a, b, c, d) {
20935      return (a = this.getElementsByTagNameNS(a, b, c)) && a[0] && a[0].firstChild && a[0].firstChild.nodeValue ? this.getChildValue(a[0]) : void 0 == d ? "" : d;
20936  },
20937  read: function (a) {
20938      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
20939      var b = null,
20940          b = this.getElementsByTagNameNS(a, "*", "item");
20941      0 == b.length && (b = this.getElementsByTagNameNS(a, "*", "entry"));
20942      a = b.length;
20943      for (var c = Array(a), d = 0; d < a; d++) c[d] = this.createFeatureFromItem(b[d]);
20944      return c;
20945  },
20946  write: function (a) {
20947      var b;
20948      if (OpenLayers.Util.isArray(a)) {
20949          b = this.createElementNS(this.rssns, "rss");
20950          for (var c = 0, d = a.length; c < d; c++) b.appendChild(this.createFeatureXML(a[c]));
20951      } else b = this.createFeatureXML(a);
20952      return OpenLayers.Format.XML.prototype.write.apply(this, [b]);
20953  },
20954  createFeatureXML: function (a) {
20955      var b = this.buildGeometryNode(a.geometry),
20956          c = this.createElementNS(this.rssns, "item"),
20957          d = this.createElementNS(this.rssns, "title");
20958      d.appendChild(this.createTextNode(a.attributes.title ? a.attributes.title : ""));
20959      var e = this.createElementNS(this.rssns, "description");
20960      e.appendChild(this.createTextNode(a.attributes.description ? a.attributes.description : ""));
20961      c.appendChild(d);
20962      c.appendChild(e);
20963      a.attributes.link && ((d = this.createElementNS(this.rssns, "link")), d.appendChild(this.createTextNode(a.attributes.link)), c.appendChild(d));
20964      for (var f in a.attributes)
20965          "link" != f &&
20966              "title" != f &&
20967              "description" != f &&
20968              ((d = this.createTextNode(a.attributes[f])), (e = f), -1 != f.search(":") && (e = f.split(":")[1]), (e = this.createElementNS(this.featureNS, "feature:" + e)), e.appendChild(d), c.appendChild(e));
20969      c.appendChild(b);
20970      return c;
20971  },
20972  buildGeometryNode: function (a) {
20973      this.internalProjection && this.externalProjection && ((a = a.clone()), a.transform(this.internalProjection, this.externalProjection));
20974      var b;
20975      if ("OpenLayers.Geometry.Polygon" == a.CLASS_NAME) (b = this.createElementNS(this.georssns, "georss:polygon")), b.appendChild(this.buildCoordinatesNode(a.components[0]));
20976      else if ("OpenLayers.Geometry.LineString" == a.CLASS_NAME) (b = this.createElementNS(this.georssns, "georss:line")), b.appendChild(this.buildCoordinatesNode(a));
20977      else if ("OpenLayers.Geometry.Point" == a.CLASS_NAME) (b = this.createElementNS(this.georssns, "georss:point")), b.appendChild(this.buildCoordinatesNode(a));
20978      else throw "Couldn't parse " + a.CLASS_NAME;
20979      return b;
20980  },
20981  buildCoordinatesNode: function (a) {
20982      var b = null;
20983      a.components && (b = a.components);
20984      if (b) {
20985          a = b.length;
20986          for (var c = Array(a), d = 0; d < a; d++) c[d] = b[d].y + " " + b[d].x;
20987          b = c.join(" ");
20988      } else b = a.y + " " + a.x;
20989      return this.createTextNode(b);
20990  },
20991  CLASS_NAME: "OpenLayers.Format.GeoRSS",
20992});
20993OpenLayers.Format.WPSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { defaultVersion: "1.0.0", CLASS_NAME: "OpenLayers.Format.WPSCapabilities" });
20994OpenLayers.Format.WPSCapabilities.v1_0_0 = OpenLayers.Class(OpenLayers.Format.XML, {
20995  namespaces: { ows: "http://www.opengis.net/ows/1.1", wps: "http://www.opengis.net/wps/1.0.0", xlink: "http://www.w3.org/1999/xlink" },
20996  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
20997  initialize: function (a) {
20998      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
20999  },
21000  read: function (a) {
21001      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
21002      a && 9 == a.nodeType && (a = a.documentElement);
21003      var b = {};
21004      this.readNode(a, b);
21005      return b;
21006  },
21007  readers: {
21008      wps: {
21009          Capabilities: function (a, b) {
21010              this.readChildNodes(a, b);
21011          },
21012          ProcessOfferings: function (a, b) {
21013              b.processOfferings = {};
21014              this.readChildNodes(a, b.processOfferings);
21015          },
21016          Process: function (a, b) {
21017              var c = { processVersion: this.getAttributeNS(a, this.namespaces.wps, "processVersion") };
21018              this.readChildNodes(a, c);
21019              b[c.identifier] = c;
21020          },
21021          Languages: function (a, b) {
21022              b.languages = [];
21023              this.readChildNodes(a, b.languages);
21024          },
21025          Default: function (a, b) {
21026              var c = { isDefault: !0 };
21027              this.readChildNodes(a, c);
21028              b.push(c);
21029          },
21030          Supported: function (a, b) {
21031              var c = {};
21032              this.readChildNodes(a, c);
21033              b.push(c);
21034          },
21035      },
21036      ows: OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows,
21037  },
21038  CLASS_NAME: "OpenLayers.Format.WPSCapabilities.v1_0_0",
21039});
21040OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
21041  type: OpenLayers.Control.TYPE_TOOL,
21042  pinchOrigin: null,
21043  currentCenter: null,
21044  autoActivate: !0,
21045  preserveCenter: !1,
21046  initialize: function (a) {
21047      OpenLayers.Control.prototype.initialize.apply(this, arguments);
21048      this.handler = new OpenLayers.Handler.Pinch(this, { start: this.pinchStart, move: this.pinchMove, done: this.pinchDone }, this.handlerOptions);
21049  },
21050  pinchStart: function (a, b) {
21051      var c = this.preserveCenter ? this.map.getPixelFromLonLat(this.map.getCenter()) : a.xy;
21052      this.currentCenter = this.pinchOrigin = c;
21053  },
21054  pinchMove: function (a, b) {
21055      var c = b.scale,
21056          d = this.map.layerContainerOriginPx,
21057          e = this.pinchOrigin,
21058          f = this.preserveCenter ? this.map.getPixelFromLonLat(this.map.getCenter()) : a.xy,
21059          g = Math.round(d.x + f.x - e.x + (c - 1) * (d.x - e.x)),
21060          d = Math.round(d.y + f.y - e.y + (c - 1) * (d.y - e.y));
21061      this.map.applyTransform(g, d, c);
21062      this.currentCenter = f;
21063  },
21064  pinchDone: function (a, b, c) {
21065      this.map.applyTransform();
21066      a = this.map.getZoomForResolution(this.map.getResolution() / c.scale, !0);
21067      if (a !== this.map.getZoom() || !this.currentCenter.equals(this.pinchOrigin)) {
21068          b = this.map.getResolutionForZoom(a);
21069          c = this.map.getLonLatFromPixel(this.pinchOrigin);
21070          var d = this.currentCenter,
21071              e = this.map.getSize();
21072          c.lon += b * (e.w / 2 - d.x);
21073          c.lat -= b * (e.h / 2 - d.y);
21074          this.map.div.clientWidth = this.map.div.clientWidth;
21075          this.map.setCenter(c, a);
21076      }
21077  },
21078  CLASS_NAME: "OpenLayers.Control.PinchZoom",
21079});
21080OpenLayers.Control.TouchNavigation = OpenLayers.Class(OpenLayers.Control, {
21081  dragPan: null,
21082  dragPanOptions: null,
21083  pinchZoom: null,
21084  pinchZoomOptions: null,
21085  clickHandlerOptions: null,
21086  documentDrag: !1,
21087  autoActivate: !0,
21088  initialize: function (a) {
21089      this.handlers = {};
21090      OpenLayers.Control.prototype.initialize.apply(this, arguments);
21091  },
21092  destroy: function () {
21093      this.deactivate();
21094      this.dragPan && this.dragPan.destroy();
21095      this.dragPan = null;
21096      this.pinchZoom && (this.pinchZoom.destroy(), delete this.pinchZoom);
21097      OpenLayers.Control.prototype.destroy.apply(this, arguments);
21098  },
21099  activate: function () {
21100      return OpenLayers.Control.prototype.activate.apply(this, arguments) ? (this.dragPan.activate(), this.handlers.click.activate(), this.pinchZoom.activate(), !0) : !1;
21101  },
21102  deactivate: function () {
21103      return OpenLayers.Control.prototype.deactivate.apply(this, arguments) ? (this.dragPan.deactivate(), this.handlers.click.deactivate(), this.pinchZoom.deactivate(), !0) : !1;
21104  },
21105  draw: function () {
21106      var a = { click: this.defaultClick, dblclick: this.defaultDblClick },
21107          b = OpenLayers.Util.extend({ double: !0, stopDouble: !0, pixelTolerance: 2 }, this.clickHandlerOptions);
21108      this.handlers.click = new OpenLayers.Handler.Click(this, a, b);
21109      this.dragPan = new OpenLayers.Control.DragPan(OpenLayers.Util.extend({ map: this.map, documentDrag: this.documentDrag }, this.dragPanOptions));
21110      this.dragPan.draw();
21111      this.pinchZoom = new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({ map: this.map }, this.pinchZoomOptions));
21112  },
21113  defaultClick: function (a) {
21114      a.lastTouches && 2 == a.lastTouches.length && this.map.zoomOut();
21115  },
21116  defaultDblClick: function (a) {
21117      this.map.zoomTo(this.map.zoom + 1, a.xy);
21118  },
21119  CLASS_NAME: "OpenLayers.Control.TouchNavigation",
21120});
21121OpenLayers.Console.warn("OpenLayers.Rico is deprecated");
21122OpenLayers.Rico = OpenLayers.Rico || {};
21123OpenLayers.Rico.Color = OpenLayers.Class({
21124  initialize: function (a, b, c) {
21125      this.rgb = { r: a, g: b, b: c };
21126  },
21127  setRed: function (a) {
21128      this.rgb.r = a;
21129  },
21130  setGreen: function (a) {
21131      this.rgb.g = a;
21132  },
21133  setBlue: function (a) {
21134      this.rgb.b = a;
21135  },
21136  setHue: function (a) {
21137      var b = this.asHSB();
21138      b.h = a;
21139      this.rgb = OpenLayers.Rico.Color.HSBtoRGB(b.h, b.s, b.b);
21140  },
21141  setSaturation: function (a) {
21142      var b = this.asHSB();
21143      b.s = a;
21144      this.rgb = OpenLayers.Rico.Color.HSBtoRGB(b.h, b.s, b.b);
21145  },
21146  setBrightness: function (a) {
21147      var b = this.asHSB();
21148      b.b = a;
21149      this.rgb = OpenLayers.Rico.Color.HSBtoRGB(b.h, b.s, b.b);
21150  },
21151  darken: function (a) {
21152      var b = this.asHSB();
21153      this.rgb = OpenLayers.Rico.Color.HSBtoRGB(b.h, b.s, Math.max(b.b - a, 0));
21154  },
21155  brighten: function (a) {
21156      var b = this.asHSB();
21157      this.rgb = OpenLayers.Rico.Color.HSBtoRGB(b.h, b.s, Math.min(b.b + a, 1));
21158  },
21159  blend: function (a) {
21160      this.rgb.r = Math.floor((this.rgb.r + a.rgb.r) / 2);
21161      this.rgb.g = Math.floor((this.rgb.g + a.rgb.g) / 2);
21162      this.rgb.b = Math.floor((this.rgb.b + a.rgb.b) / 2);
21163  },
21164  isBright: function () {
21165      this.asHSB();
21166      return 0.5 < this.asHSB().b;
21167  },
21168  isDark: function () {
21169      return !this.isBright();
21170  },
21171  asRGB: function () {
21172      return "rgb(" + this.rgb.r + "," + this.rgb.g + "," + this.rgb.b + ")";
21173  },
21174  asHex: function () {
21175      return "#" + this.rgb.r.toColorPart() + this.rgb.g.toColorPart() + this.rgb.b.toColorPart();
21176  },
21177  asHSB: function () {
21178      return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r, this.rgb.g, this.rgb.b);
21179  },
21180  toString: function () {
21181      return this.asHex();
21182  },
21183});
21184OpenLayers.Rico.Color.createFromHex = function (a) {
21185  if (4 == a.length) {
21186      var b = a;
21187      a = "#";
21188      for (var c = 1; 4 > c; c++) a += b.charAt(c) + b.charAt(c);
21189  }
21190  0 == a.indexOf("#") && (a = a.substring(1));
21191  b = a.substring(0, 2);
21192  c = a.substring(2, 4);
21193  a = a.substring(4, 6);
21194  return new OpenLayers.Rico.Color(parseInt(b, 16), parseInt(c, 16), parseInt(a, 16));
21195};
21196OpenLayers.Rico.Color.createColorFromBackground = function (a) {
21197  var b = OpenLayers.Element.getStyle(OpenLayers.Util.getElement(a), "backgroundColor");
21198  return "transparent" == b && a.parentNode
21199      ? OpenLayers.Rico.Color.createColorFromBackground(a.parentNode)
21200      : null == b
21201      ? new OpenLayers.Rico.Color(255, 255, 255)
21202      : 0 == b.indexOf("rgb(")
21203      ? ((a = b.substring(4, b.length - 1).split(",")), new OpenLayers.Rico.Color(parseInt(a[0]), parseInt(a[1]), parseInt(a[2])))
21204      : 0 == b.indexOf("#")
21205      ? OpenLayers.Rico.Color.createFromHex(b)
21206      : new OpenLayers.Rico.Color(255, 255, 255);
21207};
21208OpenLayers.Rico.Color.HSBtoRGB = function (a, b, c) {
21209  var d = 0,
21210      e = 0,
21211      f = 0;
21212  if (0 == b) f = e = d = parseInt(255 * c + 0.5);
21213  else {
21214      a = 6 * (a - Math.floor(a));
21215      var g = a - Math.floor(a),
21216          h = c * (1 - b),
21217          k = c * (1 - b * g);
21218      b = c * (1 - b * (1 - g));
21219      switch (parseInt(a)) {
21220          case 0:
21221              d = 255 * c + 0.5;
21222              e = 255 * b + 0.5;
21223              f = 255 * h + 0.5;
21224              break;
21225          case 1:
21226              d = 255 * k + 0.5;
21227              e = 255 * c + 0.5;
21228              f = 255 * h + 0.5;
21229              break;
21230          case 2:
21231              d = 255 * h + 0.5;
21232              e = 255 * c + 0.5;
21233              f = 255 * b + 0.5;
21234              break;
21235          case 3:
21236              d = 255 * h + 0.5;
21237              e = 255 * k + 0.5;
21238              f = 255 * c + 0.5;
21239              break;
21240          case 4:
21241              d = 255 * b + 0.5;
21242              e = 255 * h + 0.5;
21243              f = 255 * c + 0.5;
21244              break;
21245          case 5:
21246              (d = 255 * c + 0.5), (e = 255 * h + 0.5), (f = 255 * k + 0.5);
21247      }
21248  }
21249  return { r: parseInt(d), g: parseInt(e), b: parseInt(f) };
21250};
21251OpenLayers.Rico.Color.RGBtoHSB = function (a, b, c) {
21252  var d,
21253      e = a > b ? a : b;
21254  c > e && (e = c);
21255  var f = a < b ? a : b;
21256  c < f && (f = c);
21257  d = 0 != e ? (e - f) / e : 0;
21258  if (0 == d) a = 0;
21259  else {
21260      var g = (e - a) / (e - f),
21261          h = (e - b) / (e - f);
21262      c = (e - c) / (e - f);
21263      a = (a == e ? c - h : b == e ? 2 + g - c : 4 + h - g) / 6;
21264      0 > a && (a += 1);
21265  }
21266  return { h: a, s: d, b: e / 255 };
21267};
21268OpenLayers.Style2 = OpenLayers.Class({
21269  id: null,
21270  name: null,
21271  title: null,
21272  description: null,
21273  layerName: null,
21274  isDefault: !1,
21275  rules: null,
21276  initialize: function (a) {
21277      OpenLayers.Util.extend(this, a);
21278      this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
21279  },
21280  destroy: function () {
21281      for (var a = 0, b = this.rules.length; a < b; a++) this.rules[a].destroy();
21282      delete this.rules;
21283  },
21284  clone: function () {
21285      var a = OpenLayers.Util.extend({}, this);
21286      if (this.rules) {
21287          a.rules = [];
21288          for (var b = 0, c = this.rules.length; b < c; ++b) a.rules.push(this.rules[b].clone());
21289      }
21290      return new OpenLayers.Style2(a);
21291  },
21292  CLASS_NAME: "OpenLayers.Style2",
21293});
21294OpenLayers.Format.WFS = OpenLayers.Class(OpenLayers.Format.GML, {
21295  layer: null,
21296  wfsns: "http://www.opengis.net/wfs",
21297  ogcns: "http://www.opengis.net/ogc",
21298  initialize: function (a, b) {
21299      OpenLayers.Format.GML.prototype.initialize.apply(this, [a]);
21300      this.layer = b;
21301      this.layer.featureNS && (this.featureNS = this.layer.featureNS);
21302      this.layer.options.geometry_column && (this.geometryName = this.layer.options.geometry_column);
21303      this.layer.options.typename && (this.featureName = this.layer.options.typename);
21304  },
21305  write: function (a) {
21306      var b = this.createElementNS(this.wfsns, "wfs:Transaction");
21307      b.setAttribute("version", "1.0.0");
21308      b.setAttribute("service", "WFS");
21309      for (var c = 0; c < a.length; c++)
21310          switch (a[c].state) {
21311              case OpenLayers.State.INSERT:
21312                  b.appendChild(this.insert(a[c]));
21313                  break;
21314              case OpenLayers.State.UPDATE:
21315                  b.appendChild(this.update(a[c]));
21316                  break;
21317              case OpenLayers.State.DELETE:
21318                  b.appendChild(this.remove(a[c]));
21319          }
21320      return OpenLayers.Format.XML.prototype.write.apply(this, [b]);
21321  },
21322  createFeatureXML: function (a) {
21323      var b = this.buildGeometryNode(a.geometry),
21324          c = this.createElementNS(this.featureNS, "feature:" + this.geometryName);
21325      c.appendChild(b);
21326      b = this.createElementNS(this.featureNS, "feature:" + this.featureName);
21327      b.appendChild(c);
21328      for (var d in a.attributes) {
21329          var c = this.createTextNode(a.attributes[d]),
21330              e = d;
21331          -1 != d.search(":") && (e = d.split(":")[1]);
21332          e = this.createElementNS(this.featureNS, "feature:" + e);
21333          e.appendChild(c);
21334          b.appendChild(e);
21335      }
21336      return b;
21337  },
21338  insert: function (a) {
21339      var b = this.createElementNS(this.wfsns, "wfs:Insert");
21340      b.appendChild(this.createFeatureXML(a));
21341      return b;
21342  },
21343  update: function (a) {
21344      a.fid || OpenLayers.Console.userError(OpenLayers.i18n("noFID"));
21345      var b = this.createElementNS(this.wfsns, "wfs:Update");
21346      b.setAttribute("typeName", this.featurePrefix + ":" + this.featureName);
21347      b.setAttribute("xmlns:" + this.featurePrefix, this.featureNS);
21348      var c = this.createElementNS(this.wfsns, "wfs:Property"),
21349          d = this.createElementNS(this.wfsns, "wfs:Name"),
21350          e = this.createTextNode(this.geometryName);
21351      d.appendChild(e);
21352      c.appendChild(d);
21353      d = this.createElementNS(this.wfsns, "wfs:Value");
21354      e = this.buildGeometryNode(a.geometry);
21355      a.layer && e.setAttribute("srsName", a.layer.projection.getCode());
21356      d.appendChild(e);
21357      c.appendChild(d);
21358      b.appendChild(c);
21359      for (var f in a.attributes)
21360          (c = this.createElementNS(this.wfsns, "wfs:Property")),
21361              (d = this.createElementNS(this.wfsns, "wfs:Name")),
21362              d.appendChild(this.createTextNode(f)),
21363              c.appendChild(d),
21364              (d = this.createElementNS(this.wfsns, "wfs:Value")),
21365              d.appendChild(this.createTextNode(a.attributes[f])),
21366              c.appendChild(d),
21367              b.appendChild(c);
21368      c = this.createElementNS(this.ogcns, "ogc:Filter");
21369      f = this.createElementNS(this.ogcns, "ogc:FeatureId");
21370      f.setAttribute("fid", a.fid);
21371      c.appendChild(f);
21372      b.appendChild(c);
21373      return b;
21374  },
21375  remove: function (a) {
21376      if (!a.fid) return OpenLayers.Console.userError(OpenLayers.i18n("noFID")), !1;
21377      var b = this.createElementNS(this.wfsns, "wfs:Delete");
21378      b.setAttribute("typeName", this.featurePrefix + ":" + this.featureName);
21379      b.setAttribute("xmlns:" + this.featurePrefix, this.featureNS);
21380      var c = this.createElementNS(this.ogcns, "ogc:Filter"),
21381          d = this.createElementNS(this.ogcns, "ogc:FeatureId");
21382      d.setAttribute("fid", a.fid);
21383      c.appendChild(d);
21384      b.appendChild(c);
21385      return b;
21386  },
21387  destroy: function () {
21388      this.layer = null;
21389  },
21390  CLASS_NAME: "OpenLayers.Format.WFS",
21391});
21392OpenLayers.Format.SLD.v1_0_0_GeoServer = OpenLayers.Class(OpenLayers.Format.SLD.v1_0_0, {
21393  version: "1.0.0",
21394  profile: "GeoServer",
21395  readers: OpenLayers.Util.applyDefaults(
21396      {
21397          sld: OpenLayers.Util.applyDefaults(
21398              {
21399                  Priority: function (a, b) {
21400                      var c = this.readers.ogc._expression.call(this, a);
21401                      c && (b.priority = c);
21402                  },
21403                  VendorOption: function (a, b) {
21404                      b.vendorOptions || (b.vendorOptions = {});
21405                      b.vendorOptions[a.getAttribute("name")] = this.getChildValue(a);
21406                  },
21407                  TextSymbolizer: function (a, b) {
21408                      OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld.TextSymbolizer.apply(this, arguments);
21409                      var c = this.multipleSymbolizers ? b.symbolizers[b.symbolizers.length - 1] : b.symbolizer.Text;
21410                      void 0 === c.graphic && (c.graphic = !1);
21411                  },
21412              },
21413              OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld
21414          ),
21415      },
21416      OpenLayers.Format.SLD.v1_0_0.prototype.readers
21417  ),
21418  writers: OpenLayers.Util.applyDefaults(
21419      {
21420          sld: OpenLayers.Util.applyDefaults(
21421              {
21422                  Priority: function (a) {
21423                      return this.writers.sld._OGCExpression.call(this, "sld:Priority", a);
21424                  },
21425                  VendorOption: function (a) {
21426                      return this.createElementNSPlus("sld:VendorOption", { attributes: { name: a.name }, value: a.value });
21427                  },
21428                  TextSymbolizer: function (a) {
21429                      var b = OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.TextSymbolizer.apply(this, arguments);
21430                      !1 !== a.graphic && (a.externalGraphic || a.graphicName) && this.writeNode("Graphic", a, b);
21431                      "priority" in a && this.writeNode("Priority", a.priority, b);
21432                      return this.addVendorOptions(b, a);
21433                  },
21434                  PointSymbolizer: function (a) {
21435                      var b = OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PointSymbolizer.apply(this, arguments);
21436                      return this.addVendorOptions(b, a);
21437                  },
21438                  LineSymbolizer: function (a) {
21439                      var b = OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.LineSymbolizer.apply(this, arguments);
21440                      return this.addVendorOptions(b, a);
21441                  },
21442                  PolygonSymbolizer: function (a) {
21443                      var b = OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PolygonSymbolizer.apply(this, arguments);
21444                      return this.addVendorOptions(b, a);
21445                  },
21446              },
21447              OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld
21448          ),
21449      },
21450      OpenLayers.Format.SLD.v1_0_0.prototype.writers
21451  ),
21452  addVendorOptions: function (a, b) {
21453      if (b.vendorOptions) for (var c in b.vendorOptions) this.writeNode("VendorOption", { name: c, value: b.vendorOptions[c] }, a);
21454      return a;
21455  },
21456  CLASS_NAME: "OpenLayers.Format.SLD.v1_0_0_GeoServer",
21457});
21458OpenLayers.Layer.Boxes = OpenLayers.Class(OpenLayers.Layer.Markers, {
21459  drawMarker: function (a) {
21460      var b = this.map.getLayerPxFromLonLat({ lon: a.bounds.left, lat: a.bounds.top }),
21461          c = this.map.getLayerPxFromLonLat({ lon: a.bounds.right, lat: a.bounds.bottom });
21462      null == c || null == b ? a.display(!1) : ((b = a.draw(b, { w: Math.max(1, c.x - b.x), h: Math.max(1, c.y - b.y) })), a.drawn || (this.div.appendChild(b), (a.drawn = !0)));
21463  },
21464  removeMarker: function (a) {
21465      OpenLayers.Util.removeItem(this.markers, a);
21466      null != a.div && a.div.parentNode == this.div && this.div.removeChild(a.div);
21467  },
21468  CLASS_NAME: "OpenLayers.Layer.Boxes",
21469});
21470OpenLayers.Format.WFSCapabilities.v1_0_0 = OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1, {
21471  readers: {
21472      wfs: OpenLayers.Util.applyDefaults(
21473          {
21474              Service: function (a, b) {
21475                  b.service = {};
21476                  this.readChildNodes(a, b.service);
21477              },
21478              Fees: function (a, b) {
21479                  var c = this.getChildValue(a);
21480                  c && "none" != c.toLowerCase() && (b.fees = c);
21481              },
21482              AccessConstraints: function (a, b) {
21483                  var c = this.getChildValue(a);
21484                  c && "none" != c.toLowerCase() && (b.accessConstraints = c);
21485              },
21486              OnlineResource: function (a, b) {
21487                  var c = this.getChildValue(a);
21488                  c && "none" != c.toLowerCase() && (b.onlineResource = c);
21489              },
21490              Keywords: function (a, b) {
21491                  var c = this.getChildValue(a);
21492                  c && "none" != c.toLowerCase() && (b.keywords = c.split(", "));
21493              },
21494              Capability: function (a, b) {
21495                  b.capability = {};
21496                  this.readChildNodes(a, b.capability);
21497              },
21498              Request: function (a, b) {
21499                  b.request = {};
21500                  this.readChildNodes(a, b.request);
21501              },
21502              GetFeature: function (a, b) {
21503                  b.getfeature = { href: {}, formats: [] };
21504                  this.readChildNodes(a, b.getfeature);
21505              },
21506              ResultFormat: function (a, b) {
21507                  for (var c = a.childNodes, d, e = 0; e < c.length; e++) (d = c[e]), 1 == d.nodeType && b.formats.push(d.nodeName);
21508              },
21509              DCPType: function (a, b) {
21510                  this.readChildNodes(a, b);
21511              },
21512              HTTP: function (a, b) {
21513                  this.readChildNodes(a, b.href);
21514              },
21515              Get: function (a, b) {
21516                  b.get = a.getAttribute("onlineResource");
21517              },
21518              Post: function (a, b) {
21519                  b.post = a.getAttribute("onlineResource");
21520              },
21521              SRS: function (a, b) {
21522                  var c = this.getChildValue(a);
21523                  c && (b.srs = c);
21524              },
21525          },
21526          OpenLayers.Format.WFSCapabilities.v1.prototype.readers.wfs
21527      ),
21528  },
21529  CLASS_NAME: "OpenLayers.Format.WFSCapabilities.v1_0_0",
21530});
21531OpenLayers.Format.WMSCapabilities.v1_3 = OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1, {
21532  readers: {
21533      wms: OpenLayers.Util.applyDefaults(
21534          {
21535              WMS_Capabilities: function (a, b) {
21536                  this.readChildNodes(a, b);
21537              },
21538              LayerLimit: function (a, b) {
21539                  b.layerLimit = parseInt(this.getChildValue(a));
21540              },
21541              MaxWidth: function (a, b) {
21542                  b.maxWidth = parseInt(this.getChildValue(a));
21543              },
21544              MaxHeight: function (a, b) {
21545                  b.maxHeight = parseInt(this.getChildValue(a));
21546              },
21547              BoundingBox: function (a, b) {
21548                  var c = OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this, [a, b]);
21549                  c.srs = a.getAttribute("CRS");
21550                  b.bbox[c.srs] = c;
21551              },
21552              CRS: function (a, b) {
21553                  this.readers.wms.SRS.apply(this, [a, b]);
21554              },
21555              EX_GeographicBoundingBox: function (a, b) {
21556                  b.llbbox = [];
21557                  this.readChildNodes(a, b.llbbox);
21558              },
21559              westBoundLongitude: function (a, b) {
21560                  b[0] = this.getChildValue(a);
21561              },
21562              eastBoundLongitude: function (a, b) {
21563                  b[2] = this.getChildValue(a);
21564              },
21565              southBoundLatitude: function (a, b) {
21566                  b[1] = this.getChildValue(a);
21567              },
21568              northBoundLatitude: function (a, b) {
21569                  b[3] = this.getChildValue(a);
21570              },
21571              MinScaleDenominator: function (a, b) {
21572                  b.maxScale = parseFloat(this.getChildValue(a)).toPrecision(16);
21573              },
21574              MaxScaleDenominator: function (a, b) {
21575                  b.minScale = parseFloat(this.getChildValue(a)).toPrecision(16);
21576              },
21577              Dimension: function (a, b) {
21578                  var c = {
21579                      name: a.getAttribute("name").toLowerCase(),
21580                      units: a.getAttribute("units"),
21581                      unitsymbol: a.getAttribute("unitSymbol"),
21582                      nearestVal: "1" === a.getAttribute("nearestValue"),
21583                      multipleVal: "1" === a.getAttribute("multipleValues"),
21584                      default: a.getAttribute("default") || "",
21585                      current: "1" === a.getAttribute("current"),
21586                      values: this.getChildValue(a).split(","),
21587                  };
21588                  b.dimensions[c.name] = c;
21589              },
21590              Keyword: function (a, b) {
21591                  var c = { value: this.getChildValue(a), vocabulary: a.getAttribute("vocabulary") };
21592                  b.keywords && b.keywords.push(c);
21593              },
21594          },
21595          OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms
21596      ),
21597      sld: {
21598          UserDefinedSymbolization: function (a, b) {
21599              this.readers.wms.UserDefinedSymbolization.apply(this, [a, b]);
21600              b.userSymbols.inlineFeature = 1 == parseInt(a.getAttribute("InlineFeature"));
21601              b.userSymbols.remoteWCS = 1 == parseInt(a.getAttribute("RemoteWCS"));
21602          },
21603          DescribeLayer: function (a, b) {
21604              this.readers.wms.DescribeLayer.apply(this, [a, b]);
21605          },
21606          GetLegendGraphic: function (a, b) {
21607              this.readers.wms.GetLegendGraphic.apply(this, [a, b]);
21608          },
21609      },
21610  },
21611  CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1_3",
21612});
21613OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
21614  size: null,
21615  isBaseLayer: !0,
21616  standardTileSize: 256,
21617  tileOriginCorner: "tl",
21618  numberOfTiers: 0,
21619  tileCountUpToTier: null,
21620  tierSizeInTiles: null,
21621  tierImageSize: null,
21622  initialize: function (a, b, c, d) {
21623      this.initializeZoomify(c);
21624      OpenLayers.Layer.Grid.prototype.initialize.apply(this, [a, b, c, {}, d]);
21625  },
21626  initializeZoomify: function (a) {
21627      var b = a.clone();
21628      this.size = a.clone();
21629      a = new OpenLayers.Size(Math.ceil(b.w / this.standardTileSize), Math.ceil(b.h / this.standardTileSize));
21630      this.tierSizeInTiles = [a];
21631      for (this.tierImageSize = [b]; b.w > this.standardTileSize || b.h > this.standardTileSize; )
21632          (b = new OpenLayers.Size(Math.floor(b.w / 2), Math.floor(b.h / 2))),
21633              (a = new OpenLayers.Size(Math.ceil(b.w / this.standardTileSize), Math.ceil(b.h / this.standardTileSize))),
21634              this.tierSizeInTiles.push(a),
21635              this.tierImageSize.push(b);
21636      this.tierSizeInTiles.reverse();
21637      this.tierImageSize.reverse();
21638      this.numberOfTiers = this.tierSizeInTiles.length;
21639      b = [1];
21640      this.tileCountUpToTier = [0];
21641      for (a = 1; a < this.numberOfTiers; a++) b.unshift(Math.pow(2, a)), this.tileCountUpToTier.push(this.tierSizeInTiles[a - 1].w * this.tierSizeInTiles[a - 1].h + this.tileCountUpToTier[a - 1]);
21642      this.serverResolutions || (this.serverResolutions = b);
21643  },
21644  destroy: function () {
21645      OpenLayers.Layer.Grid.prototype.destroy.apply(this, arguments);
21646      this.tileCountUpToTier.length = 0;
21647      this.tierSizeInTiles.length = 0;
21648      this.tierImageSize.length = 0;
21649  },
21650  clone: function (a) {
21651      null == a && (a = new OpenLayers.Layer.Zoomify(this.name, this.url, this.size, this.options));
21652      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
21653  },
21654  getURL: function (a) {
21655      a = this.adjustBounds(a);
21656      var b = this.getServerResolution(),
21657          c = Math.round((a.left - this.tileOrigin.lon) / (b * this.tileSize.w));
21658      a = Math.round((this.tileOrigin.lat - a.top) / (b * this.tileSize.h));
21659      b = this.getZoomForResolution(b);
21660      c = "TileGroup" + Math.floor((c + a * this.tierSizeInTiles[b].w + this.tileCountUpToTier[b]) / 256) + "/" + b + "-" + c + "-" + a + ".jpg";
21661      b = this.url;
21662      OpenLayers.Util.isArray(b) && (b = this.selectUrl(c, b));
21663      return b + c;
21664  },
21665  getImageSize: function () {
21666      if (0 < arguments.length) {
21667          var a = this.adjustBounds(arguments[0]),
21668              b = this.getServerResolution(),
21669              c = Math.round((a.left - this.tileOrigin.lon) / (b * this.tileSize.w)),
21670              a = Math.round((this.tileOrigin.lat - a.top) / (b * this.tileSize.h)),
21671              b = this.getZoomForResolution(b),
21672              d = this.standardTileSize,
21673              e = this.standardTileSize;
21674          c == this.tierSizeInTiles[b].w - 1 && (d = this.tierImageSize[b].w % this.standardTileSize);
21675          a == this.tierSizeInTiles[b].h - 1 && (e = this.tierImageSize[b].h % this.standardTileSize);
21676          return new OpenLayers.Size(d, e);
21677      }
21678      return this.tileSize;
21679  },
21680  setMap: function (a) {
21681      OpenLayers.Layer.Grid.prototype.setMap.apply(this, arguments);
21682      this.tileOrigin = new OpenLayers.LonLat(this.map.maxExtent.left, this.map.maxExtent.top);
21683  },
21684  CLASS_NAME: "OpenLayers.Layer.Zoomify",
21685});
21686OpenLayers.Layer.MapServer = OpenLayers.Class(OpenLayers.Layer.Grid, {
21687  DEFAULT_PARAMS: { mode: "map", map_imagetype: "png" },
21688  initialize: function (a, b, c, d) {
21689      OpenLayers.Layer.Grid.prototype.initialize.apply(this, arguments);
21690      this.params = OpenLayers.Util.applyDefaults(this.params, this.DEFAULT_PARAMS);
21691      if (null == d || null == d.isBaseLayer) this.isBaseLayer = "true" != this.params.transparent && !0 != this.params.transparent;
21692  },
21693  clone: function (a) {
21694      null == a && (a = new OpenLayers.Layer.MapServer(this.name, this.url, this.params, this.getOptions()));
21695      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
21696  },
21697  getURL: function (a) {
21698      a = this.adjustBounds(a);
21699      a = [a.left, a.bottom, a.right, a.top];
21700      var b = this.getImageSize();
21701      return this.getFullRequestString({ mapext: a, imgext: a, map_size: [b.w, b.h], imgx: b.w / 2, imgy: b.h / 2, imgxy: [b.w, b.h] });
21702  },
21703  getFullRequestString: function (a, b) {
21704      var c = null == b ? this.url : b,
21705          d = OpenLayers.Util.extend({}, this.params),
21706          d = OpenLayers.Util.extend(d, a),
21707          e = OpenLayers.Util.getParameterString(d);
21708      OpenLayers.Util.isArray(c) && (c = this.selectUrl(e, c));
21709      var e = OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c)),
21710          f;
21711      for (f in d) f.toUpperCase() in e && delete d[f];
21712      e = OpenLayers.Util.getParameterString(d);
21713      d = c;
21714      e = e.replace(/,/g, "+");
21715      "" != e && ((f = c.charAt(c.length - 1)), (d = "&" == f || "?" == f ? d + e : -1 == c.indexOf("?") ? d + ("?" + e) : d + ("&" + e)));
21716      return d;
21717  },
21718  CLASS_NAME: "OpenLayers.Layer.MapServer",
21719});
21720OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
21721  xmlns: "urn:schemas-microsoft-com:vml",
21722  symbolCache: {},
21723  offset: null,
21724  initialize: function (a) {
21725      if (this.supported()) {
21726          if (!document.namespaces.olv) {
21727              document.namespaces.add("olv", this.xmlns);
21728              for (var b = document.createStyleSheet(), c = "shape rect oval fill stroke imagedata group textbox".split(" "), d = 0, e = c.length; d < e; d++)
21729                  b.addRule("olv\\:" + c[d], "behavior: url(#default#VML); position: absolute; display: inline-block;");
21730          }
21731          OpenLayers.Renderer.Elements.prototype.initialize.apply(this, arguments);
21732      }
21733  },
21734  supported: function () {
21735      return !!document.namespaces;
21736  },
21737  setExtent: function (a, b) {
21738      var c = OpenLayers.Renderer.Elements.prototype.setExtent.apply(this, arguments),
21739          d = this.getResolution(),
21740          e = (a.left / d) | 0,
21741          d = (a.top / d - this.size.h) | 0;
21742      b || !this.offset ? ((this.offset = { x: e, y: d }), (d = e = 0)) : ((e -= this.offset.x), (d -= this.offset.y));
21743      this.root.coordorigin = e - this.xOffset + " " + d;
21744      for (var e = [this.root, this.vectorRoot, this.textRoot], f = 0, g = e.length; f < g; ++f) (d = e[f]), (d.coordsize = this.size.w + " " + this.size.h);
21745      this.root.style.flip = "y";
21746      return c;
21747  },
21748  setSize: function (a) {
21749      OpenLayers.Renderer.prototype.setSize.apply(this, arguments);
21750      for (var b = [this.rendererRoot, this.root, this.vectorRoot, this.textRoot], c = this.size.w + "px", d = this.size.h + "px", e, f = 0, g = b.length; f < g; ++f) (e = b[f]), (e.style.width = c), (e.style.height = d);
21751  },
21752  getNodeType: function (a, b) {
21753      var c = null;
21754      switch (a.CLASS_NAME) {
21755          case "OpenLayers.Geometry.Point":
21756              c = b.externalGraphic ? "olv:rect" : this.isComplexSymbol(b.graphicName) ? "olv:shape" : "olv:oval";
21757              break;
21758          case "OpenLayers.Geometry.Rectangle":
21759              c = "olv:rect";
21760              break;
21761          case "OpenLayers.Geometry.LineString":
21762          case "OpenLayers.Geometry.LinearRing":
21763          case "OpenLayers.Geometry.Polygon":
21764          case "OpenLayers.Geometry.Curve":
21765              c = "olv:shape";
21766      }
21767      return c;
21768  },
21769  setStyle: function (a, b, c, d) {
21770      b = b || a._style;
21771      c = c || a._options;
21772      var e = b.fillColor,
21773          f = b.title || b.graphicTitle;
21774      f && (a.title = f);
21775      if ("OpenLayers.Geometry.Point" === a._geometryClass)
21776          if (b.externalGraphic) {
21777              c.isFilled = !0;
21778              var e = b.graphicWidth || b.graphicHeight,
21779                  f = b.graphicHeight || b.graphicWidth,
21780                  e = e ? e : 2 * b.pointRadius,
21781                  f = f ? f : 2 * b.pointRadius,
21782                  g = this.getResolution(),
21783                  h = void 0 != b.graphicXOffset ? b.graphicXOffset : -(0.5 * e),
21784                  k = void 0 != b.graphicYOffset ? b.graphicYOffset : -(0.5 * f);
21785              a.style.left = (((d.x - this.featureDx) / g - this.offset.x + h) | 0) + "px";
21786              a.style.top = ((d.y / g - this.offset.y - (k + f)) | 0) + "px";
21787              a.style.width = e + "px";
21788              a.style.height = f + "px";
21789              a.style.flip = "y";
21790              e = "none";
21791              c.isStroked = !1;
21792          } else
21793              this.isComplexSymbol(b.graphicName)
21794                  ? ((f = this.importSymbol(b.graphicName)), (a.path = f.path), (a.coordorigin = f.left + "," + f.bottom), (f = f.size), (a.coordsize = f + "," + f), this.drawCircle(a, d, b.pointRadius), (a.style.flip = "y"))
21795                  : this.drawCircle(a, d, b.pointRadius);
21796      c.isFilled ? (a.fillcolor = e) : (a.filled = "false");
21797      d = a.getElementsByTagName("fill");
21798      d = 0 == d.length ? null : d[0];
21799      c.isFilled
21800          ? (d || (d = this.createNode("olv:fill", a.id + "_fill")),
21801            (d.opacity = b.fillOpacity),
21802            "OpenLayers.Geometry.Point" === a._geometryClass &&
21803                b.externalGraphic &&
21804                (b.graphicOpacity && (d.opacity = b.graphicOpacity), (d.src = b.externalGraphic), (d.type = "frame"), (b.graphicWidth && b.graphicHeight) || (d.aspect = "atmost")),
21805            d.parentNode != a && a.appendChild(d))
21806          : d && a.removeChild(d);
21807      e = b.rotation;
21808      if (void 0 !== e || void 0 !== a._rotation) (a._rotation = e), b.externalGraphic ? (this.graphicRotate(a, h, k, b), (d.opacity = 0)) : "OpenLayers.Geometry.Point" === a._geometryClass && (a.style.rotation = e || 0);
21809      h = a.getElementsByTagName("stroke");
21810      h = 0 == h.length ? null : h[0];
21811      c.isStroked
21812          ? (h || ((h = this.createNode("olv:stroke", a.id + "_stroke")), a.appendChild(h)),
21813            (h.on = !0),
21814            (h.color = b.strokeColor),
21815            (h.weight = b.strokeWidth + "px"),
21816            (h.opacity = b.strokeOpacity),
21817            (h.endcap = "butt" == b.strokeLinecap ? "flat" : b.strokeLinecap || "round"),
21818            b.strokeDashstyle && (h.dashstyle = this.dashStyle(b)))
21819          : ((a.stroked = !1), h && (h.on = !1));
21820      "inherit" != b.cursor && null != b.cursor && (a.style.cursor = b.cursor);
21821      return a;
21822  },
21823  graphicRotate: function (a, b, c, d) {
21824      d = d || a._style;
21825      var e = d.rotation || 0,
21826          f,
21827          g;
21828      if (d.graphicWidth && d.graphicHeight) {
21829          g = Math.max(d.graphicWidth, d.graphicHeight);
21830          f = d.graphicWidth / d.graphicHeight;
21831          var h = Math.round(d.graphicWidth || g * f),
21832              k = Math.round(d.graphicHeight || g);
21833          a.style.width = h + "px";
21834          a.style.height = k + "px";
21835          var l = document.getElementById(a.id + "_image");
21836          l || ((l = this.createNode("olv:imagedata", a.id + "_image")), a.appendChild(l));
21837          l.style.width = h + "px";
21838          l.style.height = k + "px";
21839          l.src = d.externalGraphic;
21840          l.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";
21841          l = (e * Math.PI) / 180;
21842          e = Math.sin(l);
21843          l = Math.cos(l);
21844          e = "progid:DXImageTransform.Microsoft.Matrix(M11=" + l + ",M12=" + -e + ",M21=" + e + ",M22=" + l + ",SizingMethod='auto expand')\n";
21845          (l = d.graphicOpacity || d.fillOpacity) && 1 != l && (e += "progid:DXImageTransform.Microsoft.BasicImage(opacity=" + l + ")\n");
21846          a.style.filter = e;
21847          e = new OpenLayers.Geometry.Point(-b, -c);
21848          h = new OpenLayers.Bounds(0, 0, h, k).toGeometry();
21849          h.rotate(d.rotation, e);
21850          h = h.getBounds();
21851          a.style.left = Math.round(parseInt(a.style.left) + h.left) + "px";
21852          a.style.top = Math.round(parseInt(a.style.top) - h.bottom) + "px";
21853      } else {
21854          var m = new Image();
21855          m.onreadystatechange = OpenLayers.Function.bind(function () {
21856              if ("complete" == m.readyState || "interactive" == m.readyState)
21857                  (f = m.width / m.height), (g = Math.max(2 * d.pointRadius, d.graphicWidth || 0, d.graphicHeight || 0)), (b *= f), (d.graphicWidth = g * f), (d.graphicHeight = g), this.graphicRotate(a, b, c, d);
21858          }, this);
21859          m.src = d.externalGraphic;
21860      }
21861  },
21862  postDraw: function (a) {
21863      a.style.visibility = "visible";
21864      var b = a._style.fillColor,
21865          c = a._style.strokeColor;
21866      "none" == b && a.fillcolor != b && (a.fillcolor = b);
21867      "none" == c && a.strokecolor != c && (a.strokecolor = c);
21868  },
21869  setNodeDimension: function (a, b) {
21870      var c = b.getBounds();
21871      if (c) {
21872          var d = this.getResolution(),
21873              c = new OpenLayers.Bounds(((c.left - this.featureDx) / d - this.offset.x) | 0, (c.bottom / d - this.offset.y) | 0, ((c.right - this.featureDx) / d - this.offset.x) | 0, (c.top / d - this.offset.y) | 0);
21874          a.style.left = c.left + "px";
21875          a.style.top = c.top + "px";
21876          a.style.width = c.getWidth() + "px";
21877          a.style.height = c.getHeight() + "px";
21878          a.coordorigin = c.left + " " + c.top;
21879          a.coordsize = c.getWidth() + " " + c.getHeight();
21880      }
21881  },
21882  dashStyle: function (a) {
21883      a = a.strokeDashstyle;
21884      switch (a) {
21885          case "solid":
21886          case "dot":
21887          case "dash":
21888          case "dashdot":
21889          case "longdash":
21890          case "longdashdot":
21891              return a;
21892          default:
21893              return (a = a.split(/[ ,]/)), 2 == a.length ? (1 * a[0] >= 2 * a[1] ? "longdash" : 1 == a[0] || 1 == a[1] ? "dot" : "dash") : 4 == a.length ? (1 * a[0] >= 2 * a[1] ? "longdashdot" : "dashdot") : "solid";
21894      }
21895  },
21896  createNode: function (a, b) {
21897      var c = document.createElement(a);
21898      b && (c.id = b);
21899      c.unselectable = "on";
21900      c.onselectstart = OpenLayers.Function.False;
21901      return c;
21902  },
21903  nodeTypeCompare: function (a, b) {
21904      var c = b,
21905          d = c.indexOf(":");
21906      -1 != d && (c = c.substr(d + 1));
21907      var e = a.nodeName,
21908          d = e.indexOf(":");
21909      -1 != d && (e = e.substr(d + 1));
21910      return c == e;
21911  },
21912  createRenderRoot: function () {
21913      return this.nodeFactory(this.container.id + "_vmlRoot", "div");
21914  },
21915  createRoot: function (a) {
21916      return this.nodeFactory(this.container.id + a, "olv:group");
21917  },
21918  drawPoint: function (a, b) {
21919      return this.drawCircle(a, b, 1);
21920  },
21921  drawCircle: function (a, b, c) {
21922      if (!isNaN(b.x) && !isNaN(b.y)) {
21923          var d = this.getResolution();
21924          a.style.left = (((b.x - this.featureDx) / d - this.offset.x) | 0) - c + "px";
21925          a.style.top = ((b.y / d - this.offset.y) | 0) - c + "px";
21926          b = 2 * c;
21927          a.style.width = b + "px";
21928          a.style.height = b + "px";
21929          return a;
21930      }
21931      return !1;
21932  },
21933  drawLineString: function (a, b) {
21934      return this.drawLine(a, b, !1);
21935  },
21936  drawLinearRing: function (a, b) {
21937      return this.drawLine(a, b, !0);
21938  },
21939  drawLine: function (a, b, c) {
21940      this.setNodeDimension(a, b);
21941      for (var d = this.getResolution(), e = b.components.length, f = Array(e), g, h, k = 0; k < e; k++)
21942          (g = b.components[k]), (h = ((g.x - this.featureDx) / d - this.offset.x) | 0), (g = (g.y / d - this.offset.y) | 0), (f[k] = " " + h + "," + g + " l ");
21943      b = c ? " x e" : " e";
21944      a.path = "m" + f.join("") + b;
21945      return a;
21946  },
21947  drawPolygon: function (a, b) {
21948      this.setNodeDimension(a, b);
21949      var c = this.getResolution(),
21950          d = [],
21951          e,
21952          f,
21953          g,
21954          h,
21955          k,
21956          l,
21957          m,
21958          n,
21959          p,
21960          q;
21961      e = 0;
21962      for (f = b.components.length; e < f; e++) {
21963          d.push("m");
21964          g = b.components[e].components;
21965          h = 0 === e;
21966          l = k = null;
21967          m = 0;
21968          for (n = g.length; m < n; m++)
21969              (p = g[m]),
21970                  (q = ((p.x - this.featureDx) / c - this.offset.x) | 0),
21971                  (p = (p.y / c - this.offset.y) | 0),
21972                  (q = " " + q + "," + p),
21973                  d.push(q),
21974                  0 == m && d.push(" l"),
21975                  h || (k ? k != q && (l ? l != q && (h = !0) : (l = q)) : (k = q));
21976          d.push(h ? " x " : " ");
21977      }
21978      d.push("e");
21979      a.path = d.join("");
21980      return a;
21981  },
21982  drawRectangle: function (a, b) {
21983      var c = this.getResolution();
21984      a.style.left = (((b.x - this.featureDx) / c - this.offset.x) | 0) + "px";
21985      a.style.top = ((b.y / c - this.offset.y) | 0) + "px";
21986      a.style.width = ((b.width / c) | 0) + "px";
21987      a.style.height = ((b.height / c) | 0) + "px";
21988      return a;
21989  },
21990  drawText: function (a, b, c) {
21991      var d = this.nodeFactory(a + this.LABEL_ID_SUFFIX, "olv:rect"),
21992          e = this.nodeFactory(a + this.LABEL_ID_SUFFIX + "_textbox", "olv:textbox"),
21993          f = this.getResolution();
21994      d.style.left = (((c.x - this.featureDx) / f - this.offset.x) | 0) + "px";
21995      d.style.top = ((c.y / f - this.offset.y) | 0) + "px";
21996      d.style.flip = "y";
21997      e.innerText = b.label;
21998      "inherit" != b.cursor && null != b.cursor && (e.style.cursor = b.cursor);
21999      b.fontColor && (e.style.color = b.fontColor);
22000      b.fontOpacity && (e.style.filter = "alpha(opacity=" + 100 * b.fontOpacity + ")");
22001      b.fontFamily && (e.style.fontFamily = b.fontFamily);
22002      b.fontSize && (e.style.fontSize = b.fontSize);
22003      b.fontWeight && (e.style.fontWeight = b.fontWeight);
22004      b.fontStyle && (e.style.fontStyle = b.fontStyle);
22005      !0 === b.labelSelect && ((d._featureId = a), (e._featureId = a), (e._geometry = c), (e._geometryClass = c.CLASS_NAME));
22006      e.style.whiteSpace = "nowrap";
22007      e.inset = "1px,0px,0px,0px";
22008      d.parentNode || (d.appendChild(e), this.textRoot.appendChild(d));
22009      b = b.labelAlign || "cm";
22010      1 == b.length && (b += "m");
22011      a = e.clientWidth * OpenLayers.Renderer.VML.LABEL_SHIFT[b.substr(0, 1)];
22012      e = e.clientHeight * OpenLayers.Renderer.VML.LABEL_SHIFT[b.substr(1, 1)];
22013      d.style.left = parseInt(d.style.left) - a - 1 + "px";
22014      d.style.top = parseInt(d.style.top) + e + "px";
22015  },
22016  moveRoot: function (a) {
22017      var b = this.map.getLayer(a.container.id);
22018      b instanceof OpenLayers.Layer.Vector.RootContainer && (b = this.map.getLayer(this.container.id));
22019      b && b.renderer.clear();
22020      OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this, arguments);
22021      b && b.redraw();
22022  },
22023  importSymbol: function (a) {
22024      var b = this.container.id + "-" + a,
22025          c = this.symbolCache[b];
22026      if (c) return c;
22027      c = OpenLayers.Renderer.symbol[a];
22028      if (!c) throw Error(a + " is not a valid symbol name");
22029      a = new OpenLayers.Bounds(Number.MAX_VALUE, Number.MAX_VALUE, 0, 0);
22030      for (var d = ["m"], e = 0; e < c.length; e += 2) {
22031          var f = c[e],
22032              g = c[e + 1];
22033          a.left = Math.min(a.left, f);
22034          a.bottom = Math.min(a.bottom, g);
22035          a.right = Math.max(a.right, f);
22036          a.top = Math.max(a.top, g);
22037          d.push(f);
22038          d.push(g);
22039          0 == e && d.push("l");
22040      }
22041      d.push("x e");
22042      c = d.join(" ");
22043      d = (a.getWidth() - a.getHeight()) / 2;
22044      0 < d ? ((a.bottom -= d), (a.top += d)) : ((a.left += d), (a.right -= d));
22045      c = { path: c, size: a.getWidth(), left: a.left, bottom: a.bottom };
22046      return (this.symbolCache[b] = c);
22047  },
22048  CLASS_NAME: "OpenLayers.Renderer.VML",
22049});
22050OpenLayers.Renderer.VML.LABEL_SHIFT = { l: 0, c: 0.5, r: 1, t: 0, m: 0.5, b: 1 };
22051OpenLayers.Control.CacheRead = OpenLayers.Class(OpenLayers.Control, {
22052  fetchEvent: "tileloadstart",
22053  layers: null,
22054  autoActivate: !0,
22055  setMap: function (a) {
22056      OpenLayers.Control.prototype.setMap.apply(this, arguments);
22057      var b,
22058          c = this.layers || a.layers;
22059      for (b = c.length - 1; 0 <= b; --b) this.addLayer({ layer: c[b] });
22060      if (!this.layers) a.events.on({ addlayer: this.addLayer, removeLayer: this.removeLayer, scope: this });
22061  },
22062  addLayer: function (a) {
22063      a.layer.events.register(this.fetchEvent, this, this.fetch);
22064  },
22065  removeLayer: function (a) {
22066      a.layer.events.unregister(this.fetchEvent, this, this.fetch);
22067  },
22068  fetch: function (a) {
22069      if (this.active && window.localStorage && a.tile instanceof OpenLayers.Tile.Image) {
22070          var b = a.tile,
22071              c = b.url;
22072          !b.layer.crossOriginKeyword && OpenLayers.ProxyHost && 0 === c.indexOf(OpenLayers.ProxyHost) && (c = OpenLayers.Control.CacheWrite.urlMap[c]);
22073          if ((c = window.localStorage.getItem("olCache_" + c))) (b.url = c), "tileerror" === a.type && b.setImgSrc(c);
22074      }
22075  },
22076  destroy: function () {
22077      if (this.layers || this.map) {
22078          var a,
22079              b = this.layers || this.map.layers;
22080          for (a = b.length - 1; 0 <= a; --a) this.removeLayer({ layer: b[a] });
22081      }
22082      this.map && this.map.events.un({ addlayer: this.addLayer, removeLayer: this.removeLayer, scope: this });
22083      OpenLayers.Control.prototype.destroy.apply(this, arguments);
22084  },
22085  CLASS_NAME: "OpenLayers.Control.CacheRead",
22086});
22087OpenLayers.Protocol.WFS.v1_0_0 = OpenLayers.Class(OpenLayers.Protocol.WFS.v1, { version: "1.0.0", CLASS_NAME: "OpenLayers.Protocol.WFS.v1_0_0" });
22088OpenLayers.Format.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Format.XML, {
22089  layerIdentifier: "_layer",
22090  featureIdentifier: "_feature",
22091  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
22092  gmlFormat: null,
22093  read: function (a) {
22094      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
22095      var b = a.documentElement;
22096      if (b) {
22097          var c = this["read_" + b.nodeName];
22098          a = c ? c.call(this, b) : new OpenLayers.Format.GML(this.options ? this.options : {}).read(a);
22099      }
22100      return a;
22101  },
22102  read_msGMLOutput: function (a) {
22103      var b = [];
22104      if ((a = this.getSiblingNodesByTagCriteria(a, this.layerIdentifier)))
22105          for (var c = 0, d = a.length; c < d; ++c) {
22106              var e = a[c],
22107                  f = e.nodeName;
22108              e.prefix && (f = f.split(":")[1]);
22109              f = f.replace(this.layerIdentifier, "");
22110              if ((e = this.getSiblingNodesByTagCriteria(e, this.featureIdentifier)))
22111                  for (var g = 0; g < e.length; g++) {
22112                      var h = e[g],
22113                          k = this.parseGeometry(h),
22114                          h = this.parseAttributes(h),
22115                          h = new OpenLayers.Feature.Vector(k.geometry, h, null);
22116                      h.bounds = k.bounds;
22117                      h.type = f;
22118                      b.push(h);
22119                  }
22120          }
22121      return b;
22122  },
22123  read_FeatureInfoResponse: function (a) {
22124      var b = [];
22125      a = this.getElementsByTagNameNS(a, "*", "FIELDS");
22126      for (var c = 0, d = a.length; c < d; c++) {
22127          var e = a[c],
22128              f = {},
22129              g,
22130              h = e.attributes.length;
22131          if (0 < h)
22132              for (g = 0; g < h; g++) {
22133                  var k = e.attributes[g];
22134                  f[k.nodeName] = k.nodeValue;
22135              }
22136          else for (e = e.childNodes, g = 0, h = e.length; g < h; ++g) (k = e[g]), 3 != k.nodeType && (f[k.getAttribute("name")] = k.getAttribute("value"));
22137          b.push(new OpenLayers.Feature.Vector(null, f, null));
22138      }
22139      return b;
22140  },
22141  getSiblingNodesByTagCriteria: function (a, b) {
22142      var c = [],
22143          d,
22144          e,
22145          f,
22146          g;
22147      if (a && a.hasChildNodes()) {
22148          d = a.childNodes;
22149          f = d.length;
22150          for (var h = 0; h < f; h++) {
22151              for (g = d[h]; g && 1 != g.nodeType; ) (g = g.nextSibling), h++;
22152              e = g ? g.nodeName : "";
22153              0 < e.length && -1 < e.indexOf(b) ? c.push(g) : ((e = this.get
22153SiblingNodesByTagCriteria(g, b)), 0 < e.length && (0 == c.length ? (c = e) : c.push(e)));
22154          }
22155      }
22156      return c;
22157  },
22158  parseAttributes: function (a) {
22159      var b = {};
22160      if (1 == a.nodeType) {
22161          a = a.childNodes;
22162          for (var c = a.length, d = 0; d < c; ++d) {
22163              var e = a[d];
22164              if (1 == e.nodeType) {
22165                  var f = e.childNodes,
22166                      e = e.prefix ? e.nodeName.split(":")[1] : e.nodeName;
22167                  0 == f.length ? (b[e] = null) : 1 == f.length && ((f = f[0]), 3 == f.nodeType || 4 == f.nodeType) && ((f = f.nodeValue.replace(this.regExes.trimSpace, "")), (b[e] = f));
22168              }
22169          }
22170      }
22171      return b;
22172  },
22173  parseGeometry: function (a) {
22174      this.gmlFormat || (this.gmlFormat = new OpenLayers.Format.GML());
22175      a = this.gmlFormat.parseFeature(a);
22176      var b,
22177          c = null;
22178      a && ((b = a.geometry && a.geometry.clone()), (c = a.bounds && a.bounds.clone()), a.destroy());
22179      return { geometry: b, bounds: c };
22180  },
22181  CLASS_NAME: "OpenLayers.Format.WMSGetFeatureInfo",
22182});
22183OpenLayers.Control.WMTSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
22184  hover: !1,
22185  requestEncoding: "KVP",
22186  drillDown: !1,
22187  maxFeatures: 10,
22188  clickCallback: "click",
22189  layers: null,
22190  queryVisible: !0,
22191  infoFormat: "text/html",
22192  vendorParams: {},
22193  format: null,
22194  formatOptions: null,
22195  handler: null,
22196  hoverRequest: null,
22197  pending: 0,
22198  initialize: function (a) {
22199      a = a || {};
22200      a.handlerOptions = a.handlerOptions || {};
22201      OpenLayers.Control.prototype.initialize.apply(this, [a]);
22202      this.format || (this.format = new OpenLayers.Format.WMSGetFeatureInfo(a.formatOptions));
22203      !0 === this.drillDown && (this.hover = !1);
22204      this.hover
22205          ? (this.handler = new OpenLayers.Handler.Hover(this, { move: this.cancelHover, pause: this.getInfoForHover }, OpenLayers.Util.extend(this.handlerOptions.hover || {}, { delay: 250 })))
22206          : ((a = {}), (a[this.clickCallback] = this.getInfoForClick), (this.handler = new OpenLayers.Handler.Click(this, a, this.handlerOptions.click || {})));
22207  },
22208  getInfoForClick: function (a) {
22209      this.request(a.xy, {});
22210  },
22211  getInfoForHover: function (a) {
22212      this.request(a.xy, { hover: !0 });
22213  },
22214  cancelHover: function () {
22215      this.hoverRequest && (--this.pending, 0 >= this.pending && (OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait"), (this.pending = 0)), this.hoverRequest.abort(), (this.hoverRequest = null));
22216  },
22217  findLayers: function () {
22218      for (
22219          var a = this.layers || this.map.layers, b = [], c, d = a.length - 1;
22220          0 <= d && ((c = a[d]), !(c instanceof OpenLayers.Layer.WMTS) || c.requestEncoding !== this.requestEncoding || (this.queryVisible && !c.getVisibility()) || (b.push(c), this.drillDown && !this.hover));
22221          --d
22222      );
22223      return b;
22224  },
22225  buildRequestOptions: function (a, b) {
22226      var c = this.map.getLonLatFromPixel(b),
22227          d = a.getURL(new OpenLayers.Bounds(c.lon, c.lat, c.lon, c.lat)),
22228          d = OpenLayers.Util.getParameters(d),
22229          c = a.getTileInfo(c);
22230      OpenLayers.Util.extend(d, { service: "WMTS", version: a.version, request: "GetFeatureInfo", infoFormat: this.infoFormat, i: c.i, j: c.j });
22231      OpenLayers.Util.applyDefaults(d, this.vendorParams);
22232      return {
22233          url: OpenLayers.Util.isArray(a.url) ? a.url[0] : a.url,
22234          params: OpenLayers.Util.upperCaseObject(d),
22235          callback: function (c) {
22236              this.handleResponse(b, c, a);
22237          },
22238          scope: this,
22239      };
22240  },
22241  request: function (a, b) {
22242      b = b || {};
22243      var c = this.findLayers();
22244      if (0 < c.length) {
22245          for (var d, e, f = 0, g = c.length; f < g; f++)
22246              (e = c[f]),
22247                  (d = this.events.triggerEvent("beforegetfeatureinfo", { xy: a, layer: e })),
22248                  !1 !== d && (++this.pending, (d = this.buildRequestOptions(e, a)), (d = OpenLayers.Request.GET(d)), !0 === b.hover && (this.hoverRequest = d));
22249          0 < this.pending && OpenLayers.Element.addClass(this.map.viewPortDiv, "olCursorWait");
22250      }
22251  },
22252  handleResponse: function (a, b, c) {
22253      --this.pending;
22254      0 >
22254= this.pending && (OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait"), (this.pending = 0));
22255      if (b.status && (200 > b.status || 300 <= b.status)) this.events.triggerEvent("exception", { xy: a, request: b, layer: c });
22256      else {
22257          var d = b.responseXML;
22258          (d && d.documentElement) || (d = b.responseText);
22259          var e, f;
22260          try {
22261              e = this.format.read(d);
22262          } catch (g) {
22263              (f = !0), this.events.triggerEvent("exception", { xy: a, request: b, error: g, layer: c });
22264          }
22265          f || this.events.triggerEvent("getfeatureinfo", { text: b.responseText, features: e, request: b, xy: a, layer: c });
22266      }
22267  },
22268  CLASS_NAME: "OpenLayers.Control.WMTSGetFeatureInfo",
22269});
22270OpenLayers.Protocol.CSW.v2_0_2 = OpenLayers.Class(OpenLayers.Protocol, {
22271  formatOptions: null,
22272  initialize: function (a) {
22273      OpenLayers.Protocol.prototype.initialize.apply(this, [a]);
22274      a.format || (this.format = new OpenLayers.Format.CSWGetRecords.v2_0_2(OpenLayers.Util.extend({}, this.formatOptions)));
22275  },
22276  destroy: function () {
22277      this.options && !this.options.format && this.format.destroy();
22278      this.format = null;
22279      OpenLayers.Protocol.prototype.destroy.apply(this);
22280  },
22281  read: function (a) {
22282      a = OpenLayers.Util.extend({}, a);
22283      OpenLayers.Util.applyDefaults(a, this.options || {});
22284      var b = new OpenLayers.Protocol.Response({ requestType: "read" }),
22285          c = this.format.write(a.params || a);
22286      b.priv = OpenLayers.Request.POST({ url: a.url, callback: this.createCallback(this.handleRead, b, a), params: a.params, headers: a.headers, data: c });
22287      return b;
22288  },
22289  handleRead: function (a, b) {
22290      if (b.callback) {
22291          var c = a.priv;
22292          200 <= c.status && 300 > c.status ? ((a.data = this.parseData(c)), (a.code = OpenLayers.Protocol.Response.SUCCESS)) : (a.code = OpenLayers.Protocol.Response.FAILURE);
22293          b.callback.call(b.scope, a);
22294      }
22295  },
22296  parseData: function (a) {
22297      var b = a.responseXML;
22298      (b && b.documentElement) || (b = a.responseText);
22299      return !b || 0 >= b.length ? null : this.format.read(b);
22300  },
22301  CLASS_NAME: "OpenLayers.Protocol.CSW.v2_0_2",
22302});
22303OpenLayers.Format.WCSCapabilities.v1_1_0 = OpenLayers.Class(OpenLayers.Format.WCSCapabilities.v1, {
22304  namespaces: { wcs: "http://www.opengis.net/wcs/1.1", xlink: "http://www.w3.org/1999/xlink", xsi: "http://www.w3.org/2001/XMLSchema-instance", ows: "http://www.opengis.net/ows/1.1" },
22305  errorProperty: "operationsMetadata",
22306  readers: {
22307      wcs: OpenLayers.Util.applyDefaults(
22308          {
22309              Capabilities: function (a, b) {
22310                  this.readChildNodes(a, b);
22311              },
22312              Contents: function (a, b) {
22313                  b.contentMetadata = [];
22314                  this.readChildNodes(a, b.contentMetadata);
22315              },
22316              CoverageSummary: function (a, b) {
22317                  var c = {};
22318                  this.readChildNodes(a, c);
22319                  b.push(c);
22320              },
22321              Identifier: function (a, b) {
22322                  b.identifier = this.getChildValue(a);
22323              },
22324              Title: function (a, b) {
22325                  b.title = this.getChildValue(a);
22326              },
22327              Abstract: function (a, b) {
22328                  b["abstract"] = this.getChildValue(a);
22329              },
22330              SupportedCRS: function (a, b) {
22331                  var c = this.getChildValue(a);
22332                  c && (b.supportedCRS || (b.supportedCRS = []), b.supportedCRS.push(c));
22333              },
22334              SupportedFormat: function (a, b) {
22335                  var c = this.getChildValue(a);
22336                  c && (b.supportedFormat || (b.supportedFormat = []), b.supportedFormat.push(c));
22337              },
22338          },
22339          OpenLayers.Format.WCSCapabilities.v1.prototype.readers.wcs
22340      ),
22341      ows: OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows,
22342  },
22343  CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1_1_0",
22344});
22345OpenLayers.Control.Graticule = OpenLayers.Class(OpenLayers.Control, {
22346  autoActivate: !0,
22347  intervals: [45, 30, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.01, 0.005, 0.002, 0.001],
22348  displayInLayerSwitcher: !0,
22349  visible: !0,
22350  numPoints: 50,
22351  targetSize: 200,
22352  layerName: null,
22353  labelled: !0,
22354  labelFormat: "dm",
22355  lineSymbolizer: { strokeColor: "#333", strokeWidth: 1, strokeOpacity: 0.5 },
22356  labelSymbolizer: {},
22357  gratLayer: null,
22358  initialize: function (a) {
22359      a = a || {};
22360      a.layerName = a.layerName || OpenLayers.i18n("Graticule");
22361      OpenLayers.Control.prototype.initialize.apply(this, [a]);
22362      this.labelSymbolizer.stroke = !1;
22363      this.labelSymbolizer.fill = !1;
22364      this.labelSymbolizer.label = "${label}";
22365      this.labelSymbolizer.labelAlign = "${labelAlign}";
22366      this.labelSymbolizer.labelXOffset = "${xOffset}";
22367      this.labelSymbolizer.labelYOffset = "${yOffset}";
22368  },
22369  destroy: function () {
22370      this.deactivate();
22371      OpenLayers.Control.prototype.destroy.apply(this, arguments);
22372      this.gratLayer && (this.gratLayer.destroy(), (this.gratLayer = null));
22373  },
22374  draw: function () {
22375      OpenLayers.Control.prototype.draw.apply(this, arguments);
22376      if (!this.gratLayer) {
22377          var a = new OpenLayers.Style({}, { rules: [new OpenLayers.Rule({ symbolizer: { Point: this.labelSymbolizer, Line: this.lineSymbolizer } })] });
22378          this.gratLayer = new OpenLayers.Layer.Vector(this.layerName, { styleMap: new OpenLayers.StyleMap({ default: a }), visibility: this.visible, displayInLayerSwitcher: this.displayInLayerSwitcher });
22379      }
22380      return this.div;
22381  },
22382  activate: function () {
22383      return OpenLayers.Control.prototype.activate.apply(this, arguments) ? (this.map.addLayer(this.gratLayer), this.map.events.register("moveend", this, this.update), this.update(), !0) : !1;
22384  },
22385  deactivate: function () {
22386      return OpenLayers.Control.prototype.deactivate.apply(this, arguments) ? (this.map.events.unregister("moveend", this, this.update), this.map.removeLayer(this.gratLayer), !0) : !1;
22387  },
22388  update: function () {
22389      var a = this.map.getExtent();
22390      if (a) {
22391          this.gratLayer.destroyFeatures();
22392          var b = new OpenLayers.Projection("EPSG:4326"),
22393              c = this.map.getProjectionObject(),
22394              d = this.map.getResolution();
22395          c.proj && "longlat" == c.proj.projName && (this.numPoints = 1);
22396          var e = this.map.getCenter(),
22397              f = new OpenLayers.Pixel(e.lon, e.lat);
22398          OpenLayers.Projection.transform(f, c, b);
22399          for (var e = this.targetSize * d, e = e * e, g, d = 0; d < this.intervals.length; ++d) {
22400              g = this.intervals[d];
22401              var h = g / 2,
22402                  k = f.offset({ x: -h, y: -h }),
22403                  h = f.offset({ x: h, y: h });
22404              OpenLayers.Projection.transform(k, b, c);
22405              OpenLayers.Projection.transform(h, b, c);
22406              if ((k.x - h.x) * (k.x - h.x) + (k.y - h.y) * (k.y - h.y) <= e) break;
22407          }
22408          f.x = Math.floor(f.x / g) * g;
22409          f.y = Math.floor(f.y / g) * g;
22410          var d = 0,
22411              e = [f.clone()],
22412              h = f.clone(),
22413              l;
22414          do (h = h.offset({ x: 0, y: g })), (l = OpenLayers.Projection.transform(h.clone(), b, c)), e.unshift(h);
22415          while (a.containsPixel(l) && 1e3 > ++d);
22416          h = f.clone();
22417          do (h = h.offset({ x: 0, y: -g })), (l = OpenLayers.Projection.transform(h.clone(), b, c)), e.push(h);
22418          while (a.containsPixel(l) && 1e3 > ++d);
22419          d = 0;
22420          k = [f.clone()];
22421          h = f.clone();
22422          do (h = h.offset({ x: -g, y: 0 })), (l = OpenLayers.Projection.transform(h.clone(), b, c)), k.unshift(h);
22423          while (a.containsPixel(l) && 1e3 > ++d);
22424          h = f.clone();
22425          do (h = h.offset({ x: g, y: 0 })), (l = OpenLayers.Projection.transform(h.clone(), b, c)), k.push(h);
22426          while (a.containsPixel(l) && 1e3 > ++d);
22427          g = [];
22428          for (d = 0; d < k.length; ++d) {
22429              l = k[d].x;
22430              for (var f = [], m = null, n = Math.min(e[0].y, 90), h = Math.max(e[e.length - 1].y, -90), p = (n - h) / this.numPoints, n = h, h = 0; h <= this.numPoints; ++h) {
22431                  var q = new OpenLayers.Geometry.Point(l, n);
22432                  q.transform(b, c);
22433                  f.push(q);
22434                  n += p;
22435                  q.y >= a.bottom && !m && (m = q);
22436              }
22437              this.labelled &&
22438                  ((m = new OpenLayers.Geometry.Point(m.x, a.bottom)),
22439                  (l = { value: l, label: this.labelled ? OpenLayers.Util.getFormattedLonLat
22439(l, "lon", this.labelFormat) : "", labelAlign: "cb", xOffset: 0, yOffset: 2 }),
22440                  this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(m, l)));
22441              f = new OpenLayers.Geometry.LineString(f);
22442              g.push(new OpenLayers.Feature.Vector(f));
22443          }
22444          for (h = 0; h < e.length; ++h)
22445              if (((n = e[h].y), !(-90 > n || 90 < n))) {
22446                  f = [];
22447                  d = k[0].x;
22448                  p = (k[k.length - 1].x - d) / this.numPoints;
22449                  l = d;
22450                  m = null;
22451                  for (d = 0; d <= this.numPoints; ++d) (q = new OpenLayers.Geometry.Point(l, n)), q.transform(b, c), f.push(q), (l += p), q.x < a.right && (m = q);
22452                  this.labelled &&
22453                      ((m = new OpenLayers.Geometry.Point(a.right, m.y)),
22454                      (l = { value: n, label: this.labelled ? OpenLayers.Util.getFormattedLonLat(n, "lat", this.labelFormat) : "", labelAlign: "rb", xOffset: -2, yOffset: 2 }),
22455                      this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(m, l)));
22456                  f = new OpenLayers.Geometry.LineString(f);
22457                  g.push(new OpenLayers.Feature.Vector(f));
22458              }
22459          this.gratLayer.addFeatures(g);
22460      }
22461  },
22462  CLASS_NAME: "OpenLayers.Control.Graticule",
22463});
22464OpenLayers.Console.warn("OpenLayers.Rico is deprecated");
22465OpenLayers.Rico = OpenLayers.Rico || {};
22466OpenLayers.Rico.Corner = {
22467  round: function (a, b) {
22468      a = OpenLayers.Util.getElement(a);
22469      this._setOptions(b);
22470      var c = this.options.color;
22471      "fromElement" == this.options.color && (c = this._background(a));
22472      var d = this.options.bgColor;
22473      "fromParent" == this.options.bgColor && (d = this._background(a.offsetParent));
22474      this._roundCornersImpl(a, c, d);
22475  },
22476  changeColor: function (a, b) {
22477      a.style.backgroundColor = b;
22478      for (var c = a.parentNode.getElementsByTagName("span"), d = 0; d < c.length; d++) c[d].style.backgroundColor = b;
22479  },
22480  changeOpacity: function (a, b) {
22481      var c = "alpha(opacity=" + 100 * b + ")";
22482      a.style.opacity = b;
22483      a.style.filter = c;
22484      for (var d = a.parentNode.getElementsByTagName("span"), e = 0; e < d.length; e++) (d[e].style.opacity = b), (d[e].style.filter = c);
22485  },
22486  reRound: function (a, b) {
22487      var c = a.parentNode.childNodes[2];
22488      a.parentNode.removeChild(a.parentNode.childNodes[0]);
22489      a.parentNode.removeChild(c);
22490      this.round(a.parentNode, b);
22491  },
22492  _roundCornersImpl: function (a, b, c) {
22493      this.options.border && this._renderBorder(a, c);
22494      this._isTopRounded() && this._roundTopCorners(a, b, c);
22495      this._isBottomRounded() && this._roundBottomCorners(a, b, c);
22496  },
22497  _renderBorder: function (a, b) {
22498      var c = "1px solid " + this._borderColor(b);
22499      a.innerHTML = "<div " + ("style='border-left: " + c + ";" + ("border-right: " + c) + "'") + ">" + a.innerHTML + "</div>";
22500  },
22501  _roundTopCorners: function (a, b, c) {
22502      for (var d = this._createCorner(c), e = 0; e < this.options.numSlices; e++) d.appendChild(this._createCornerSlice(b, c, e, "top"));
22503      a.style.paddingTop = 0;
22504      a.insertBefore(d, a.firstChild);
22505  },
22506  _roundBottomCorners: function (a, b, c) {
22507      for (var d = this._createCorner(c), e = this.options.numSlices - 1; 0 <= e; e--) d.appendChild(this._createCornerSlice(b, c, e, "bottom"));
22508      a.style.paddingBottom = 0;
22509      a.appendChild(d);
22510  },
22511  _createCorner: function (a) {
22512      var b = document.createElement("div");
22513      b.style.backgroundColor = this._isTransparent() ? "transparent" : a;
22514      return b;
22515  },
22516  _createCornerSlice: function (a, b, c, d) {
22517      var e = document.createElement("span"),
22518          f = e.style;
22519      f.backgroundColor = a;
22520      f.display = "block";
22521      f.height = "1px";
22522      f.overflow = "hidden";
22523      f.fontSize = "1px";
22524      a = this._borderColor(a, b);
22525      this.options.border && 0 == c
22526          ? ((f.borderTopStyle = "solid"), (f.borderTopWidth = "1px"), (f.borderLeftWidth = "0px"), (f.borderRightWidth = "0px"), (f.borderBottomWidth = "0px"), (f.height = "0px"), (f.borderColor = a))
22527          : a && ((f.borderColor = a), (f.borderStyle = "solid"), (f.borderWidth = "0px 1px"));
22528      this.options.compact || c != this.options.numSlices - 1 || (f.height = "2px");
22529      this._setMargin(e, c, d);
22530      this._setBorder(e, c, d);
22531      return e;
22532  },
22533  _setOptions: function (a) {
22534      this.options = { corners: "all", color: "fromElement", bgColor: "fromParent", blend: !0, border: !1, compact: !1 };
22535      OpenLayers.Util.extend(this.options, a || {});
22536      this.options.numSlices = this.options.compact ? 2 : 4;
22537      this._isTransparent() && (this.options.blend = !1);
22538  },
22539  _whichSideTop: function () {
22540      return this._hasString(this.options.corners, "all", "top") || (0 <= this.options.corners.indexOf("tl") && 0 <= this.options.corners.indexOf("tr"))
22541          ? ""
22542          : 0 <= this.options.corners.indexOf("tl")
22543          ? "left"
22544          : 0 <= this.options.corners.indexOf("tr")
22545          ? "right"
22546          : "";
22547  },
22548  _whichSideBottom: function () {
22549      return this._hasString(this.options.corners, "all", "bottom") || (0 <= this.options.corners.indexOf("bl") && 0 <= this.options.corners.indexOf("br"))
22550          ? ""
22551          : 0 <= this.options.corners.indexOf("bl")
22552          ? "left"
22553          : 0 <= this.options.corners.indexOf("br")
22554          ? "right"
22555          : "";
22556  },
22557  _borderColor: function (a, b) {
22558      return "transparent" == a ? b : this.options.border ? this.options.border : this.options.blend ? this._blend(b, a) : "";
22559  },
22560  _setMargin: function (a, b, c) {
22561      b = this._marginSize(b);
22562      c = "top" == c ? this._whichSideTop() : this._whichSideBottom();
22563      "left" == c ? ((a.style.marginLeft = b + "px"), (a.style.marginRight = "0px")) : "right" == c ? ((a.style.marginRight = b + "px"), (a.style.marginLeft = "0px")) : ((a.style.marginLeft = b + "px"), (a.style.marginRight = b + "px"));
22564  },
22565  _setBorder: function (a, b, c) {
22566      b = this._borderSize(b);
22567      c = "top" == c ? this._whichSideTop() : this._whichSideBottom();
22568      "left" == c
22569          ? ((a.style.borderLeftWidth = b + "px"), (a.style.borderRightWidth = "0px"))
22570          : "right" == c
22571          ? ((a.style.borderRightWidth = b + "px"), (a.style.borderLeftWidth = "0px"))
22572          : ((a.style.borderLeftWidth = b + "px"), (a.style.borderRightWidth = b + "px"));
22573      !1 != this.options.border && ((a.style.borderLeftWidth = b + "px"), (a.style.borderRightWidth = b + "px"));
22574  },
22575  _marginSize: function (a) {
22576      if (this._isTransparent()) return 0;
22577      var b = [5, 3, 2, 1],
22578          c = [3, 2, 1, 0],
22579          d = [2, 1],
22580          e = [1, 0];
22581      return this.options.compact && this.options.blend ? e[a] : this.options.compact ? d[a] : this.options.blend ? c[a] : b[a];
22582  },
22583  _borderSize: function (a) {
22584      var b = [5, 3, 2, 1],
22585          c = [2, 1, 1, 1],
22586          d = [1, 0],
22587          e = [0, 2, 0, 0];
22588      return this.options.compact && (this.options.blend || this._isTransparent()) ? 1 : this.options.compact ? d[a] : this.options.blend ? c[a] : this.options.border ? e[a] : this._isTransparent() ? b[a] : 0;
22589  },
22590  _hasString: function (a) {
22591      for (var b = 1; b < arguments.length; b++) if (0 <= a.indexOf(arguments[b])) return !0;
22592      return !1;
22593  },
22594  _blend: function (a, b) {
22595      var c = OpenLayers.Rico.Color.createFromHex(a);
22596      c.blend(OpenLayers.Rico.Color.createFromHex(b));
22597      return c;
22598  },
22599  _background: function (a) {
22600      try {
22601          return OpenLayers.Rico.Color.createColorFromBackground(a).asHex();
22602      } catch (b) {
22603          return "#ffffff";
22604      }
22605  },
22606  _isTransparent: function () {
22607      return "transparent" == this.options.color;
22608  },
22609  _isTopRounded: function () {
22610      return this._hasString(this.options.corners, "all", "top", "tl", "tr");
22611  },
22612  _isBottomRounded: function () {
22613      return this._hasString(this.options.corners, "all", "bottom", "bl", "br");
22614  },
22615  _hasSingleTextChild: function (a) {
22616      return 1 == a.childNodes.length && 3 == a.childNodes[0].nodeType;
22617  },
22618};
22619OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {
22620  type: OpenLayers.Control.TYPE_TOGGLE,
22621  previous: null,
22622  previousOptions: null,
22623  next: null,
22624  nextOptions: null,
22625  limit: 50,
22626  autoActivate: !0,
22627  clearOnDeactivate: !1,
22628  registry: null,
22629  nextStack: null,
22630  previousStack: null,
22631  listeners: null,
22632  restoring: !1,
22633  initialize: function (a) {
22634      OpenLayers.Control.prototype.initialize.apply(this, [a]);
22635      this.registry = OpenLayers.Util.extend({ moveend: this.get
22635State }, this.registry);
22636      a = { trigger: OpenLayers.Function.bind(this.previousTrigger, this), displayClass: this.displayClass + " " + this.displayClass + "Previous" };
22637      OpenLayers.Util.extend(a, this.previousOptions);
22638      this.previous = new OpenLayers.Control.Button(a);
22639      a = { trigger: OpenLayers.Function.bind(this.nextTrigger, this), displayClass: this.displayClass + " " + this.displayClass + "Next" };
22640      OpenLayers.Util.extend(a, this.nextOptions);
22641      this.next = new OpenLayers.Control.Button(a);
22642      this.clear();
22643  },
22644  onPreviousChange: function (a, b) {
22645      a && !this.previous.active ? this.previous.activate() : !a && this.previous.active && this.previous.deactivate();
22646  },
22647  onNextChange: function (a, b) {
22648      a && !this.next.active ? this.next.activate() : !a && this.next.active && this.next.deactivate();
22649  },
22650  destroy: function () {
22651      OpenLayers.Control.prototype.destroy.apply(this);
22652      this.previous.destroy();
22653      this.next.destroy();
22654      this.deactivate();
22655      for (var a in this) this[a] = null;
22656  },
22657  setMap: function (a) {
22658      this.map = a;
22659      this.next.setMap(a);
22660      this.previous.setMap(a);
22661  },
22662  draw: function () {
22663      OpenLayers.Control.prototype.draw.apply(this, arguments);
22664      this.next.draw();
22665      this.previous.draw();
22666  },
22667  previousTrigger: function () {
22668      var a = this.previousStack.shift(),
22669          b = this.previousStack.shift();
22670      void 0 != b
22671          ? (this.nextStack.unshift(a),
22672            this.previousStack.unshift(b),
22673            (this.restoring = !0),
22674            this.restore(b),
22675            (this.restoring = !1),
22676            this.onNextChange(this.nextStack[0], this.nextStack.length),
22677            this.onPreviousChange(this.previousStack[1], this.previousStack.length - 1))
22678          : this.previousStack.unshift(a);
22679      return b;
22680  },
22681  nextTrigger: function () {
22682      var a = this.nextStack.shift();
22683      void 0 != a &&
22684          (this.previousStack.unshift(a),
22685          (this.restoring = !0),
22686          this.restore(a),
22687          (this.restoring = !1),
22688          this.onNextChange(this.nextStack[0], this.nextStack.length),
22689          this.onPreviousChange(this.previousStack[1], this.previousStack.length - 1));
22690      return a;
22691  },
22692  clear: function () {
22693      this.previousStack = [];
22694      this.previous.deactivate();
22695      this.nextStack = [];
22696      this.next.deactivate();
22697  },
22698  getState: function () {
22699      return { center: this.map.getCenter(), resolution: this.map.getResolution(), projection: this.map.getProjectionObject(), units: this.map.getProjectionObject().getUnits() || this.map.units || this.map.baseLayer.units };
22700  },
22701  restore: function (a) {
22702      var b, c;
22703      if (this.map.getProjectionObject() == a.projection) (c = this.map.getZoomForResolution(a.resolution)), (b = a.center);
22704      else {
22705          b = a.center.clone();
22706          b.transform(a.projection, this.map.getProjectionObject());
22707          c = a.units;
22708          var d = this.map.getProjectionObject().getUnits() || this.map.units || this.map.baseLayer.units;
22709          c = this.map.getZoomForResolution((c && d ? OpenLayers.INCHES_PER_UNIT[c] / OpenLayers.INCHES_PER_UNIT[d] : 1) * a.resolution);
22710      }
22711      this.map.setCenter(b, c);
22712  },
22713  setListeners: function () {
22714      this.listeners = {};
22715      for (var a in this.registry)
22716          this.listeners[a] = OpenLayers.Function.bind(function () {
22717              if (!this.restoring) {
22718                  var b = this.registry[a].apply(this, arguments);
22719                  this.previousStack.unshift(b);
22720                  if (1 < this.previousStack.length) this.onPreviousChange(this.previousStack[1], this.previousStack.length - 1);
22721                  this.previousStack.length > this.limit + 1 && this.previousStack.pop();
22722                  0 < this.nextStack.length && ((this.nextStack = []), this.onNextChange(null, 0));
22723              }
22724              return !0;
22725          }, this);
22726  },
22727  activate: function () {
22728      var a = !1;
22729      if (this.map && OpenLayers.Control.prototype.activate.apply(this)) {
22730          null == this.listeners && this.setListeners();
22731          for (var b in this.listeners) this.map.events.register(b, this, this.listeners[b]);
22732          a = !0;
22733          0 == this.previousStack.length && this.initStack();
22734      }
22735      return a;
22736  },
22737  initStack: function () {
22738      this.map.getCenter() && this.listeners.moveend();
22739  },
22740  deactivate: function () {
22741      var a = !1;
22742      if (this.map && OpenLayers.Control.prototype.deactivate.apply(this)) {
22743          for (var b in this.listeners) this.map.events.unregister(b, this, this.listeners[b]);
22744          this.clearOnDeactivate && this.clear();
22745          a = !0;
22746      }
22747      return a;
22748  },
22749  CLASS_NAME: "OpenLayers.Control.NavigationHistory",
22750});
22751OpenLayers.Layer.UTFGrid = OpenLayers.Class(OpenLayers.Layer.XYZ, {
22752  isBaseLayer: !1,
22753  projection: new OpenLayers.Projection("EPSG:900913"),
22754  useJSONP: !1,
22755  tileClass: OpenLayers.Tile.UTFGrid,
22756  initialize: function (a) {
22757      OpenLayers.Layer.Grid.prototype.initialize.apply(this, [a.name, a.url, {}, a]);
22758      this.tileOptions = OpenLayers.Util.extend({ utfgridResolution: this.utfgridResolution }, this.tileOptions);
22759  },
22760  createBackBuffer: function () {},
22761  clone: function (a) {
22762      null == a && (a = new OpenLayers.Layer.UTFGrid(this.getOptions()));
22763      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
22764  },
22765  getFeatureInfo: function (a) {
22766      var b = null;
22767      (a = this.getTileData(a)) && a.tile && (b = a.tile.getFeatureInfo(a.i, a.j));
22768      return b;
22769  },
22770  getFeatureId: function (a) {
22771      var b = null;
22772      a = this.getTileData(a);
22773      a.tile && (b = a.tile.getFeatureId(a.i, a.j));
22774      return b;
22775  },
22776  CLASS_NAME: "OpenLayers.Layer.UTFGrid",
22777});
22778OpenLayers.TileManager = OpenLayers.Class({
22779  cacheSize: 256,
22780  tilesPerFrame: 2,
22781  frameDelay: 16,
22782  moveDelay: 100,
22783  zoomDelay: 200,
22784  maps: null,
22785  tileQueueId: null,
22786  tileQueue: null,
22787  tileCache: null,
22788  tileCacheIndex: null,
22789  initialize: function (a) {
22790      OpenLayers.Util.extend(this, a);
22791      this.maps = [];
22792      this.tileQueueId = {};
22793      this.tileQueue = {};
22794      this.tileCache = {};
22795      this.tileCacheIndex = [];
22796  },
22797  addMap: function (a) {
22798      if (!this._destroyed && OpenLayers.Layer.Grid) {
22799          this.maps.push(a);
22800          this.tileQueue[a.id] = [];
22801          for (var b = 0, c = a.layers.length; b < c; ++b) this.addLayer({ layer: a.layers[b] });
22802          a.events.on({ move: this.move, zoomend: this.zoomEnd, changelayer: this.changeLayer, addlayer: this.addLayer, preremovelayer: this.removeLayer, scope: this });
22803      }
22804  },
22805  removeMap: function (a) {
22806      if (!this._destroyed && OpenLayers.Layer.Grid) {
22807          window.clearTimeout(this.tileQueueId[a.id]);
22808          if (a.layers) for (var b = 0, c = a.layers.length; b < c; ++b) this.removeLayer({ layer: a.layers[b] });
22809          a.events && a.events.un({ move: this.move, zoomend: this.zoomEnd, changelayer: this.changeLayer, addlayer: this.addLayer, preremovelayer: this.removeLayer, scope: this });
22810          delete this.tileQueue[a.id];
22811          delete this.tileQueueId[a.id];
22812          OpenLayers.Util.removeItem(this.maps, a);
22813      }
22814  },
22815  move: function (a) {
22816      this.updateTimeout(a.object, this.moveDelay, !0);
22817  },
22818  zoomEnd: function (a) {
22819      this.updateTimeout(a.object, this.zoomDelay);
22820  },
22821  changeLayer: function (a) {
22822      ("visibility" !== a.property && "params" !== a.property) || this.updateTimeout(a.object, 0);
22823  },
22824  addLayer: function (a) {
22825      a = a.layer;
22826      if (a instanceof OpenLayers.Layer.Grid) {
22827          a.events.on({ addtile: this.addTile, retile: this.clearTileQueue, scope: this });
22828          var b, c, d;
22829          for (b = a.grid.length - 1; 0 <= b; --b) for (c = a.grid[b].length - 1; 0 <= c; --c) (d = a.grid[b][c]), this.addTile({ tile: d }), d.url && !d.imgDiv && this.manageTileCache({ object: d });
22830      }
22831  },
22832  removeLayer: function (a) {
22833      a = a.layer;
22834      if (a instanceof OpenLayers.Layer.Grid && (this.clearTileQueue({ object: a }), a.events && a.events.un({ addtile: this.addTile, retile: this.clearTileQueue, scope: this }), a.grid)) {
22835          var b, c, d;
22836          for (b = a.grid.length - 1; 0 <= b; --b) for (c = a.grid[b].length - 1; 0 <= c; --c) (d = a.grid[b][c]), this.unloadTile({ object: d });
22837      }
22838  },
22839  updateTimeout: function (a, b, c) {
22840      window.clearTimeout(this.tileQueueId[a.id]);
22841      var d = this.tileQueue[a.id];
22842      if (!c || d.length)
22843          this.tileQueueId[a.id] = window.setTimeout(
22844              OpenLayers.Function.bind(function () {
22845                  this.drawTilesFromQueue(a);
22846                  d.length && this.updateTimeout(a, this.frameDelay);
22847              }, this),
22848              b
22849          );
22850  },
22851  addTile: function (a) {
22852      if (a.tile instanceof OpenLayers.Tile.Image) a.tile.events.on({ beforedraw: this.queueTileDraw, beforeload: this.manageTileCache, loadend: this.addToCache, unload: this.unloadTile, scope: this });
22853      else this.removeLayer({ layer: a.tile.layer });
22854  },
22855  unloadTile: function (a) {
22856      a = a.object;
22857      a.events.un({ beforedraw: this.queueTileDraw, beforeload: this.manageTileCache, loadend: this.addToCache, unload: this.unloadTile, scope: this });
22858      OpenLayers.Util.removeItem(this.tileQueue[a.layer.map.id], a);
22859  },
22860  queueTileDraw: function (a) {
22861      a = a.object;
22862      var b = !1,
22863          c = a.layer,
22864          d = c.getURL(a.bounds),
22865          e = this.tileCache[d];
22866      e && "olTileImage" !== e.className && (delete this.tileCache[d], OpenLayers.Util.removeItem(this.tileCacheIndex, d), (e = null));
22867      !c.url || (!c.async && e) || ((b = this.tileQueue[c.map.id]), ~OpenLayers.Util.indexOf(b, a) || b.push(a), (b = !0));
22868      return !b;
22869  },
22870  drawTilesFromQueue: function (a) {
22871      var b = this.tileQueue[a.id],
22872          c = this.tilesPerFrame;
22873      for (a = a.zoomTween && a.zoomTween.playing; !a && b.length && c; ) b.shift().draw(!0), --c;
22874  },
22875  manageTileCache: function (a) {
22876      a = a.object;
22877      var b = this.tileCache[a.url];
22878      b &&
22879          (b.parentNode && OpenLayers.Element.hasClass(b.parentNode, "olBackBuffer") && (b.parentNode.removeChild(b), (b.id = null)),
22880          b.parentNode || ((b.style.visibility = "hidden"), (b.style.opacity = 0), a.setImage(b), OpenLayers.Util.removeItem(this.tileCacheIndex, a.url), this.tileCacheIndex.push(a.url)));
22881  },
22882  addToCache: function (a) {
22883      a = a.object;
22884      this.tileCache[a.url] ||
22885          OpenLayers.Element.hasClass(a.imgDiv, "olImageLoadError") ||
22886          (this.tileCacheIndex.length >= this.cacheSize && (delete this.tileCache[this.tileCacheIndex[0]], this.tileCacheIndex.shift()), (this.tileCache[a.url] = a.imgDiv), this.tileCacheIndex.push(a.url));
22887  },
22888  clearTileQueue: function (a) {
22889      a = a.object;
22890      for (var b = this.tileQueue[a.map.id], c = b.length - 1; 0 <= c; --c) b[c].layer === a && b.splice(c, 1);
22891  },
22892  destroy: function () {
22893      for (var a = this.maps.length - 1; 0 <= a; --a) this.removeMap(this.maps[a]);
22894      this.tileCacheIndex = this.tileCache = this.tileQueueId = this.tileQueue = this.maps = null;
22895      this._destroyed = !0;
22896  },
22897});
22898OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
22899  url: null,
22900  tileOrigin: null,
22901  tileSize: new OpenLayers.Size(256, 256),
22902  useArcGISServer: !0,
22903  type: "png",
22904  useScales: !1,
22905  overrideDPI: !1,
22906  initialize: function (a, b, c) {
22907      OpenLayers.Layer.XYZ.prototype.initialize.apply(this, arguments);
22908      this.resolutions && ((this.serverResolutions = this.resolutions), (this.maxExtent = this.getMaxExtentForResolution(this.resolutions[0])));
22909      if (this.layerInfo) {
22910          var d = this.layerInfo,
22911              e = new OpenLayers.Bounds(d.fullExtent.xmin, d.fullExtent.ymin, d.fullExtent.xmax, d.fullExtent.ymax);
22912          this.projection = "EPSG:" + d.spatialReference.wkid;
22913          this.sphericalMercator = 102100 == d.spatialReference.wkid;
22914          this.units = "esriFeet" == d.units ? "ft" : "m";
22915          if (d.tileInfo) {
22916              this.tileSize = new OpenLayers.Size(d.tileInfo.width || d.tileInfo.cols, d.tileInfo.height || d.tileInfo.rows);
22917              this.tileOrigin = new OpenLayers.LonLat(d.tileInfo.origin.x, d.tileInfo.origin.y);
22918              var f = new OpenLayers.Geometry.Point(e.left, e.to
22918p),
22919                  e = new OpenLayers.Geometry.Point(e.right, e.bottom);
22920              this.useScales ? (this.scales = []) : (this.resolutions = []);
22921              this.lods = [];
22922              for (var g in d.tileInfo.lods)
22923                  if (d.tileInfo.lods.hasOwnProperty(g)) {
22924                      var h = d.tileInfo.lods[g];
22925                      this.useScales ? this.scales.push(h.scale) : this.resolutions.push(h.resolution);
22926                      var k = this.getContainingTileCoords(f, h.resolution);
22927                      h.startTileCol = k.x;
22928                      h.startTileRow = k.y;
22929                      k = this.getContainingTileCoords(e, h.resolution);
22930                      h.endTileCol = k.x;
22931                      h.endTileRow = k.y;
22932                      this.lods.push(h);
22933                  }
22934              this.maxExtent = this.calculateMaxExtentWithLOD(this.lods[0]);
22935              this.serverResolutions = this.resolutions;
22936              this.overrideDPI && d.tileInfo.dpi && (OpenLayers.DOTS_PER_INCH = d.tileInfo.dpi);
22937          }
22938      }
22939  },
22940  getContainingTileCoords: function (a, b) {
22941      return new OpenLayers.Pixel(Math.max(Math.floor((a.x - this.tileOrigin.lon) / (this.tileSize.w * b)), 0), Math.max(Math.floor((this.tileOrigin.lat - a.y) / (this.tileSize.h * b)), 0));
22942  },
22943  calculateMaxExtentWithLOD: function (a) {
22944      var b = this.tileOrigin.lon + a.startTileCol * this.tileSize.w * a.resolution,
22945          c = this.tileOrigin.lat - a.startTileRow * this.tileSize.h * a.resolution;
22946      return new OpenLayers.Bounds(b, c - (a.endTileRow - a.startTileRow + 1) * this.tileSize.h * a.resolution, b + (a.endTileCol - a.startTileCol + 1) * this.tileSize.w * a.resolution, c);
22947  },
22948  calculateMaxExtentWithExtent: function (a, b) {
22949      var c = new OpenLayers.Geometry.Point(a.left, a.top),
22950          d = new OpenLayers.Geometry.Point(a.right, a.bottom),
22951          c = this.getContainingTileCoords(c, b),
22952          d = this.getContainingTileCoords(d, b);
22953      return this.calculateMaxExtentWithLOD({ resolution: b, startTileCol: c.x, startTileRow: c.y, endTileCol: d.x, endTileRow: d.y });
22954  },
22955  getUpperLeftTileCoord: function (a) {
22956      var b = new OpenLayers.Geometry.Point(this.maxExtent.left, this.maxExtent.top);
22957      return this.getContainingTileCoords(b, a);
22958  },
22959  getLowerRightTileCoord: function (a) {
22960      var b = new OpenLayers.Geometry.Point(this.maxExtent.right, this.maxExtent.bottom);
22961      return this.getContainingTileCoords(b, a);
22962  },
22963  getMaxExtentForResolution: function (a) {
22964      var b = this.getUpperLeftTileCoord(a),
22965          c = this.getLowerRightTileCoord(a),
22966          d = this.tileOrigin.lon + b.x * this.tileSize.w * a,
22967          e = this.tileOrigin.lat - b.y * this.tileSize.h * a;
22968      return new OpenLayers.Bounds(d, e - (c.y - b.y + 1) * this.tileSize.h * a, d + (c.x - b.x + 1) * this.tileSize.w * a, e);
22969  },
22970  clone: function (a) {
22971      null == a && (a = new OpenLayers.Layer.ArcGISCache(this.name, this.url, this.options));
22972      return OpenLayers.Layer.XYZ.prototype.clone.apply(this, [a]);
22973  },
22974  initGriddedTiles: function (a) {
22975      delete this._tileOrigin;
22976      OpenLayers.Layer.XYZ.prototype.initGriddedTiles.apply(this, arguments);
22977  },
22978  getMaxExtent: function () {
22979      var a = this.map.getResolution();
22980      return (this.maxExtent = this.getMaxExtentForResolution(a));
22981  },
22982  getTileOrigin: function () {
22983      if (!this._tileOrigin) {
22984          var a = this.getMaxExtent();
22985          this._tileOrigin = new OpenLayers.LonLat(a.left, a.bottom);
22986      }
22987      return this._tileOrigin;
22988  },
22989  getURL: function (a) {
22990      var b = this.getResolution(),
22991          c = this.tileOrigin.lon + (b * this.tileSize.w) / 2,
22992          d = this.tileOrigin.lat - (b * this.tileSize.h) / 2;
22993      a = a.getCenterLonLat();
22994      c = Math.round(Math.abs((a.lon - c) / (b * this.tileSize.w)));
22995      d = Math.round(Math.abs((d - a.lat) / (b * this.tileSize.h)));
22996      a = this.map.getZoom();
22997      if (this.lods) {
22998          if (((b = this.lods[this.map.getZoom()]), c < b.startTileCol || c > b.endTileCol || d < b.startTileRow || d > b.endTileRow)) return null;
22999      } else {
23000          var e = this.getUpperLeftTileCoord(b),
23001              b = this.getLowerRightTileCoord(b);
23002          if (c < e.x || c >= b.x || d < e.y || d >= b.y) return null;
23003      }
23004      b = this.url;
23005      e = "" + c + d + a;
23006      OpenLayers.Util.isArray(b) && (b = this.selectUrl(e, b));
23007      this.useArcGISServer
23008          ? (b += "/tile/${z}/${y}/${x}")
23009          : ((c = "C" + OpenLayers.Number.zeroPad(c, 8, 16)), (d = "R" + OpenLayers.Number.zeroPad(d, 8, 16)), (a = "L" + OpenLayers.Number.zeroPad(a, 2, 10)), (b = b + "/${z}/${y}/${x}." + this.type));
23010      b = OpenLayers.String.format(b, { x: c, y: d, z: a });
23011      return OpenLayers.Util.urlAppend(b, OpenLayers.Util.getParameterString(this.params));
23012  },
23013  CLASS_NAME: "OpenLayers.Layer.ArcGISCache",
23014});
23015OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
23016  hover: !1,
23017  drillDown: !1,
23018  maxFeatures: 10,
23019  clickCallback: "click",
23020  output: "features",
23021  layers: null,
23022  queryVisible: !1,
23023  url: null,
23024  layerUrls: null,
23025  infoFormat: "text/html",
23026  vendorParams: {},
23027  format: null,
23028  formatOptions: null,
23029  handler: null,
23030  hoverRequest: null,
23031  initialize: function (a) {
23032      a = a || {};
23033      a.handlerOptions = a.handlerOptions || {};
23034      OpenLayers.Control.prototype.initialize.apply(this, [a]);
23035      this.format || (this.format = new OpenLayers.Format.WMSGetFeatureInfo(a.formatOptions));
23036      !0 === this.drillDown && (this.hover = !1);
23037      this.hover
23038          ? (this.handler = new OpenLayers.Handler.Hover(this, { move: this.cancelHover, pause: this.getInfoForHover }, OpenLayers.Util.extend(this.handlerOptions.hover || {}, { delay: 250 })))
23039          : ((a = {}), (a[this.clickCallback] = this.getInfoForClick), (this.handler = new OpenLayers.Handler.Click(this, a, this.handlerOptions.click || {})));
23040  },
23041  getInfoForClick: function (a) {
23042      this.events.triggerEvent("beforegetfeatureinfo", { xy: a.xy });
23043      OpenLayers.Element.addClass(this.map.viewPortDiv, "olCursorWait");
23044      this.request(a.xy, {});
23045  },
23046  getInfoForHover: function (a) {
23047      this.events.triggerEvent("beforegetfeatureinfo", { xy: a.xy });
23048      this.request(a.xy, { hover: !0 });
23049  },
23050  cancelHover: function () {
23051      this.hoverRequest && (this.hoverRequest.abort(), (this.hoverRequest = null));
23052  },
23053  findLayers: function () {
23054      for (var a = this.layers || this.map.layers, b = [], c, d, e = a.length - 1; 0 <= e; --e)
23055          (c = a[e]),
23056              c instanceof OpenLayers.Layer.WMS &&
23057                  (!this.queryVisible || c.getVisibility()) &&
23058                  ((d = OpenLayers.Util.isArray(c.url) ? c.url[0] : c.url), !1 !== this.drillDown || this.url || (this.url = d), (!0 === this.drillDown || this.urlMatches(d)) && b.push(c));
23059      return b;
23060  },
23061  urlMatches: function (a) {
23062      var b = OpenLayers.Util.isEquivalentUrl(this.url, a);
23063      if (!b && this.layerUrls)
23064          for (var c = 0, d = this.layerUrls.length; c < d; ++c)
23065              if (OpenLayers.Util.isEquivalentUrl(this.layerUrls[c], a)) {
23066                  b = !0;
23067                  break;
23068              }
23069      return b;
23070  },
23071  buildWMSOptions: function (a, b, c, d) {
23072      for (var e = [], f = [], g = 0, h = b.length; g < h; g++) null != b[g].params.LAYERS && ((e = e.concat(b[g].params.LAYERS)), (f = f.concat(this.getStyleNames(b[g]))));
23073      b = b[0];
23074      g = this.map.getProjection();
23075      (h = b.projection) && h.equals(this.map.getProjectionObject()) && (g = h.getCode());
23076      d = OpenLayers.Util.extend(
23077          {
23078              service: "WMS",
23079              version: b.params.VERSION,
23080              request: "GetFeatureInfo",
23081              exceptions: b.params.EXCEPTIONS,
23082              bbox: this.map.getExtent().toBBOX(null, b.reverseAxisOrder()),
23083              feature_count: this.maxFeatures,
23084              height: this.map.getSize().h,
23085              width: this.map.getSize().w,
23086              format: d,
23087              info_format: b.params.INFO_FORMAT || this.infoFormat,
23088          },
23089          1.3 <= parseFloat(b.params.VERSION) ? { crs: g, i: parseInt(c.x), j: parseInt(c.y) } : { srs: g, x: parseInt(c.x), y: parseInt(c.y) }
23090      );
23091      0 != e.length && (d = OpenLayers.Util.extend({ layers: e, query_layers: e, styles: f }, d));
23092      OpenLayers.Util.applyDefaults(d, this.vendorParams);
23093      return {
23094          url: a,
23095          params: OpenLayers.Util.upperCaseObject(d),
23096          callback: function (b) {
23097              this.handleResponse(c, b, a);
23098          },
23099          scope: this,
23100      };
23101  },
23102  getStyleNames: function (a) {
23103      return a.params.STYLES ? a.params.STYLES : OpenLayers.Util.isArray(a.params.LAYERS) ? Array(a.params.LAYERS.length) : a.params.LAYERS.replace(/[^,]/g, "");
23104  },
23105  request: function (a, b) {
23106      var c = this.findLayers();
23107      if (0 == c.length) this.events.triggerEvent("nogetfeatureinfo"), OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
23108      else if (((b = b || {}), !1 === this.drillDown)) {
23109          var c = this.buildWMSOptions(this.url, c, a, c[0].params.FORMAT),
23110              d = OpenLayers.Request.GET(c);
23111          !0 === b.hover && (this.hoverRequest = d);
23112      } else {
23113          this._numRequests = this._requestCount = 0;
23114          this.features = [];
23115          for (var d = {}, e, f = 0, g = c.length; f < g; f++) {
23116              var h = c[f];
23117              e = OpenLayers.Util.isArray(h.url) ? h.url[0] : h.url;
23118              e in d ? d[e].push(h) : (this._numRequests++, (d[e] = [h]));
23119          }
23120          for (e in d) (c = d[e]), (c = this.buildWMSOptions(e, c, a, c[0].params.FORMAT)), OpenLayers.Request.GET(c);
23121      }
23122  },
23123  triggerGetFeatureInfo: function (a, b, c) {
23124      this.events.triggerEvent("getfeatureinfo", { text: a.responseText, features: c, request: a, xy: b });
23125      OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
23126  },
23127  handleResponse: function (a, b, c) {
23128      var d = b.responseXML;
23129      (d && d.documentElement) || (d = b.responseText);
23130      d = this.format.read(d);
23131      !1 === this.drillDown
23132          ? this.triggerGetFeatureInfo(b, a, d)
23133          : (this._requestCount++,
23134            (this._features = "object" === this.output ? (this._features || []).concat({ url: c, features: d }) : (this._features || []).concat(d)),
23135            this._requestCount === this._numRequests && (this.triggerGetFeatureInfo(b, a, this._features.concat()), delete this._features, delete this._requestCount, delete this._numRequests));
23136  },
23137  CLASS_NAME: "OpenLayers.Control.WMSGetFeatureInfo",
23138});
23139OpenLayers.Format.WMSCapabilities.v1_3_0 = OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_3, { version: "1.3.0", CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1_3_0" });
23140OpenLayers.Format.SOSGetFeatureOfInterest = OpenLayers.Class(OpenLayers.Format.XML, {
23141  VERSION: "1.0.0",
23142  namespaces: { sos: "http://www.opengis.net/sos/1.0", gml: "http://www.opengis.net/gml", sa: "http://www.opengis.net/sampling/1.0", xsi: "http://www.w3.org/2001/XMLSchema-instance" },
23143  schemaLocation: "http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosAll.xsd",
23144  defaultPrefix: "sos",
23145  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
23146  read: function (a) {
23147      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
23148      a && 9 == a.nodeType && (a = a.documentElement);
23149      var b = { features: [] };
23150      this.readNode(a, b);
23151      a = [];
23152      for (var c = 0, d = b.features.length; c < d; c++) {
23153          var e = b.features[c];
23154          this.internalProjection && this.externalProjection && e.components[0] && e.components[0].transform(this.externalProjection, this.internalProjection);
23155          e = new OpenLayers.Feature.Vector(e.components[0], e.attributes);
23156          a.push(e);
23157      }
23158      return a;
23159  },
23160  readers: {
23161      sa: {
23162          SamplingPoint: function (a, b) {
23163              if (!b.attributes) {
23164                  var c = { attributes: {} };
23165                  b.features.push(c);
23166                  b = c;
23167              }
23168              b.attributes.id = this.getAttributeNS(a, this.namespaces.gml, "id");
23169              this.readChildNodes(a, b);
23170          },
23171          position: function (a, b) {
23172              this.readChildNodes(a, b);
23173          },
23174      },
23175      gml: OpenLayers.Util.applyDefaults(
23176          {
23177              FeatureCollection: function (a, b) {
23178                  this.readChildNodes(a, b);
23179              },
23180              featureMember: function (a, b) {
23181                  var c = { attributes: {} };
23182                  b.features.push(c);
23183                  this.readChildNodes(a, c);
23184              },
23185              name: function (a, b) {
23186                  b.attributes.name = this.getChildValue(a);
23187              },
23188              pos: function (a, b) {
23189                  this.externalProjection || (this.externalProjection = new OpenLayers.Projection(a.getAttribute("srsName")));
23190                  OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this, [a, b]);
23191              },
23192          },
23193          OpenLayers.Format.GML.v3.prototype.readers.gml
23194      ),
23195  },
23196  writers: {
23197      sos: {
23198          GetFeatureOfInterest: function (a) {
23199              for (var b = this.createElementNSPlus("GetFeatureOfInterest", { attributes: { version: this.VERSION, service: "SOS", "xsi:schemaLocation": this.schemaLocation } }), c = 0, d = a.fois.length; c < d; c++)
23200                  this.writeNode("FeatureOfInterestId", { foi: a.fois[c] }, b);
23201              return b;
23202          },
23203          FeatureOfInterestId: function (a) {
23204              return this.createElementNSPlus("FeatureOfInterestId", { value: a.foi });
23205          },
23206      },
23207  },
23208  CLASS_NAME: "OpenLayers.Format.SOSGetFeatureOfInterest",
23209});
23210OpenLayers.Format.SOSGetObservation = OpenLayers.Class(OpenLayers.Format.XML, {
23211  namespaces: {
23212      ows: "http://www.opengis.net/ows",
23213      gml: "http://www.opengis.net/gml",
23214      sos: "http://www.opengis.net/sos/1.0",
23215      ogc: "http://www.opengis.net/ogc",
23216      om: "http://www.opengis.net/om/1.0",
23217      sa: "http://www.opengis.net/sampling/1.0",
23218      xlink: "http://www.w3.org/1999/xlink",
23219      xsi: "http://www.w3.org/2001/XMLSchema-instance",
23220  },
23221  regExes: { trimSpace: /^\s*|\s*$/g, removeSpace: /\s*/g, splitSpace: /\s+/, trimComma: /\s*,\s*/g },
23222  VERSION: "1.0.0",
23223  schemaLocation: "http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosGetObservation.xsd",
23224  defaultPrefix: "sos",
23225  read: function (a) {
23226      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
23227      a && 9 == a.nodeType && (a = a.documentElement);
23228      var b = { measurements: [], observations: [] };
23229      this.readNode(a, b);
23230      return b;
23231  },
23232  write: function (a) {
23233      a = this.writeNode("sos:GetObservation", a);
23234      a.setAttribute("xmlns:om", this.namespaces.om);
23235      a.setAttribute("xmlns:ogc", this.namespaces.ogc);
23236      this.setAttributeNS(a, this.namespaces.xsi, "xsi:schemaLocation", this.schemaLocation);
23237      return OpenLayers.Format.XML.prototype.write.apply(this, [a]);
23238  },
23239  readers: {
23240      om: {
23241          ObservationCollection: function (a, b) {
23242              b.id = this.getAttributeNS(a, this.namespaces.gml, "id");
23243              this.readChildNodes(a, b);
23244          },
23245          member: function (a, b) {
23246              this.readChildNodes(a, b);
23247          },
23248          Measurement: function (a, b) {
23249              var c = {};
23250              b.measurements.push(c);
23251              this.readChildNodes(a, c);
23252          },
23253          Observation: function (a, b) {
23254              var c = {};
23255              b.observations.push(c);
23256              this.readChildNodes(a, c);
23257          },
23258          samplingTime: function (a, b) {
23259              var c = {};
23260              b.samplingTime = c;
23261              this.readChildNodes(a, c);
23262          },
23263          observedProperty: function (a, b) {
23264              b.observedProperty = this.getAttributeNS(a, this.namespaces.xlink, "href");
23265              this.readChildNodes(a, b);
23266          },
23267          procedure: function (a, b) {
23268              b.procedure = this.getAttributeNS(a, this.namespaces.xlink, "href");
23269              this.readChildNodes(a, b);
23270          },
23271          featureOfInterest: function (a, b) {
23272              var c = { features: [] };
23273              b.fois = [];
23274              b.fois.push(c);
23275              this.readChildNodes(a, c);
23276              for (var d = [], e = 0, f = c.features.length; e < f; e++) {
23277                  var g = c.features[e];
23278                  d.push(new OpenLayers.Feature.Vector(g.components[0], g.attributes));
23279              }
23280              c.features = d;
23281          },
23282          result: function (a, b) {
23283              var c = {};
23284              b.result = c;
23285              "" !== this.getChildValue(a) ? ((c.value = this.getChildValue(a)), (c.uom = a.getAttribute("uom"))) : this.readChildNodes(a, c);
23286          },
23287      },
23288      sa: OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.sa,
23289      gml: OpenLayers.Util.applyDefaults(
23290          {
23291              TimeInstant: function (a, b) {
23292                  var c = {};
23293                  b.timeInstant = c;
23294                  this.readChildNodes(a, c);
23295              },
23296              timePosition: function (a, b) {
23297                  b.timePosition = this.getChildValue(a);
23298              },
23299          },
23300          OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.gml
23301      ),
23302  },
23303  writers: {
23304      sos: {
23305          GetObservation: function (a) {
23306              var b = this.createElementNSPlus("GetObservation", { attributes: { version: this.VERSION, service: "SOS" } });
23307              this.writeNode("offering", a, b);
23308              a.eventTime && this.writeNode("eventTime", a, b);
23309              for (var c in a.procedures) this.writeNode("procedure", a.procedures[c], b);
23310              for (var d in a.observedProperties) this.writeNode("observedProperty", a.observedProperties[d], b);
23311              a.foi && this.writeNode("featureOfInterest", a.foi, b);
23312              this.writeNode("responseFormat", a, b);
23313              a.resultModel && this.writeNode("resultModel", a, b);
23314              a.responseMode && this.writeNode("responseMode", a, b);
23315              return b;
23316          },
23317          featureOfInterest: function (a) {
23318              var b = this.createElementNSPlus("featureOfInterest");
23319              this.writeNode("ObjectID", a.objectId, b);
23320              return b;
23321          },
23322          ObjectID: function (a) {
23323              return this.createElementNSPlus("ObjectID", { value: a });
23324          },
23325          responseFormat: function (a) {
23326              return this.createElementNSPlus("responseFormat", { value: a.responseFormat });
23327          },
23328          procedure: function (a) {
23329              return this.createElementNSPlus("procedure", { value: a });
23330          },
23331          offering: function (a) {
23332              return this.createElementNSPlus("offering", { value: a.offering });
23333          },
23334          observedProperty: function (a) {
23335              return this.createElementNSPlus("observedProperty", { value: a });
23336          },
23337          eventTime: function (a) {
23338              var b = this.createElementNSPlus("eventTime");
23339              "latest" === a.eventTime && this.writeNode("ogc:TM_Equals", a, b);
23340              return b;
23341          },
23342          resultModel: function (a) {
23343              return this.createElementNSPlus("resultModel", { value: a.resultModel });
23344          },
23345          responseMode: function (a) {
23346              return this.createElementNSPlus("responseMode", { value: a.responseMode });
23347          },
23348      },
23349      ogc: {
23350          TM_Equals: function (a) {
23351              var b = this.createElementNSPlus("ogc:TM_Equals");
23352              this.writeNode("ogc:PropertyName", { property: "urn:ogc:data:time:iso8601" }, b);
23353              "latest" === a.eventTime && this.writeNode("gml:TimeInstant", { value: "latest" }, b);
23354              return b;
23355          },
23356          PropertyName: function (a) {
23357              return this.createElementNSPlus("ogc:PropertyName", { value: a.property });
23358          },
23359      },
23360      gml: {
23361          TimeInstant: function (a) {
23362              var b = this.createElementNSPlus("gml:TimeInstant");
23363              this.writeNode("gml:timePosition", a, b);
23364              return b;
23365          },
23366          timePosition: function (a) {
23367              return this.createElementNSPlus("gml:timePosition", { value: a.value });
23368          },
23369      },
23370  },
23371  CLASS_NAME: "OpenLayers.Format.SOSGetObservation",
23372});
23373OpenLayers.Control.UTFGrid = OpenLayers.Class(OpenLayers.Control, {
23374  autoActivate: !0,
23375  layers: null,
23376  defaultHandlerOptions: { delay: 300, pixelTolerance: 4, stopMove: !1, single: !0, double: !1, stopSingle: !1, stopDouble: !1 },
23377  handlerMode: "click",
23378  setHandler: function (a) {
23379      this.handlerMode = a;
23380      this.resetHandler();
23381  },
23382  resetHandler: function () {
23383      this.handler && (this.handler.deactivate(), this.handler.destroy(), (this.handler = null));
23384      "hover" == this.handlerMode
23385          ? (this.handler = new OpenLayers.Handler.Hover(this, { pause: this.handleEvent, move: this.reset }, this.handlerOptions))
23386          : "click" == this.handlerMode
23387          ? (this.handler = new OpenLayers.Handler.Click(this, { click: this.handleEvent }, this.handlerOptions))
23388          : "move" == this.handlerMode && (this.handler = new OpenLayers.Handler.Hover(this, { pause: this.handleEvent, move: this.handleEvent }, this.handlerOptions));
23389      return this.handler ? !0 : !1;
23390  },
23391  initialize: function (a) {
23392      a = a || {};
23393      a.handlerOptions = a.handlerOptions || this.defaultHandlerOptions;
23394      OpenLayers.Control.prototype.initialize.apply(this, [a]);
23395      this.resetHandler();
23396  },
23397  handleEvent: function (a) {
23398      if (null == a) this.reset();
23399      else {
23400          var b = this.map.getLonLatFromPixel(a.xy);
23401          if (b) {
23402              var c = this.findLayers();
23403              if (0 < c.length) {
23404                  for (var d = {}, e, f, g = 0, h = c.length; g < h; g++) (e = c[g]), (f = OpenLayers.Util.indexOf(this.map.layers, e)), (d[f] = e.getFeatureInfo(b));
23405                  this.callback(d, b, a.xy);
23406              }
23407          }
23408      }
23409  },
23410  callback: function (a) {},
23411  reset: function (a) {
23412      this.callback(null);
23413  },
23414  findLayers: function () {
23415      for (var a = this.layers || this.map.layers, b = [], c, d = a.length - 1; 0 <= d;
23415 --d) (c = a[d]), c instanceof OpenLayers.Layer.UTFGrid && b.push(c);
23416      return b;
23417  },
23418  CLASS_NAME: "OpenLayers.Control.UTFGrid",
23419});
23420OpenLayers.Format.CQL = (function () {
23421  function a(a) {
23422      function b() {
23423          var a = e.pop();
23424          switch (a.type) {
23425              case "LOGICAL":
23426                  var c = b(),
23427                      g = b();
23428                  return new OpenLayers.Filter.Logical({ filters: [g, c], type: f[a.text.toUpperCase()] });
23429              case "NOT":
23430                  return (a = b()), new OpenLayers.Filter.Logical({ filters: [a], type: OpenLayers.Filter.Logical.NOT });
23431              case "BETWEEN":
23432                  return e.pop(), (g = b()), (a = b()), (c = b()), new OpenLayers.Filter.Comparison({ property: c, lowerBoundary: a, upperBoundary: g, type: OpenLayers.Filter.Comparison.BETWEEN });
23433              case "COMPARISON":
23434                  return (g = b()), (c = b()), new OpenLayers.Filter.Comparison({ property: c, value: g, type: d[a.text.toUpperCase()] });
23435              case "IS_NULL":
23436                  return (c = b()), new OpenLayers.Filter.Comparison({ property: c, type: d[a.text.toUpperCase()] });
23437              case "VALUE":
23438                  return (c = a.text.match(/^'(.*)'$/)) ? c[1].replace(/''/g, "'") : Number(a.text);
23439              case "SPATIAL":
23440                  switch (a.text.toUpperCase()) {
23441                      case "BBOX":
23442                          var a = b(),
23443                              c = b(),
23444                              g = b(),
23445                              h = b(),
23446                              k = b();
23447                          return new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.BBOX, property: k, value: OpenLayers.Bounds.fromArray([h, g, c, a]) });
23448                      case "INTERSECTS":
23449                          return (g = b()), (c = b()), new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.INTERSECTS, property: c, value: g });
23450                      case "WITHIN":
23451                          return (g = b()), (c = b()), new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.WITHIN, property: c, value: g });
23452                      case "CONTAINS":
23453                          return (g = b()), (c = b()), new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.CONTAINS, property: c, value: g });
23454                      case "DWITHIN":
23455                          return (a = b()), (g = b()), (c = b()), new OpenLayers.Filter.Spatial({ type: OpenLayers.Filter.Spatial.DWITHIN, value: g, property: c, distance: Number(a) });
23456                  }
23457              case "GEOMETRY":
23458                  return OpenLayers.Geometry.fromWKT(a.text);
23459              default:
23460                  return a.text;
23461          }
23462      }
23463      for (var c = [], e = []; a.length; ) {
23464          var g = a.shift();
23465          switch (g.type) {
23466              case "PROPERTY":
23467              case "GEOMETRY":
23468              case "VALUE":
23469                  e.push(g);
23470                  break;
23471              case "COMPARISON":
23472              case "BETWEEN":
23473              case "IS_NULL":
23474              case "LOGICAL":
23475                  for (var k = h[g.type]; 0 < c.length && h[c[c.length - 1].type] <= k; ) e.push(c.pop());
23476                  c.push(g);
23477                  break;
23478              case "SPATIAL":
23479              case "NOT":
23480              case "LPAREN":
23481                  c.push(g);
23482                  break;
23483              case "RPAREN":
23484                  for (; 0 < c.length && "LPAREN" != c[c.length - 1].type; ) e.push(c.pop());
23485                  c.pop();
23486                  0 < c.length && "SPATIAL" == c[c.length - 1].type && e.push(c.pop());
23487              case "COMMA":
23488              case "END":
23489                  break;
23490              default:
23491                  throw Error("Unknown token type " + g.type);
23492          }
23493      }
23494      for (; 0 < c.length; ) e.push(c.pop());
23495      a = b();
23496      if (0 < e.length) {
23497          a = "Remaining tokens after building AST: \n";
23498          for (c = e.length - 1; 0 <= c; c--) a += e[c].type + ": " + e[c].text + "\n";
23499          throw Error(a);
23500      }
23501      return a;
23502  }
23503  var b = {
23504          PROPERTY: /^[_a-zA-Z]\w*/,
23505          COMPARISON: /^(=|<>|<=|<|>=|>|LIKE)/i,
23506          IS_NULL: /^IS NULL/i,
23507          COMMA: /^,/,
23508          LOGICAL: /^(AND|OR)/i,
23509          VALUE: /^('([^']|'')*'|\d+(\.\d*)?|\.\d+)/,
23510          LPAREN: /^\(/,
23511          RPAREN: /^\)/,
23512          SPATIAL: /^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,
23513          NOT: /^NOT/i,
23514          BETWEEN: /^BETWEEN/i,
23515          GEOMETRY: function (a) {
23516              var b = /^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(a);
23517              if (b) {
23518                  var c = a.length,
23519                      b = a.indexOf("(", b[0].length);
23520                  if (-1 < b)
23521                      for (var d = 1; b < c && 0 < d; )
23522                          switch ((b++, a.charAt(b))) {
23523                              case "(":
23524                                  d++;
23525                                  break;
23526                              case ")":
23527                                  d--;
23528                          }
23529                  return [a.substr(0, b + 1)];
23530              }
23531          },
23532          END: /^$/,
23533      },
23534      c = {
23535          LPAREN: ["GEOMETRY", "SPATIAL", "PROPERTY", "VALUE", "LPAREN"],
23536          RPAREN: ["NOT", "LOGICAL", "END", "RPAREN"],
23537          PROPERTY: ["COMPARISON", "BETWEEN", "COMMA", "IS_NULL"],
23538          BETWEEN: ["VALUE"],
23539          IS_NULL: ["END"],
23540          COMPARISON: ["VALUE"],
23541          COMMA: ["GEOMETRY", "VALUE", "PROPERTY"],
23542          VALUE: ["LOGICAL", "COMMA", "RPAREN", "END"],
23543          SPATIAL: ["LPAREN"],
23544          LOGICAL: ["NOT", "VALUE", "SPATIAL", "PROPERTY", "LPAREN"],
23545          NOT: ["PROPERTY", "LPAREN"],
23546          GEOMETRY: ["COMMA", "RPAREN"],
23547      },
23548      d = {
23549          "=": OpenLayers.Filter.Comparison.EQUAL_TO,
23550          "<>": OpenLayers.Filter.Comparison.NOT_EQUAL_TO,
23551          "<": OpenLayers.Filter.Comparison.LESS_THAN,
23552          "<=": OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,
23553          ">": OpenLayers.Filter.Comparison.GREATER_THAN,
23554          ">=": OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,
23555          LIKE: OpenLayers.Filter.Comparison.LIKE,
23556          BETWEEN: OpenLayers.Filter.Comparison.BETWEEN,
23557          "IS NULL": OpenLayers.Filter.Comparison.IS_NULL,
23558      },
23559      e = {},
23560      f = { AND: OpenLayers.Filter.Logical.AND, OR: OpenLayers.Filter.Logical.OR },
23561      g = {},
23562      h = { RPAREN: 3, LOGICAL: 2, COMPARISON: 1 },
23563      k;
23564  for (k in d) d.hasOwnProperty(k) && (e[d[k]] = k);
23565  for (k in f) f.hasOwnProperty(k) && (g[f[k]] = k);
23566  return OpenLayers.Class(OpenLayers.Format, {
23567      read: function (d) {
23568          var e = d;
23569          d = [];
23570          var f,
23571              g = ["NOT", "GEOMETRY", "SPATIAL", "PROPERTY", "LPAREN"];
23572          do {
23573              a: {
23574                  f = g;
23575                  for (var h = void 0, g = void 0, k = f.length, h = 0; h < k; h++) {
23576                      var g = f[h],
23577                          s = b[g] instanceof RegExp ? b[g].exec(e) : (0, b[g])(e);
23578                      if (s) {
23579                          f = s[0];
23580                          e = e.substr(f.length).replace(/^\s*/, "");
23581                          f = { type: g, text: f, remainder: e };
23582                          break a;
23583                      }
23584                  }
23585                  d = "ERROR: In parsing: [" + e + "], expected one of: ";
23586                  for (h = 0; h < k; h++) (g = f[h]), (d += "\n    " + g + ": " + b[g]);
23587                  throw Error(d);
23588              }
23589              e = f.remainder;
23590              g = c[f.type];
23591              if ("END" != f.type && !g) throw Error("No follows list for " + f.type);
23592              d.push(f);
23593          } while ("END" != f.type);
23594          d = a(d);
23595          this.keepData && (this.data = d);
23596          return d;
23597      },
23598      write: function (a) {
23599          if (a instanceof OpenLayers.Geometry) return a.toString();
23600          switch (a.CLASS_NAME) {
23601              case "OpenLayers.Filter.Spatial":
23602                  switch (a.type) {
23603                      case OpenLayers.Filter.Spatial.BBOX:
23604                          return "BBOX(" + a.property + "," + a.value.toBBOX() + ")";
23605                      case OpenLayers.Filter.Spatial.DWITHIN:
23606                          return "DWITHIN(" + a.property + ", " + this.write(a.value) + ", " + a.distance + ")";
23607                      case OpenLayers.Filter.Spatial.WITHIN:
23608                          return "WITHIN(" + a.property + ", " + this.write(a.value) + ")";
23609                      case OpenLayers.Filter.Spatial.INTERSECTS:
23610                          return "INTERSECTS(" + a.property + ", " + this.write(a.value) + ")";
23611                      case OpenLayers.Filter.Spatial.CONTAINS:
23612                          return "CONTAINS(" + a.property + ", " + this.write(a.value) + ")";
23613                      default:
23614                          throw Error("Unknown spatial filter type: " + a.type);
23615                  }
23616              case "OpenLayers.Filter.Logical":
23617                  if (a.type == OpenLayers.Filter.Logical.NOT) return "NOT (" + this.write(a.filters[0]) + ")";
23618                  for (var b = "(", c = !0, d = 0; d < a.filters.length; d++) c ? (c = !1) : (b += ") " + g[a.type] + " ("), (b += this.write(a.filters[d]));
23619                  return b + ")";
23620              case "OpenLayers.Filter.Comparison":
23621                  return a.type == OpenLayers.Filter.Comparison.BETWEEN
23622                      ? a.property + " BETWEEN " + this.write(a.lowerBoundary) + " AND " + this.write(a.upperBoundary)
23623                      : null !== a.value
23624                      ? a.property + " " + e[a.type] + " " + this.write(a.value)
23625                      : a.property + " " + e[a.type];
23626              case void 0:
23627                  if ("string" === typeof a) return "'" + a.replace(/'/g, "''") + "'";
23628                  if ("number" === typeof a) return String(a);
23629              default:
23630                  throw Error("Can't encode: " + a.CLASS_NAME + " " + a);
23631          }
23632      },
23633      CLASS_NAME: "OpenLayers.Format.CQL",
23634  });
23635})();
23636OpenLayers.Control.Split = OpenLayers.Class(OpenLayers.Control, {
23637  layer: null,
23638  source: null,
23639  sourceOptions: null,
23640  tolerance: null,
23641  edge: !0,
23642  deferDelete: !1,
23643  mutual: !0,
23644  targetFilter: null,
23645  sourceFilter: null,
23646  handler: null,
23647  initialize: function (a) {
23648      OpenLayers.Control.prototype.initialize.apply(this, [a]);
23649      this.options = a || {};
23650      this.options.source && this.setSource(this.options.source);
23651  },
23652  setSource: function (a) {
23653      this.active ? (this.deactivate(), this.handler && (this.handler.destroy(), delete this.handler), (this.source = a), this.activate()) : (this.source = a);
23654  },
23655  activate: function () {
23656      var a = OpenLayers.Control.prototype.activate.call(this);
23657      if (a)
23658          if (!this.source)
23659              this.handler ||
23660                  (this.handler = new OpenLayers.Handler.Path(
23661                      this,
23662                      {
23663                          done: function (a) {
23664                              this.onSketchComplete({ feature: new OpenLayers.Feature.Vector(a) });
23665                          },
23666                      },
23667                      { layerOptions: this.sourceOptions }
23668                  )),
23669                  this.handler.activate();
23670          else if (this.source.events) this.source.events.on({ sketchcomplete: this.onSketchComplete, afterfeaturemodified: this.afterFeatureModified, scope: this });
23671      return a;
23672  },
23673  deactivate: function () {
23674      var a = OpenLayers.Control.prototype.deactivate.call(this);
23675      a && this.source && this.source.events && this.source.events.un({ sketchcomplete: this.onSketchComplete, afterfeaturemodified: this.afterFeatureModified, scope: this });
23676      return a;
23677  },
23678  onSketchComplete: function (a) {
23679      this.feature = null;
23680      return !this.considerSplit(a.feature);
23681  },
23682  afterFeatureModified: function (a) {
23683      a.modified && "function" === typeof a.feature.geometry.split && ((this.feature = a.feature), this.considerSplit(a.feature));
23684  },
23685  removeByGeometry: function (a, b) {
23686      for (var c = 0, d = a.length; c < d; ++c)
23687          if (a[c].geometry === b) {
23688              a.splice(c, 1);
23689              break;
23690          }
23691  },
23692  isEligible: function (a) {
23693      return a.geometry ? a.state !== OpenLayers.State.DELETE && "function" === typeof a.geometry.split && this.feature !== a && (!this.targetFilter || this.targetFilter.evaluate(a.attributes)) : !1;
23694  },
23695  considerSplit: function (a) {
23696      var b = !1,
23697          c = !1;
23698      if (!this.sourceFilter || this.sourceFilter.evaluate(a.attributes)) {
23699          for (
23700              var d = (this.layer && this.layer.features) || [],
23701                  e,
23702                  f,
23703                  g = [],
23704                  h = [],
23705                  k = this.layer === this.source && this.mutual,
23706                  l = { edge: this.edge, tolerance: this.tolerance, mutual: k },
23707                  m = [a.geometry],
23708                  n,
23709                  p,
23710                  q,
23711                  r = 0,
23712                  s = d.length;
23713              r < s;
23714              ++r
23715          )
23716              if (((n = d[r]), this.isEligible(n))) {
23717                  p = [n.geometry];
23718                  for (var t = 0; t < m.length; ++t) {
23719                      q = m[t];
23720                      for (var u = 0; u < p.length; ++u)
23721                          if (((e = p[u]), q.getBounds().intersectsBounds(e.getBounds()) && (e = q.split(e, l))))
23722                              (f = this.events.triggerEvent("beforesplit", { source: a, target: n })),
23723                                  !1 !== f &&
23724                                      (k && ((f = e[0]), 1 < f.length && (f.unshift(t, 1), Array.prototype.splice.apply(m, f), (t += f.length - 3)), (e = e[1])),
23725                                      1 < e.length && (e.unshift(u, 1), Array.prototype.splice.apply(p, e), (u += e.length - 3)));
23726                  }
23727                  p && 1 < p.length && (this.geomsToFeatures(n, p), this.events.triggerEvent("split", { original: n, features: p }), Array.prototype.push.apply(g, p), h.push(n), (c = !0));
23728              }
23729          m && 1 < m.length && (this.geomsToFeatures(a, m), this.events.triggerEvent("split", { original: a, features: m }), Array.prototype.push.apply(g, m), h.push(a), (b = !0));
23730          if (b || c) {
23731              if (this.deferDelete) {
23732                  d = [];
23733                  r = 0;
23734                  for (s = h.length; r < s; ++r) (c = h[r]), c.state === OpenLayers.State.INSERT ? d.push(c) : ((c.state = OpenLayers.State.DELETE), this.layer.drawFeature(c));
23735                  this.layer.destroyFeatures(d, { silent: !0 });
23736                  r = 0;
23737                  for (s = g.length; r < s; ++r) g[r].state = OpenLayers.State.INSERT;
23738              } else this.layer.destroyFeatures(h, { silent: !0 });
23739              this.layer.addFeatures(g, { silent: !0 });
23740              this.events.triggerEvent("aftersplit", { source: a, features: g });
23741          }
23742      }
23743      return b;
23744  },
23745  geomsToFeatures: function (a, b) {
23746      var c = a.clone();
23747      delete c.geometry;
23748      for (var d, e = 0, f = b.length; e < f; ++e) (d = c.clone()), (d.geometry = b[e]), (d.state = OpenLayers.State.INSERT), (b[e] = d);
23749  },
23750  destroy: function () {
23751      this.active && this.deactivate();
23752      OpenLayers.Control.prototype.destroy.call(this);
23753  },
23754  CLASS_NAME: "OpenLayers.Control.Split",
23755});
23756OpenLayers.Layer.WMTS = OpenLayers.Class(OpenLayers.Layer.Grid, {
23757  isBaseLayer: !0,
23758  version: "1.0.0",
23759  requestEncoding: "KVP",
23760  url: null,
23761  layer: null,
23762  matrixSet: null,
23763  style: null,
23764  format: "image/jpeg",
23765  tileOrigin: null,
23766  tileFullExtent: null,
23767  formatSuffix: null,
23768  matrixIds: null,
23769  dimensions: null,
23770  params: null,
23771  zoomOffset: 0,
23772  serverResolutions: null,
23773  formatSuffixMap: { "image/png": "png", "image/png8": "png", "image/png24": "png", "image/png32": "png", png: "png", "image/jpeg": "jpg", "image/jpg": "jpg", jpeg: "jpg", jpg: "jpg" },
23774  matrix: null,
23775  initialize: function (a) {
23776      var b = { url: !0, layer: !0, style: !0, matrixSet: !0 },
23777          c;
23778      for (c in b) if (!(c in a)) throw Error("Missing property '" + c + "' in layer configuration.");
23779      a.params = OpenLayers.Util.upperCaseObject(a.params);
23780      OpenLayers.Layer.Grid.prototype.initialize.apply(this, [a.name, a.url, a.params, a]);
23781      this.formatSuffix || (this.formatSuffix = this.formatSuffixMap[this.format] || this.format.split("/").pop());
23782      if (this.matrixIds && (a = this.matrixIds.length) && "string" === typeof this.matrixIds[0]) for (b = this.matrixIds, this.matrixIds = Array(a), c = 0; c < a; ++c) this.matrixIds[c] = { identifier: b[c] };
23783  },
23784  setMap: function () {
23785      OpenLayers.Layer.Grid.prototype.setMap.apply(this, arguments);
23786  },
23787  updateMatrixProperties: function () {
23788      if ((this.matrix = this.getMatrix()))
23789          this.matrix.topLeftCorner && (this.tileOrigin = this.matrix.topLeftCorner),
23790              this.matrix.tileWidth && this.matrix.tileHeight && (this.tileSize = new OpenLayers.Size(this.matrix.tileWidth, this.matrix.tileHeight)),
23791              this.tileOrigin || (this.tileOrigin = new OpenLayers.LonLat(this.maxExtent.left, this.maxExtent.top)),
23792              this.tileFullExtent || (this.tileFullExtent = this.maxExtent);
23793  },
23794  moveTo: function (a, b, c) {
23795      (!b && this.matrix) || this.updateMatrixProperties();
23796      return OpenLayers.Layer.Grid.prototype.moveTo.apply(this, arguments);
23797  },
23798  clone: function (a) {
23799      null == a && (a = new OpenLayers.Layer.WMTS(this.options));
23800      return (a = OpenLayers.Layer.Grid.prototype.clone.apply(this, [a]));
23801  },
23802  getIdentifier: function () {
23803      return this.getServerZoom();
23804  },
23805  getMatrix: function () {
23806      var a;
23807      if (this.matrixIds && 0 !== this.matrixIds.length)
23808          if ("scaleDenominator" in this.matrixIds[0])
23809              for (var b = (OpenLayers.METERS_PER_INCH * OpenLayers.INCHES_PER_UNIT[this.units] * this.getServerResolution()) / 2.8e-4, c = Number.POSITIVE_INFINITY, d, e = 0, f = this.matrixIds.length; e < f; ++e)
23810                  (d = Math.abs(1 - this.matrixIds[e].scaleDenominator / b)), d < c && ((c = d), (a = this.matrixIds[e]));
23811          else a = this.matrixIds[this.getIdentifier()];
23812      else a = { identifier: this.getIdentifier() };
23813      return a;
23814  },
23815  getTileInfo: function (a) {
23816      var b = this.getServerResolution(),
23817          c = (a.lon - this.tileOrigin.lon) / (b * this.tileSize.w);
23818      a = (this.tileOrigin.lat - a.lat) / (b * this.tileSize.h);
23819      var b = Math.floor(c),
23820          d = Math.floor(a);
23821      return { col: b, row: d, i: Math.floor((c - b) * this.tileSize.w), j: Math.floor((a - d) * this.tileSize.h) };
23822  },
23823  getURL: function (a) {
23824      a = this.adjustBounds(a);
23825      var b = "";
23826      if (!this.tileFullExtent || this.tileFullExtent.intersectsBounds(a)) {
23827          a = a.getCenterLonLat();
23828          var c = this.getTileInfo(a);
23829          a = this.dimensions;
23830          var d,
23831              b = OpenLayers.Util.isArray(this.url) ? this.selectUrl([this.version, this.style, this.matrixSet, this.matrix.identifier, c.row, c.col].join(), this.url) : this.url;
23832          if ("REST" === this.requestEncoding.toUpperCase())
23833              if (((d = this.params), -1 !== b.indexOf("{"))) {
23834                  b = b.replace(/\{/g, "${");
23835                  c = { style: this.style, Style: this.style, TileMatrixSet: this.matrixSet, TileMatrix: this.matrix.identifier, TileRow: c.row, TileCol: c.col };
23836                  if (a) {
23837                      var e, f;
23838                      for (f = a.length - 1; 0 <= f; --f) (e = a[f]), (c[e] = d[e.toUpperCase()]);
23839                  }
23840                  b = OpenLayers.String.format(b, c);
23841              } else {
23842                  e = this.version + "/" + this.layer + "/" + this.style + "/";
23843                  if (a) for (f = 0; f < a.length; f++) d[a[f]] && (e = e + d[a[f]] + "/");
23844                  e = e + this.matrixSet + "/" + this.matrix.identifier + "/" + c.row + "/" + c.col + "." + this.formatSuffix;
23845                  b.match(/\/$/) || (b += "/");
23846                  b += e;
23847              }
23848          else
23849              "KVP" === this.requestEncoding.toUpperCase() &&
23850                  ((d = {
23851                      SERVICE: "WMTS",
23852                      REQUEST: "GetTile",
23853                      VERSION: this.version,
23854                      LAYER: this.layer,
23855                      STYLE: this.style,
23856                      TILEMATRIXSET: this.matrixSet,
23857                      TILEMATRIX: this.matrix.identifier,
23858                      TILEROW: c.row,
23859                      TILECOL: c.col,
23860                      FORMAT: this.format,
23861                  }),
23862                  (b = OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this, [d])));
23863      }
23864      return b;
23865  },
23866  mergeNewParams: function (a) {
23867      if ("KVP" === this.requestEncoding.toUpperCase()) return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this, [OpenLayers.Util.upperCaseObject(a)]);
23868  },
23869  CLASS_NAME: "OpenLayers.Layer.WMTS",
23870});
23871OpenLayers.Protocol.SOS.v1_0_0 = OpenLayers.Class(OpenLayers.Protocol, {
23872  fois: null,
23873  formatOptions: null,
23874  initialize: function (a) {
23875      OpenLayers.Protocol.prototype.initialize.apply(this, [a]);
23876      a.format || (this.format = new OpenLayers.Format.SOSGetFeatureOfInterest(this.formatOptions));
23877  },
23878  destroy: function () {
23879      this.options && !this.options.format && this.format.destroy();
23880      this.format = null;
23881      OpenLayers.Protocol.prototype.destroy.apply(this);
23882  },
23883  read: function (a) {
23884      a = OpenLayers.Util.extend({}, a);
23885      OpenLayers.Util.applyDefaults(a, this.options || {});
23886      var b = new OpenLayers.Protocol.Response({ requestType: "read" }),
23887          c = this.format,
23888          c = OpenLayers.Format.XML.prototype.write.apply(c, [c.writeNode("sos:GetFeatureOfInterest", { fois: this.fois })]);
23889      b.priv = OpenLayers.Request.POST({ url: a.url, callback: this.createCallback(this.handleRead, b, a), data: c });
23890      return b;
23891  },
23892  handleRead: function (a, b) {
23893      if (b.callback) {
23894          var c = a.priv;
23895          200 <= c.status && 300 > c.status ? ((a.features = this.parseFeatures(c)), (a.code = OpenLayers.Protocol.Response.SUCCESS)) : (a.code = OpenLayers.Protocol.Response.FAILURE);
23896          b.callback.call(b.scope, a);
23897      }
23898  },
23899  parseFeatures: function (a) {
23900      var b = a.responseXML;
23901      (b && b.documentElement) || (b = a.responseText);
23902      return !b || 0 >= b.length ? null : this.format.read(b);
23903  },
23904  CLASS_NAME: "OpenLayers.Protocol.SOS.v1_0_0",
23905});
23906OpenLayers.Layer.KaMapCache = OpenLayers.Class(OpenLayers.Layer.KaMap, {
23907  IMAGE_EXTENSIONS: { jpeg: "jpg", gif: "gif", png: "png", png8: "png", png24: "png", dithered: "png" },
23908  DEFAULT_FORMAT: "jpeg",
23909  initialize: function (a, b, c, d) {
23910      OpenLayers.Layer.KaMap.prototype.initialize.apply(this, arguments);
23911      this.extension = this.IMAGE_EXTENSIONS[this.params.i.toLowerCase() || this.DEFAULT_FORMAT];
23912  },
23913  getURL: function (a) {
23914      a = this.adjustBounds(a);
23915      var b = this.map.getResolution(),
23916          c = Math.round(1e4 * this.map.getScale()) / 1e4,
23917          d = Math.round(a.left / b);
23918      a = -Math.round(a.top / b);
23919      var b = Math.floor(d / this.tileSize.w / this.params.metaTileSize.w) * this.tileSize.w * this.params.metaTileSize.w,
23920          e = Math.floor(a / this.tileSize.h / this.params.metaTileSize.h) * this.tileSize.h * this.params.metaTileSize.h,
23921          c = ["/", this.params.map, "/", c, "/", this.params.g.replace(/\s/g, "_"), "/def/t", e, "/l", b, "/t", a, "l", d, ".", this.extension],
23922          d = this.url;
23923      OpenLayers.Util.isArray(d) && (d = this.selectUrl(c.join(""), d));
23924      return d + c.join("");
23925  },
23926  CLASS_NAME: "OpenLayers.Layer.KaMapCache",
23927});
23928OpenLayers.Protocol.WFS.v1_1_0 = OpenLayers.Class(OpenLayers.Protocol.WFS.v1, {
23929  version: "1.1.0",
23930  initialize: function (a) {
23931      OpenLayers.Protocol.WFS.v1.prototype.initialize.apply(this, arguments);
23932      this.outputFormat &&
23933          !this.readFormat &&
23934          ("gml2" == this.outputFormat.toLowerCase()
23935              ? (this.readFormat = new OpenLayers.Format.GML.v2({ featureType: this.featureType, featureNS: this.featureNS, geometryName: this.geometryName }))
23936              : "json" == this.outputFormat.toLowerCase() && (this.readFormat = new OpenLayers.Format.GeoJSON()));
23937  },
23938  CLASS_NAME: "OpenLayers.Protocol.WFS.v1_1_0",
23939});
23940OpenLayers.Format.WMSCapabilities.v1_1_1 = OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1, {
23941  version: "1.1.1",
23942  readers: {
23943      wms: OpenLayers.Util.applyDefaults(
23944          {
23945              SRS: function (a, b) {
23946                  b.srs[this.getChildValue(a)] = !0;
23947              },
23948          },
23949          OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms
23950      ),
23951  },
23952  CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1_1_1",
23953});
23954OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC = OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1_1, {
23955  version: "1.1.1",
23956  profile: "WMSC",
23957  readers: {
23958      wms: OpenLayers.Util.applyDefaults(
23959          {
23960              VendorSpecificCapabilities: function (a, b) {
23961                  b.vendorSpecific = { tileSets: [] };
23962                  this.readChildNodes(a, b.vendorSpecific);
23963              },
23964              TileSet: function (a, b) {
23965                  var c = { srs: {}, bbox: {}, resolutions: [] };
23966                  this.readChildNodes(a, c);
23967                  b.tileSets.push(c);
23968              },
23969              Resolutions: function (a, b) {
23970                  for (var c = this.getChildValue(a).split(" "), d = 0, e = c.length; d < e; d++) "" != c[d] && b.resolutions.push(parseFloat(c[d]));
23971              },
23972              Width: function (a, b) {
23973                  b.width = parseInt(this.getChildValue(a));
23974              },
23975              Height: function (a, b) {
23976                  b.height = parseInt(this.getChildValue(a));
23977              },
23978              Layers: function (a, b) {
23979                  b.layers = this.getChildValue(a);
23980              },
23981              Styles: function (a, b) {
23982                  b.styles = this.getChildValue(a);
23983              },
23984          },
23985          OpenLayers.Format.WMSCapabilities.v1_1_1.prototype.readers.wms
23986      ),
23987  },
23988  CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC",
23989});
23990OpenLayers.Control.LayerSwitcher = OpenLayers.Class(OpenLayers.Control, {
23991  layerStates: null,
23992  layersDiv: null,
23993  baseLayersDiv: null,
23994  baseLayers: null,
23995  dataLbl: null,
23996  dataLayersDiv: null,
23997  dataLayers: null,
23998  minimizeDiv: null,
23999  maximizeDiv: null,
24000  ascending: !0,
24001  initialize: function (a) {
24002      OpenLayers.Control.prototype.initialize.apply(this, arguments);
24003      this.layerStates = [];
24004  },
24005  destroy: function () {
24006      this.clearLayersArray("base");
24007      this.clearLayersArray("data");
24008      this.map.events.un({ buttonclick: this.onButtonClick, addlayer: this.redraw, changelayer: this.redraw, removelayer: this.redraw, changebaselayer: this.redraw, scope: this });
24009      this.events.unregister("buttonclick", this, this.onButtonClick);
24010      OpenLayers.Control.prototype.destroy.apply(this, arguments);
24011  },
24012  setMap: function (a) {
24013      OpenLayers.Control.prototype.setMap.apply(this, arguments);
24014      this.map.events.on({ addlayer: this.redraw, changelayer: this.redraw, removelayer: this.redraw, changebaselayer: this.redraw, scope: this });
24015      this.outsideViewport ? (this.events.attachToElement(this.div), this.events.register("buttonclick", this, this.onButtonClick)) : this.map.events.register("buttonclick", this, this.onButtonClick);
24016  },
24017  draw: function () {
24018      OpenLayers.Control.prototype.draw.apply(this);
24019      this.loadContents();
24020      this.outsideViewport || this.minimizeControl();
24021      this.redraw();
24022      return this.div;
24023  },
24024  onButtonClick: function (a) {
24025      a = a.buttonElement;
24026      a === this.minimizeDiv
24027          ? this.minimizeControl()
24028          : a === this.maximizeDiv
24029          ? this.maximizeControl()
24030          : a._layerSwitcher === this.id &&
24031            (a["for"] && (a = document.getElementById(a["for"])), a.disabled || ("radio" == a.type ? ((a.checked = !0), this.map.setBaseLayer(this.map.getLayer(a._layer))) : ((a.checked = !a.checked), this.updateMap())));
24032  },
24033  clearLayersArray: function (a) {
24034      this[a + "LayersDiv"].innerHTML = "";
24035      this[a + "Layers"] = [];
24036  },
24037  checkRedraw: function () {
24038      if (!this.layerStates.length || this.map.layers.length != this.layerStates.length) return !0;
24039      for (var a = 0, b = this.layerStates.length; a < b; a++) {
24040          var c = this.layerStates[a],
24041              d = this.map.layers[a];
24042          if (c.name != d.name || c.inRange != d.inRange || c.id != d.id || c.visibility != d.visibility) return !0;
24043      }
24044      return !1;
24045  },
24046  redraw: function () {
24047      if (!this.checkRedraw()) return this.div;
24048      this.clearLayersArray("base");
24049      this.clearLayersArray("data");
24050      var a = !1,
24051          b = !1,
24052          c = this.map.layers.length;
24053      this.layerStates = Array(c);
24054      for (var d = 0; d < c; d++) {
24055          var e = this.map.layers[d];
24056          this.layerStates[d] = { name: e.name, visibility: e.visibility, inRange: e.inRange, id: e.id };
24057      }
24058      var f = this.map.layers.slice();
24059      this.ascending || f.reverse();
24060      d = 0;
24061      for (c = f.length; d < c; d++) {
24062          var e = f[d],
24063              g = e.isBaseLayer;
24064          if (e.displayInLayerSwitcher) {
24065              g ? (b = !0) : (a = !0);
24066              var h = g ? e == this.map.baseLayer : e.getVisibility(),
24067                  k = document.createElement("input"),
24068                  l = OpenLayers.Util.createUniqueID(this.id + "_input_");
24069              k.id = l;
24070              k.name = g ? this.id + "_baseLayers" : e.name;
24071              k.type = g ? "radio" : "checkbox";
24072              k.value = e.name;
24073              k.checked = h;
24074              k.defaultChecked = h;
24075              k.className = "olButton";
24076              k._layer = e.id;
24077              k._layerSwitcher = this.id;
24078              g || e.inRange || (k.disabled = !0);
24079              h = document.createElement("label");
24080              h["for"] = k.id;
24081              OpenLayers.Element.addClass(h, "labelSpan olButton");
24082              h._layer = e.id;
24083              h._layerSwitcher = this.id;
24084              g || e.inRange || (h.style.color = "gray");
24085              h.innerHTML = e.name;
24086              h.style.verticalAlign = g ? "bottom" : "baseline";
24087              l = document.createElement("br");
24088              (g ? this.baseLayers : this.dataLayers).push({ layer: e, inputElem: k, labelSpan: h });
24089              e = g ? this.baseLayersDiv : this.dataLayersDiv;
24090              e.appendChild(k);
24091              e.appendChild(h);
24092              e.appendChild(l);
24093          }
24094      }
24095      this.dataLbl.style.display = a ? "" : "none";
24096      this.baseLbl.style.display = b ? "" : "none";
24097      return this.div;
24098  },
24099  updateMap: function () {
24100      for (var a = 0, b = this.baseLayers.length; a < b; a++) {
24101          var c = this.baseLayers[a];
24102          c.inputElem.checked && this.map.setBaseLayer(c.layer, !1);
24103      }
24104      a = 0;
24105      for (b = this.dataLayers.length; a < b; a++) (c = this.dataLayers[a]), c.layer.setVisibility(c.inputElem.checked);
24106  },
24107  maximizeControl: function (a) {
24108      this.div.style.width = "";
24109      this.div.style.height = "";
24110      this.showControls(!1);
24111      null != a && OpenLayers.Event.stop(a);
24112  },
24113  minimizeControl: function (a) {
24114      this.div.style.width = "0px";
24115      this.div.style.height = "0px";
24116      this.showControls(!0);
24117      null != a && OpenLayers.Event.stop(a);
24118  },
24119  showControls: function (a) {
24120      this.maximizeDiv.style.display = a ? "" : "none";
24121      this.minimizeDiv.style.display = a ? "none" : "";
24122      this.layersDiv.style.display = a ? "none" : "";
24123  },
24124  loadContents: function () {
24125      this.layersDiv = document.createElement("div");
24126      this.layersDiv.id = this.id + "_layersDiv";
24127      OpenLayers.Element.addClass(this.layersDiv, "layersDiv");
24128      this.baseLbl = document.createElement("div");
24129      this.baseLbl.innerHTML = OpenLayers.i18n("Base Layer");
24130      OpenLayers.Element.addClass(this.baseLbl, "baseLbl");
24131      this.baseLayersDiv = document.createElement("div");
24132      OpenLayers.Element.addClass(this.baseLayersDiv, "baseLayersDiv");
24133      this.dataLbl = document.createElement("div");
24134      this.dataLbl.innerHTML = OpenLayers.i18n("Overlays");
24135      OpenLayers.Element.addClass(this.dataLbl, "dataLbl");
24136      this.dataLayersDiv = document.createElement("div");
24137      OpenLayers.Element.addClass(this.dataLayersDiv, "dataLayersDiv");
24138      this.ascending
24139          ? (this.layersDiv.appendChild(this.baseLbl), this.layersDiv.appendChild(this.baseLayersDiv), this.layersDiv.appendChild(this.dataLbl), this.layersDiv.appendChild(this.dataLayersDiv))
24140          : (this.layersDiv.appendChild(this.dataLbl), this.layersDiv.appendChild(this.dataLayersDiv), this.layersDiv.appendChild(this.baseLbl), this.layersDiv.appendChild(this.baseLayersDiv));
24141      this.div.appendChild(this.layersDiv);
24142      var a = OpenLayers.Util.getImageLocation("layer-switcher-maximize.png");
24143      this.maximizeDiv = OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv", null, null, a, "absolute");
24144      OpenLayers.Element.addClass(this.maximizeDiv, "maximizeDiv olButton");
24145      this.maximizeDiv.style.display = "none";
24146      this.div.appendChild(this.maximizeDiv);
24147      a = OpenLayers.Util.getImageLocation("layer-switcher-minimize.png");
24148      this.minimizeDiv = OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv", null, null, a, "absolute");
24149      OpenLayers.Element.addClass(this.minimizeDiv, "minimizeDiv olButton");
24150      this.minimizeDiv.style.display = "none";
24151      this.div.appendChild(this.minimizeDiv);
24152  },
24153  CLASS_NAME: "OpenLayers.Control.LayerSwitcher",
24154});
24155OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
24156  namespaces: { atom: "http://www.w3.org/2005/Atom", georss: "http://www.georss.org/georss" },
24157  feedTitle: "untitled",
24158  defaultEntryTitle: "untitled",
24159  gmlParser: null,
24160  xy: !1,
24161  read: function (a) {
24162      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
24163      return this.parseFeatures(a);
24164  },
24165  write: function (a) {
24166      var b;
24167      if (OpenLayers.Util.isArray(a)) {
24168          b = this.createElementNSPlus("atom:feed");
24169          b.appendChild(this.createElementNSPlus("atom:title", { value: this.feedTitle }));
24170          for (var c = 0, d = a.length; c < d; c++) b.appendChild(this.buildEntryNode(a[c]));
24171      } else b = this.buildEntryNode(a);
24172      return OpenLayers.Format.XML.prototype.write.apply(this, [b]);
24173  },
24174  buildContentNode: function (a) {
24175      var b = this.createElementNSPlus("atom:content", { attributes: { type: a.type || null } });
24176      if (a.src) b.setAttribute("src", a.src);
24177      else if ("text" == a.type || null == a.type) b.appendChild(this.createTextNode(a.value));
24178      else if ("html" == a.type) {
24179          if ("string" != typeof a.value) throw "HTML content must be in form of an escaped string";
24180          b.appendChild(this.createTextNode(a.value));
24181      } else "xhtml" == a.type ? b.appendChild(a.value) : "xhtml" == a.type || a.type.match(/(\+|\/)xml$/) ? b.appendChild(a.value) : b.appendChild(this.createTextNode(a.value));
24182      return b;
24183  },
24184  buildEntryNode: function (a) {
24185      var b = a.attributes,
24186          c = b.atom || {},
24187          d = this.createElementNSPlus("atom:entry");
24188      if (c.authors) for (var e = OpenLayers.Util.isArray(c.authors) ? c.authors : [c.authors], f = 0, g = e.length; f < g; f++) d.appendChild(this.buildPersonConstructNode("author", e[f]));
24189      if (c.categories)
24190          for (var e = OpenLayers.Util.isArray(c.categories) ? c.categories : [c.categories], h, f = 0, g = e.length; f < g; f++)
24191              (h = e[f]), d.appendChild(this.createElementNSPlus("atom:category", { attributes: { term: h.term, scheme: h.scheme || null, label: h.label || null } }));
24192      c.content && d.appendChild(this.buildContentNode(c.content));
24193      if (c.contributors) for (e = OpenLayers.Util.isArray(c.contributors) ? c.contributors : [c.contributors], f = 0, g = e.length; f < g; f++) d.appendChild(this.buildPersonConstructNode("contributor", e[f]));
24194      a.fid && d.appendChild(this.createElementNSPlus("atom:id", { value: a.fid }));
24195      if (c.links)
24196          for (e = OpenLayers.Util.isArray(c.links) ? c.links : [c.links], f = 0, g = e.length; f < g; f++)
24197              (h = e[f]), d.appendChild(this.createElementNSPlus("atom:link", { attributes: { href: h.href, rel: h.rel || null, type: h.type || null, hreflang: h.hreflang || null, title: h.title || null, length: h.length || null } }));
24198      c.published && d.appendChild(this.createElementNSPlus("atom:published", { value: c.published }));
24199      c.rights && d.appendChild(this.createElementNSPlus("atom:rights", { value: c.rights }));
24200      (c.summary || b.description) && d.appendChild(this.createElementNSPlus("atom:summary", { value: c.summary || b.description }));
24201      d.appendChild(this.createElementNSPlus("atom:title", { value: c.title || b.title || this.defaultEntryTitle }));
24202      c.updated && d.appendChild(this.createElementNSPlus("atom:updated", { value: c.updated }));
24203      a.geometry && ((b = this.createElementNSPlus("georss:where")), b.appendChild(this.buildGeometryNode(a.geometry)), d.appendChild(b));
24204      return d;
24205  },
24206  initGmlParser: function () {
24207      this.gmlParser = new OpenLayers.Format.GML.v3({ xy: this.xy, featureNS: "http://example.com#feature", internalProjection: this.internalProjection, externalProjection: this.externalProjection });
24208  },
24209  buildGeometryNode: function (a) {
24210      this.gmlParser || this.initGmlParser();
24211      return this.gmlParser.writeNode("feature:_geometry", a).firstChild;
24212  },
24213  buildPersonConstructNode: function (a, b) {
24214      var c = ["uri", "email"],
24215          d = this.createElementNSPlus("atom:" + a);
24216      d.appendChild(this.createElementNSPlus("atom:name", { value: b.name }));
24217      for (var e = 0, f = c.length; e < f; e++) b[c[e]] && d.appendChild(this.createElementNSPlus("atom:" + c[e], { value: b[c[e]] }));
24218      return d;
24219  },
24220  getFirstChildValue: function (a, b, c, d) {
24221      return (a = this.getElementsByTagNameNS(a, b, c)) && 0 < a.length ? this.getChildValue(a[0], d) : d;
24222  },
24223  parseFeature: function (a) {
24224      var b = {},
24225          c = null,
24226          d = null,
24227          e = null,
24228          f = this.namespaces.atom;
24229      this.parsePersonConstructs(a, "author", b);
24230      d = this.getElementsByTagNameNS(a, f, "category");
24231      0 < d.length && (b.categories = []);
24232      for (var g = 0, h = d.length; g < h; g++) {
24233          c = {};
24234          c.term = d[g].getAttribute("term");
24235          if ((e = d[g].getAttribute("scheme"))) c.scheme = e;
24236          if ((e = d[g].getAttribute("label"))) c.label = e;
24237          b.categories.push(c);
24238      }
24239      d = this.getElementsByTagNameNS(a, f, "content");
24240      if (0 < d.length) {
24241          c = {};
24242          if ((e = d[0].getAttribute("type"))) c.type = e;
24243          (e = d[0].getAttribute("src"))
24244              ? (c.src = e)
24245              : ("text" == c.type || "html" == c.type || null == c.type
24246                    ? (c.value = this.getFirstChildValue(a, f, "content", null))
24247                    : "xhtml" == c.type || c.type.match(/(\+|\/)xml$/)
24248                    ? (c.value = this.getChildEl(d[0]))
24249                    : (c.value = this.getFirstChildValue(a, f, "content", null)),
24250                (b.content = c));
24251      }
24252      this.parsePersonConstructs(a, "contributor", b);
24253      b.id = this.getFirstChildValue(a, f, "id", null);
24254      d = this.getElementsByTagNameNS(a, f, "link");
24255      0 < d.length && (b.links = Array(d.length));
24256      for (var k = ["rel", "type", "hreflang", "title", "length"], g = 0, h = d.length; g < h; g++) {
24257          c = {};
24258          c.href = d[g].getAttribute("href");
24259          for (var l = 0, m = k.length; l < m; l++) (e = d[g].getAttribute(k[l])) && (c[k[l]] = e);
24260          b.links[g] = c;
24261      }
24262      if ((c = this.getFirstChildValue(a, f, "published", null))) b.published = c;
24263      if ((c = this.getFirstChildValue(a, f, "rights", null))) b.rights = c;
24264      if ((c = this.getFirstChildValue(a, f, "summary", null))) b.summary = c;
24265      b.title = this.getFirstChildValue(a, f, "title", null);
24266      b.updated = this.getFirstChildValue(a, f, "updated", null);
24267      c = { title: b.title, description: b.summary, atom: b };
24268      a = this.parseLocations(a)[0];
24269      a = new OpenLayers.Feature.Vector(a, c);
24270      a.fid = b.id;
24271      return a;
24272  },
24273  parseFeatures: function (a) {
24274      var b = [],
24275          c = this.getElementsByTagNameNS(a, this.namespaces.atom, "entry");
24276      0 == c.length && (c = [a]);
24277      a = 0;
24278      for (var d = c.length; a < d; a++) b.push(this.parseFeature(c[a]));
24279      return b;
24280  },
24281  parseLocations: function (a) {
24282      var b = this.namespaces.georss,
24283          c = { components: [] },
24284          d = this.getElementsByTagNameNS(a, b, "where");
24285      if (d && 0 < d.length) {
24286          this.gmlParser || this.initGmlParser();
24287          for (var e = 0, f = d.length; e < f; e++) this.gmlParser.readChildNodes(d[e], c);
24288      }
24289      c = c.components;
24290      if ((d = this.getElementsByTagNameNS(a, b, "point")) && 0 < d.length)
24291          for (e = 0, f = d.length; e < f; e++) {
24292              var g = OpenLayers.String.trim(d[e].firstChild.nodeValue).split(/\s+/);
24293              2 != g.length && (g = OpenLayers.String.trim(d[e].firstChild.nodeValue).split(/\s*,\s*/));
24294              c.push(new OpenLayers.Geometry.Point(g[1], g[0]));
24295          }
24296      var h = this.getElementsByTagNameNS(a, b, "line");
24297      if (h && 0 < h.length)
24298          for (var k, e = 0, f = h.length; e < f; e++) {
24299              d = OpenLayers.String.trim(h[e].firstChild.nodeValue).split(/\s+/);
24300              k = [];
24301              for (var l = 0, m = d.length; l < m; l += 2) (g = new OpenLayers.Geometry.Point(d[l + 1], d[l])), k.push(g);
24302              c.push(new OpenLayers.Geometry.LineString(k));
24303          }
24304      if ((a = this.getElementsByTagNameNS(a, b, "polygon")) && 0 < a.length)
24305          for (e = 0, f = a.length; e < f; e++) {
24306              d = OpenLayers.String.trim(a[e].firstChild.nodeValue).split(/\s+/);
24307              k = [];
24308              l = 0;
24309              for (m = d.length; l < m; l += 2) (g = new OpenLayers.Geometry.Point(d[l + 1], d[l])), k.push(g);
24310              c.push(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(k)]));
24311          }
24312      if (this.internalProjection && this.externalProjection) for (e = 0, f = c.length; e < f; e++) c[e] && c[e].transform(this.externalProjection, this.internalProjection);
24313      return c;
24314  },
24315  parsePersonConstructs: function (a, b, c) {
24316      var d = [],
24317          e = this.namespaces.atom;
24318      a = this.getElementsByTagNameNS(a, e, b);
24319      for (var f = ["uri", "email"], g = 0, h = a.length; g < h; g++) {
24320          var k = {};
24321          k.name = this.getFirstChildValue(a[g], e, "name", null);
24322          for (var l = 0, m = f.length; l < m; l++) {
24323              var n = this.getFirstChildValue(a[g], e, f[l], null);
24324              n && (k[f[l]] = n);
24325          }
24326          d.push(k);
24327      }
24328      0 < d.length && (c[b + "s"] = d);
24329  },
24330  CLASS_NAME: "OpenLayers.Format.Atom",
24331});
24332OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
24333  autoActivate: !0,
24334  slideFactor: 75,
24335  observeElement: null,
24336  draw: function () {
24337      this.handler = new OpenLayers.Handler.Keyboard(this, { key
24337down: this.defaultKeyPress }, { observeElement: this.observeElement || document });
24338  },
24339  defaultKeyPress: function (a) {
24340      var b,
24341          c = !0;
24342      b = OpenLayers.Event.element(a);
24343      if (!b || ("INPUT" != b.tagName && "TEXTAREA" != b.tagName && "SELECT" != b.tagName)) {
24344          switch (a.keyCode) {
24345              case OpenLayers.Event.KEY_LEFT:
24346                  this.map.pan(-this.slideFactor, 0);
24347                  break;
24348              case OpenLayers.Event.KEY_RIGHT:
24349                  this.map.pan(this.slideFactor, 0);
24350                  break;
24351              case OpenLayers.Event.KEY_UP:
24352                  this.map.pan(0, -this.slideFactor);
24353                  break;
24354              case OpenLayers.Event.KEY_DOWN:
24355                  this.map.pan(0, this.slideFactor);
24356                  break;
24357              case 33:
24358                  b = this.map.getSize();
24359                  this.map.pan(0, -0.75 * b.h);
24360                  break;
24361              case 34:
24362                  b = this.map.getSize();
24363                  this.map.pan(0, 0.75 * b.h);
24364                  break;
24365              case 35:
24366                  b = this.map.getSize();
24367                  this.map.pan(0.75 * b.w, 0);
24368                  break;
24369              case 36:
24370                  b = this.map.getSize();
24371                  this.map.pan(-0.75 * b.w, 0);
24372                  break;
24373              case 43:
24374              case 61:
24375              case 187:
24376              case 107:
24377                  this.map.zoomIn();
24378                  break;
24379              case 45:
24380              case 109:
24381              case 189:
24382              case 95:
24383                  this.map.zoomOut();
24384                  break;
24385              default:
24386                  c = !1;
24387          }
24388          c && OpenLayers.Event.stop(a);
24389      }
24390  },
24391  CLASS_NAME: "OpenLayers.Control.KeyboardDefaults",
24392});
24393OpenLayers.Format.WMTSCapabilities.v1_0_0 = OpenLayers.Class(OpenLayers.Format.OWSCommon.v1_1_0, {
24394  version: "1.0.0",
24395  namespaces: { ows: "http://www.opengis.net/ows/1.1", wmts: "http://www.opengis.net/wmts/1.0", xlink: "http://www.w3.org/1999/xlink" },
24396  yx: null,
24397  defaultPrefix: "wmts",
24398  initialize: function (a) {
24399      OpenLayers.Format.XML.prototype.initialize.apply(this, [a]);
24400      this.options = a;
24401      a = OpenLayers.Util.extend({}, OpenLayers.Format.WMTSCapabilities.prototype.yx);
24402      this.yx = OpenLayers.Util.extend(a, this.yx);
24403  },
24404  read: function (a) {
24405      "string" == typeof a && (a = OpenLayers.Format.XML.prototype.read.apply(this, [a]));
24406      a && 9 == a.nodeType && (a = a.documentElement);
24407      var b = {};
24408      this.readNode(a, b);
24409      b.version = this.version;
24410      return b;
24411  },
24412  readers: {
24413      wmts: {
24414          Capabilities: function (a, b) {
24415              this.readChildNodes(a, b);
24416          },
24417          Contents: function (a, b) {
24418              b.contents = {};
24419              b.contents.layers = [];
24420              b.contents.tileMatrixSets = {};
24421              this.readChildNodes(a, b.contents);
24422          },
24423          Layer: function (a, b) {
24424              var c = { styles: [], formats: [], dimensions: [], tileMatrixSetLinks: [], layers: [] };
24425              this.readChildNodes(a, c);
24426              b.layers.push(c);
24427          },
24428          Style: function (a, b) {
24429              var c = {};
24430              c.isDefault = "true" === a.getAttribute("isDefault");
24431              this.readChildNodes(a, c);
24432              b.styles.push(c);
24433          },
24434          Format: function (a, b) {
24435              b.formats.push(this.getChildValue(a));
24436          },
24437          TileMatrixSetLink: function (a, b) {
24438              var c = {};
24439              this.readChildNodes(a, c);
24440              b.tileMatrixSetLinks.push(c);
24441          },
24442          TileMatrixSet: function (a, b) {
24443              if (b.layers) {
24444                  var c = { matrixIds: [] };
24445                  this.readChildNodes(a, c);
24446                  b.tileMatrixSets[c.identifier] = c;
24447              } else b.tileMatrixSet = this.getChildValue(a);
24448          },
24449          TileMatrix: function (a, b) {
24450              var c = { supportedCRS: b.supportedCRS };
24451              this.readChildNodes(a, c);
24452              b.matrixIds.push(c);
24453          },
24454          ScaleDenominator: function (a, b) {
24455              b.scaleDenominator = parseFloat(this.getChildValue(a));
24456          },
24457          TopLeftCorner: function (a, b) {
24458              var c = this.getChildValue(a).split(" "),
24459                  d;
24460              b.supportedCRS && ((d = b.supportedCRS.replace(/urn:og
24460c:def:crs:(\w+):.+:(\w+)$/, "urn:ogc:def:crs:$1::$2")), (d = !!this.yx[d]));
24461              b.topLeftCorner = d ? new OpenLayers.LonLat(c[1], c[0]) : new OpenLayers.LonLat(c[0], c[1]);
24462          },
24463          TileWidth: function (a, b) {
24464              b.tileWidth = parseInt(this.getChildValue(a));
24465          },
24466          TileHeight: function (a, b) {
24467              b.tileHeight = parseInt(this.getChildValue(a));
24468          },
24469          MatrixWidth: function (a, b) {
24470              b.matrixWidth = parseInt(this.getChildValue(a));
24471          },
24472          MatrixHeight: function (a, b) {
24473              b.matrixHeight = parseInt(this.getChildValue(a));
24474          },
24475          ResourceURL: function (a, b) {
24476              b.resourceUrl = b.resourceUrl || {};
24477              var c = a.getAttribute("resourceType");
24478              b.resourceUrls || (b.resourceUrls = []);
24479              c = b.resourceUrl[c] = { format: a.getAttribute("format"), template: a.getAttribute("template"), resourceType: c };
24480              b.resourceUrls.push(c);
24481          },
24482          WSDL: function (a, b) {
24483              b.wsdl = {};
24484              b.wsdl.href = a.getAttribute("xlink:href");
24485          },
24486          ServiceMetadataURL: function (a, b) {
24487              b.serviceMetadataUrl = {};
24488              b.serviceMetadataUrl.href = a.getAttribute("xlink:href");
24489          },
24490          LegendURL: function (a, b) {
24491              b.legend = {};
24492              b.legend.href = a.getAttribute("xlink:href");
24493              b.legend.format = a.getAttribute("format");
24494          },
24495          Dimension: function (a, b) {
24496              var c = { values: [] };
24497              this.readChildNodes(a, c);
24498              b.dimensions.push(c);
24499          },
24500          Default: function (a, b) {
24501              b["default"] = this.getChildValue(a);
24502          },
24503          Value: function (a, b) {
24504              b.values.push(this.getChildValue(a));
24505          },
24506      },
24507      ows: OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows,
24508  },
24509  CLASS_NAME: "OpenLayers.Format.WMTSCapabilities.v1_0_0",
24510});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.