--- /srv/rebuilderd/tmp/rebuilderd0uoXMA/inputs/libjs-openlayers_2.13.1+ds2-11_all.deb
+++ /srv/rebuilderd/tmp/rebuilderd0uoXMA/out/libjs-openlayers_2.13.1+ds2-11_all.deb
├── file list
│ @@ -1,3 +1,3 @@
│ -rw-r--r-- 0 0 0 4 2025-03-06 18:35:30.000000 debian-binary
│ -rw-r--r-- 0 0 0 3684 2025-03-06 18:35:30.000000 control.tar.xz
│ --rw-r--r-- 0 0 0 710500 2025-03-06 18:35:30.000000 data.tar.xz
│ +-rw-r--r-- 0 0 0 717360 2025-03-06 18:35:30.000000 data.tar.xz
├── control.tar.xz
│ ├── control.tar
│ │ ├── ./md5sums
│ │ │ ├── ./md5sums
│ │ │ │┄ Files differ
├── data.tar.xz
│ ├── data.tar
│ │ ├── ./usr/share/javascript/openlayers/OpenLayers.js
│ │ │ ├── js-beautify {}
│ │ │ │ @@ -52,37 +52,14 @@
│ │ │ │ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
│ │ │ │ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
│ │ │ │ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
│ │ │ │ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
│ │ │ │ * POSSIBILITY OF SUCH DAMAGE.
│ │ │ │ */
│ │ │ │ /* ======================================================================
│ │ │ │ - Rico/license.js
│ │ │ │ - ====================================================================== */
│ │ │ │ -
│ │ │ │ -/**
│ │ │ │ - * @license Apache 2
│ │ │ │ - *
│ │ │ │ - * Contains portions of Rico
│ │ │ │ - *
│ │ │ │ - * Copyright 2005 Sabre Airline Solutions
│ │ │ │ - *
│ │ │ │ - * Licensed under the Apache License, Version 2.0 (the "License"); you
│ │ │ │ - * may not use this file except in compliance with the License. You
│ │ │ │ - * may obtain a copy of the License at
│ │ │ │ - *
│ │ │ │ - * http://www.apache.org/licenses/LICENSE-2.0
│ │ │ │ - *
│ │ │ │ - * Unless required by applicable law or agreed to in writing, software
│ │ │ │ - * distributed under the License is distributed on an "AS IS" BASIS,
│ │ │ │ - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
│ │ │ │ - * implied. See the License for the specific language governing
│ │ │ │ - * permissions and limitations under the License.
│ │ │ │ - */
│ │ │ │ -/* ======================================================================
│ │ │ │ OpenLayers/SingleFile.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │ @@ -540,14 +517,37 @@
│ │ │ │ OpenLayers.Util.extend(OpenLayers.Console, console);
│ │ │ │ break;
│ │ │ │ }
│ │ │ │ }
│ │ │ │ }
│ │ │ │ })();
│ │ │ │ /* ======================================================================
│ │ │ │ + Rico/license.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @license Apache 2
│ │ │ │ + *
│ │ │ │ + * Contains portions of Rico
│ │ │ │ + *
│ │ │ │ + * Copyright 2005 Sabre Airline Solutions
│ │ │ │ + *
│ │ │ │ + * Licensed under the Apache License, Version 2.0 (the "License"); you
│ │ │ │ + * may not use this file except in compliance with the License. You
│ │ │ │ + * may obtain a copy of the License at
│ │ │ │ + *
│ │ │ │ + * http://www.apache.org/licenses/LICENSE-2.0
│ │ │ │ + *
│ │ │ │ + * Unless required by applicable law or agreed to in writing, software
│ │ │ │ + * distributed under the License is distributed on an "AS IS" BASIS,
│ │ │ │ + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
│ │ │ │ + * implied. See the License for the specific language governing
│ │ │ │ + * permissions and limitations under the License.
│ │ │ │ + */
│ │ │ │ +/* ======================================================================
│ │ │ │ OpenLayers/BaseTypes.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │ @@ -5083,14 +5083,697 @@
│ │ │ │ return this._hasString(this.options.corners, "all", "bottom", "bl", "br");
│ │ │ │ },
│ │ │ │ _hasSingleTextChild: function(el) {
│ │ │ │ return el.childNodes.length == 1 && el.childNodes[0].nodeType == 3;
│ │ │ │ }
│ │ │ │ };
│ │ │ │ /* ======================================================================
│ │ │ │ + OpenLayers/Spherical.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/SingleFile.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Namespace: Spherical
│ │ │ │ + * The OpenLayers.Spherical namespace includes utility functions for
│ │ │ │ + * calculations on the basis of a spherical earth (ignoring ellipsoidal
│ │ │ │ + * effects), which is accurate enough for most purposes.
│ │ │ │ + *
│ │ │ │ + * Relevant links:
│ │ │ │ + * * http://www.movable-type.co.uk/scripts/latlong.html
│ │ │ │ + * * http://code.google.com/apis/maps/documentation/javascript/reference.html#spherical
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +OpenLayers.Spherical = OpenLayers.Spherical || {};
│ │ │ │ +
│ │ │ │ +OpenLayers.Spherical.DEFAULT_RADIUS = 6378137;
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * APIFunction: computeDistanceBetween
│ │ │ │ + * Computes the distance between two LonLats.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * from - {} or {Object} Starting point. A LonLat or
│ │ │ │ + * a JavaScript literal with lon lat properties.
│ │ │ │ + * to - {} or {Object} Ending point. A LonLat or a
│ │ │ │ + * JavaScript literal with lon lat properties.
│ │ │ │ + * radius - {Float} The radius. Optional. Defaults to 6378137 meters.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float} The distance in meters.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Spherical.computeDistanceBetween = function(from, to, radius) {
│ │ │ │ + var R = radius || OpenLayers.Spherical.DEFAULT_RADIUS;
│ │ │ │ + var sinHalfDeltaLon = Math.sin(Math.PI * (to.lon - from.lon) / 360);
│ │ │ │ + var sinHalfDeltaLat = Math.sin(Math.PI * (to.lat - from.lat) / 360);
│ │ │ │ + var a = sinHalfDeltaLat * sinHalfDeltaLat +
│ │ │ │ + sinHalfDeltaLon * sinHalfDeltaLon * Math.cos(Math.PI * from.lat / 180) * Math.cos(Math.PI * to.lat / 180);
│ │ │ │ + return 2 * R * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
│ │ │ │ +};
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * APIFunction: computeHeading
│ │ │ │ + * Computes the heading from one LonLat to another LonLat.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * from - {} or {Object} Starting point. A LonLat or
│ │ │ │ + * a JavaScript literal with lon lat properties.
│ │ │ │ + * to - {} or {Object} Ending point. A LonLat or a
│ │ │ │ + * JavaScript literal with lon lat properties.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float} The heading in degrees.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Spherical.computeHeading = function(from, to) {
│ │ │ │ + var y = Math.sin(Math.PI * (from.lon - to.lon) / 180) * Math.cos(Math.PI * to.lat / 180);
│ │ │ │ + var x = Math.cos(Math.PI * from.lat / 180) * Math.sin(Math.PI * to.lat / 180) -
│ │ │ │ + Math.sin(Math.PI * from.lat / 180) * Math.cos(Math.PI * to.lat / 180) * Math.cos(Math.PI * (from.lon - to.lon) / 180);
│ │ │ │ + return 180 * Math.atan2(y, x) / Math.PI;
│ │ │ │ +};
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Util/vendorPrefix.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/SingleFile.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +OpenLayers.Util = OpenLayers.Util || {};
│ │ │ │ +/**
│ │ │ │ + * Namespace: OpenLayers.Util.vendorPrefix
│ │ │ │ + * A collection of utility functions to detect vendor prefixed features
│ │ │ │ + */
│ │ │ │ +OpenLayers.Util.vendorPrefix = (function() {
│ │ │ │ + "use strict";
│ │ │ │ +
│ │ │ │ + var VENDOR_PREFIXES = ["", "O", "ms", "Moz", "Webkit"],
│ │ │ │ + divStyle = document.createElement("div").style,
│ │ │ │ + cssCache = {},
│ │ │ │ + jsCache = {};
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: domToCss
│ │ │ │ + * Converts a upper camel case DOM style property name to a CSS property
│ │ │ │ + * i.e. transformOrigin -> transform-origin
│ │ │ │ + * or WebkitTransformOrigin -> -webkit-transform-origin
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * prefixedDom - {String} The property to convert
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {String} The CSS property
│ │ │ │ + */
│ │ │ │ + function domToCss(prefixedDom) {
│ │ │ │ + if (!prefixedDom) {
│ │ │ │ + return null;
│ │ │ │ + }
│ │ │ │ + return prefixedDom.
│ │ │ │ + replace(/([A-Z])/g, function(c) {
│ │ │ │ + return "-" + c.toLowerCase();
│ │ │ │ + }).
│ │ │ │ + replace(/^ms-/, "-ms-");
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: css
│ │ │ │ + * Detect which property is used for a CSS property
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * property - {String} The standard (unprefixed) CSS property name
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {String} The standard CSS property, prefixed property or null if not
│ │ │ │ + * supported
│ │ │ │ + */
│ │ │ │ + function css(property) {
│ │ │ │ + if (cssCache[property] === undefined) {
│ │ │ │ + var domProperty = property.
│ │ │ │ + replace(/(-[\s\S])/g, function(c) {
│ │ │ │ + return c.charAt(1).toUpperCase();
│ │ │ │ + });
│ │ │ │ + var prefixedDom = style(domProperty);
│ │ │ │ + cssCache[property] = domToCss(prefixedDom);
│ │ │ │ + }
│ │ │ │ + return cssCache[property];
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: js
│ │ │ │ + * Detect which property is used for a JS property/method
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * obj - {Object} The object to test on
│ │ │ │ + * property - {String} The standard (unprefixed) JS property name
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {String} The standard JS property, prefixed property or null if not
│ │ │ │ + * supported
│ │ │ │ + */
│ │ │ │ + function js(obj, property) {
│ │ │ │ + if (jsCache[property] === undefined) {
│ │ │ │ + var tmpProp,
│ │ │ │ + i = 0,
│ │ │ │ + l = VENDOR_PREFIXES.length,
│ │ │ │ + prefix,
│ │ │ │ + isStyleObj = (typeof obj.cssText !== "undefined");
│ │ │ │ +
│ │ │ │ + jsCache[property] = null;
│ │ │ │ + for (; i < l; i++) {
│ │ │ │ + prefix = VENDOR_PREFIXES[i];
│ │ │ │ + if (prefix) {
│ │ │ │ + if (!isStyleObj) {
│ │ │ │ + // js prefix should be lower-case, while style
│ │ │ │ + // properties have upper case on first character
│ │ │ │ + prefix = prefix.toLowerCase();
│ │ │ │ + }
│ │ │ │ + tmpProp = prefix + property.charAt(0).toUpperCase() + property.slice(1);
│ │ │ │ + } else {
│ │ │ │ + tmpProp = property;
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + if (obj[tmpProp] !== undefined) {
│ │ │ │ + jsCache[property] = tmpProp;
│ │ │ │ + break;
│ │ │ │ + }
│ │ │ │ + }
│ │ │ │ + }
│ │ │ │ + return jsCache[property];
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: style
│ │ │ │ + * Detect which property is used for a DOM style property
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * property - {String} The standard (unprefixed) style property name
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {String} The standard style property, prefixed property or null if not
│ │ │ │ + * supported
│ │ │ │ + */
│ │ │ │ + function style(property) {
│ │ │ │ + return js(divStyle, property);
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + return {
│ │ │ │ + css: css,
│ │ │ │ + js: js,
│ │ │ │ + style: style,
│ │ │ │ +
│ │ │ │ + // used for testing
│ │ │ │ + cssCache: cssCache,
│ │ │ │ + jsCache: jsCache
│ │ │ │ + };
│ │ │ │ +}());
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Animation.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/SingleFile.js
│ │ │ │ + * @requires OpenLayers/Util/vendorPrefix.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Namespace: OpenLayers.Animation
│ │ │ │ + * A collection of utility functions for executing methods that repaint a
│ │ │ │ + * portion of the browser window. These methods take advantage of the
│ │ │ │ + * browser's scheduled repaints where requestAnimationFrame is available.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Animation = (function(window) {
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: isNative
│ │ │ │ + * {Boolean} true if a native requestAnimationFrame function is available
│ │ │ │ + */
│ │ │ │ + var requestAnimationFrame = OpenLayers.Util.vendorPrefix.js(window, "requestAnimationFrame");
│ │ │ │ + var isNative = !!(requestAnimationFrame);
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: requestFrame
│ │ │ │ + * Schedule a function to be called at the next available animation frame.
│ │ │ │ + * Uses the native method where available. Where requestAnimationFrame is
│ │ │ │ + * not available, setTimeout will be called with a 16ms delay.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * callback - {Function} The function to be called at the next animation frame.
│ │ │ │ + * element - {DOMElement} Optional element that visually bounds the animation.
│ │ │ │ + */
│ │ │ │ + var requestFrame = (function() {
│ │ │ │ + var request = window[requestAnimationFrame] ||
│ │ │ │ + function(callback, element) {
│ │ │ │ + window.setTimeout(callback, 16);
│ │ │ │ + };
│ │ │ │ + // bind to window to avoid illegal invocation of native function
│ │ │ │ + return function(callback, element) {
│ │ │ │ + request.apply(window, [callback, element]);
│ │ │ │ + };
│ │ │ │ + })();
│ │ │ │ +
│ │ │ │ + // private variables for animation loops
│ │ │ │ + var counter = 0;
│ │ │ │ + var loops = {};
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: start
│ │ │ │ + * Executes a method with in series for some
│ │ │ │ + * duration.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * callback - {Function} The function to be called at the next animation frame.
│ │ │ │ + * duration - {Number} Optional duration for the loop. If not provided, the
│ │ │ │ + * animation loop will execute indefinitely.
│ │ │ │ + * element - {DOMElement} Optional element that visually bounds the animation.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Number} Identifier for the animation loop. Used to stop animations with
│ │ │ │ + * .
│ │ │ │ + */
│ │ │ │ + function start(callback, duration, element) {
│ │ │ │ + duration = duration > 0 ? duration : Number.POSITIVE_INFINITY;
│ │ │ │ + var id = ++counter;
│ │ │ │ + var start = +new Date;
│ │ │ │ + loops[id] = function() {
│ │ │ │ + if (loops[id] && +new Date - start <= duration) {
│ │ │ │ + callback();
│ │ │ │ + if (loops[id]) {
│ │ │ │ + requestFrame(loops[id], element);
│ │ │ │ + }
│ │ │ │ + } else {
│ │ │ │ + delete loops[id];
│ │ │ │ + }
│ │ │ │ + };
│ │ │ │ + requestFrame(loops[id], element);
│ │ │ │ + return id;
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: stop
│ │ │ │ + * Terminates an animation loop started with .
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * id - {Number} Identifier returned from .
│ │ │ │ + */
│ │ │ │ + function stop(id) {
│ │ │ │ + delete loops[id];
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + return {
│ │ │ │ + isNative: isNative,
│ │ │ │ + requestFrame: requestFrame,
│ │ │ │ + start: start,
│ │ │ │ + stop: stop
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ +})(window);
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Tween.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ + * @requires OpenLayers/Animation.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Namespace: OpenLayers.Tween
│ │ │ │ + */
│ │ │ │ +OpenLayers.Tween = OpenLayers.Class({
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: easing
│ │ │ │ + * {(Function)} Easing equation used for the animation
│ │ │ │ + * Defaultly set to OpenLayers.Easing.Expo.easeOut
│ │ │ │ + */
│ │ │ │ + easing: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: begin
│ │ │ │ + * {Object} Values to start the animation with
│ │ │ │ + */
│ │ │ │ + begin: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: finish
│ │ │ │ + * {Object} Values to finish the animation with
│ │ │ │ + */
│ │ │ │ + finish: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: duration
│ │ │ │ + * {int} duration of the tween (number of steps)
│ │ │ │ + */
│ │ │ │ + duration: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: callbacks
│ │ │ │ + * {Object} An object with start, eachStep and done properties whose values
│ │ │ │ + * are functions to be call during the animation. They are passed the
│ │ │ │ + * current computed value as argument.
│ │ │ │ + */
│ │ │ │ + callbacks: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: time
│ │ │ │ + * {int} Step counter
│ │ │ │ + */
│ │ │ │ + time: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: minFrameRate
│ │ │ │ + * {Number} The minimum framerate for animations in frames per second. After
│ │ │ │ + * each step, the time spent in the animation is compared to the calculated
│ │ │ │ + * time at this frame rate. If the animation runs longer than the calculated
│ │ │ │ + * time, the next step is skipped. Default is 30.
│ │ │ │ + */
│ │ │ │ + minFrameRate: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: startTime
│ │ │ │ + * {Number} The timestamp of the first execution step. Used for skipping
│ │ │ │ + * frames
│ │ │ │ + */
│ │ │ │ + startTime: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: animationId
│ │ │ │ + * {int} Loop id returned by OpenLayers.Animation.start
│ │ │ │ + */
│ │ │ │ + animationId: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: playing
│ │ │ │ + * {Boolean} Tells if the easing is currently playing
│ │ │ │ + */
│ │ │ │ + playing: false,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Tween
│ │ │ │ + * Creates a Tween.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * easing - {(Function)} easing function method to use
│ │ │ │ + */
│ │ │ │ + initialize: function(easing) {
│ │ │ │ + this.easing = (easing) ? easing : OpenLayers.Easing.Expo.easeOut;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: start
│ │ │ │ + * Plays the Tween, and calls the callback method on each step
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * begin - {Object} values to start the animation with
│ │ │ │ + * finish - {Object} values to finish the animation with
│ │ │ │ + * duration - {int} duration of the tween (number of steps)
│ │ │ │ + * options - {Object} hash of options (callbacks (start, eachStep, done),
│ │ │ │ + * minFrameRate)
│ │ │ │ + */
│ │ │ │ + start: function(begin, finish, duration, options) {
│ │ │ │ + this.playing = true;
│ │ │ │ + this.begin = begin;
│ │ │ │ + this.finish = finish;
│ │ │ │ + this.duration = duration;
│ │ │ │ + this.callbacks = options.callbacks;
│ │ │ │ + this.minFrameRate = options.minFrameRate || 30;
│ │ │ │ + this.time = 0;
│ │ │ │ + this.startTime = new Date().getTime();
│ │ │ │ + OpenLayers.Animation.stop(this.animationId);
│ │ │ │ + this.animationId = null;
│ │ │ │ + if (this.callbacks && this.callbacks.start) {
│ │ │ │ + this.callbacks.start.call(this, this.begin);
│ │ │ │ + }
│ │ │ │ + this.animationId = OpenLayers.Animation.start(
│ │ │ │ + OpenLayers.Function.bind(this.play, this)
│ │ │ │ + );
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: stop
│ │ │ │ + * Stops the Tween, and calls the done callback
│ │ │ │ + * Doesn't do anything if animation is already finished
│ │ │ │ + */
│ │ │ │ + stop: function() {
│ │ │ │ + if (!this.playing) {
│ │ │ │ + return;
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + if (this.callbacks && this.callbacks.done) {
│ │ │ │ + this.callbacks.done.call(this, this.finish);
│ │ │ │ + }
│ │ │ │ + OpenLayers.Animation.stop(this.animationId);
│ │ │ │ + this.animationId = null;
│ │ │ │ + this.playing = false;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: play
│ │ │ │ + * Calls the appropriate easing method
│ │ │ │ + */
│ │ │ │ + play: function() {
│ │ │ │ + var value = {};
│ │ │ │ + for (var i in this.begin) {
│ │ │ │ + var b = this.begin[i];
│ │ │ │ + var f = this.finish[i];
│ │ │ │ + if (b == null || f == null || isNaN(b) || isNaN(f)) {
│ │ │ │ + throw new TypeError('invalid value for Tween');
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + var c = f - b;
│ │ │ │ + value[i] = this.easing.apply(this, [this.time, b, c, this.duration]);
│ │ │ │ + }
│ │ │ │ + this.time++;
│ │ │ │ +
│ │ │ │ + if (this.callbacks && this.callbacks.eachStep) {
│ │ │ │ + // skip frames if frame rate drops below threshold
│ │ │ │ + if ((new Date().getTime() - this.startTime) / this.time <= 1000 / this.minFrameRate) {
│ │ │ │ + this.callbacks.eachStep.call(this, value);
│ │ │ │ + }
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + if (this.time > this.duration) {
│ │ │ │ + this.stop();
│ │ │ │ + }
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Create empty functions for all easing methods.
│ │ │ │ + */
│ │ │ │ + CLASS_NAME: "OpenLayers.Tween"
│ │ │ │ +});
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Namespace: OpenLayers.Easing
│ │ │ │ + *
│ │ │ │ + * Credits:
│ │ │ │ + * Easing Equations by Robert Penner,
│ │ │ │ + */
│ │ │ │ +OpenLayers.Easing = {
│ │ │ │ + /**
│ │ │ │ + * Create empty functions for all easing methods.
│ │ │ │ + */
│ │ │ │ + CLASS_NAME: "OpenLayers.Easing"
│ │ │ │ +};
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Namespace: OpenLayers.Easing.Linear
│ │ │ │ + */
│ │ │ │ +OpenLayers.Easing.Linear = {
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeIn
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeIn: function(t, b, c, d) {
│ │ │ │ + return c * t / d + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeOut
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeOut: function(t, b, c, d) {
│ │ │ │ + return c * t / d + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeInOut
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeInOut: function(t, b, c, d) {
│ │ │ │ + return c * t / d + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + CLASS_NAME: "OpenLayers.Easing.Linear"
│ │ │ │ +};
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Namespace: OpenLayers.Easing.Expo
│ │ │ │ + */
│ │ │ │ +OpenLayers.Easing.Expo = {
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeIn
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeIn: function(t, b, c, d) {
│ │ │ │ + return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeOut
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeOut: function(t, b, c, d) {
│ │ │ │ + return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeInOut
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeInOut: function(t, b, c, d) {
│ │ │ │ + if (t == 0) return b;
│ │ │ │ + if (t == d) return b + c;
│ │ │ │ + if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
│ │ │ │ + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + CLASS_NAME: "OpenLayers.Easing.Expo"
│ │ │ │ +};
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Namespace: OpenLayers.Easing.Quad
│ │ │ │ + */
│ │ │ │ +OpenLayers.Easing.Quad = {
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeIn
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeIn: function(t, b, c, d) {
│ │ │ │ + return c * (t /= d) * t + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeOut
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeOut: function(t, b, c, d) {
│ │ │ │ + return -c * (t /= d) * (t - 2) + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Function: easeInOut
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * t - {Float} time
│ │ │ │ + * b - {Float} beginning position
│ │ │ │ + * c - {Float} total change
│ │ │ │ + * d - {Float} duration of the transition
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float}
│ │ │ │ + */
│ │ │ │ + easeInOut: function(t, b, c, d) {
│ │ │ │ + if ((t /= d / 2) < 1) return c / 2 * t * t + b;
│ │ │ │ + return -c / 2 * ((--t) * (t - 2) - 1) + b;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + CLASS_NAME: "OpenLayers.Easing.Quad"
│ │ │ │ +};
│ │ │ │ +/* ======================================================================
│ │ │ │ OpenLayers/Feature.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │ @@ -6279,14 +6962,432 @@
│ │ │ │ * {Array} prefixes of the sld symbolizers. These are the
│ │ │ │ * same as the main geometry types
│ │ │ │ */
│ │ │ │ OpenLayers.Style.SYMBOLIZER_PREFIXES = ['Point', 'Line', 'Polygon', 'Text',
│ │ │ │ 'Raster'
│ │ │ │ ];
│ │ │ │ /* ======================================================================
│ │ │ │ + OpenLayers/StyleMap.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ + * @requires OpenLayers/Style.js
│ │ │ │ + * @requires OpenLayers/Feature/Vector.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Class: OpenLayers.StyleMap
│ │ │ │ + */
│ │ │ │ +OpenLayers.StyleMap = OpenLayers.Class({
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: styles
│ │ │ │ + * {Object} Hash of {}, keyed by names of well known
│ │ │ │ + * rendering intents (e.g. "default", "temporary", "select", "delete").
│ │ │ │ + */
│ │ │ │ + styles: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: extendDefault
│ │ │ │ + * {Boolean} if true, every render intent will extend the symbolizers
│ │ │ │ + * specified for the "default" intent at rendering time. Otherwise, every
│ │ │ │ + * rendering intent will be treated as a completely independent style.
│ │ │ │ + */
│ │ │ │ + extendDefault: true,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.StyleMap
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * style - {Object} Optional. Either a style hash, or a style object, or
│ │ │ │ + * a hash of style objects (style hashes) keyed by rendering
│ │ │ │ + * intent. If just one style hash or style object is passed,
│ │ │ │ + * this will be used for all known render intents (default,
│ │ │ │ + * select, temporary)
│ │ │ │ + * options - {Object} optional hash of additional options for this
│ │ │ │ + * instance
│ │ │ │ + */
│ │ │ │ + initialize: function(style, options) {
│ │ │ │ + this.styles = {
│ │ │ │ + "default": new OpenLayers.Style(
│ │ │ │ + OpenLayers.Feature.Vector.style["default"]),
│ │ │ │ + "select": new OpenLayers.Style(
│ │ │ │ + OpenLayers.Feature.Vector.style["select"]),
│ │ │ │ + "temporary": new OpenLayers.Style(
│ │ │ │ + OpenLayers.Feature.Vector.style["temporary"]),
│ │ │ │ + "delete": new OpenLayers.Style(
│ │ │ │ + OpenLayers.Feature.Vector.style["delete"])
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + // take whatever the user passed as style parameter and convert it
│ │ │ │ + // into parts of stylemap.
│ │ │ │ + if (style instanceof OpenLayers.Style) {
│ │ │ │ + // user passed a style object
│ │ │ │ + this.styles["default"] = style;
│ │ │ │ + this.styles["select"] = style;
│ │ │ │ + this.styles["temporary"] = style;
│ │ │ │ + this.styles["delete"] = style;
│ │ │ │ + } else if (typeof style == "object") {
│ │ │ │ + for (var key in style) {
│ │ │ │ + if (style[key] instanceof OpenLayers.Style) {
│ │ │ │ + // user passed a hash of style objects
│ │ │ │ + this.styles[key] = style[key];
│ │ │ │ + } else if (typeof style[key] == "object") {
│ │ │ │ + // user passsed a hash of style hashes
│ │ │ │ + this.styles[key] = new OpenLayers.Style(style[key]);
│ │ │ │ + } else {
│ │ │ │ + // user passed a style hash (i.e. symbolizer)
│ │ │ │ + this.styles["default"] = new OpenLayers.Style(style);
│ │ │ │ + this.styles["select"] = new OpenLayers.Style(style);
│ │ │ │ + this.styles["temporary"] = new OpenLayers.Style(style);
│ │ │ │ + this.styles["delete"] = new OpenLayers.Style(style);
│ │ │ │ + break;
│ │ │ │ + }
│ │ │ │ + }
│ │ │ │ + }
│ │ │ │ + OpenLayers.Util.extend(this, options);
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: destroy
│ │ │ │ + */
│ │ │ │ + destroy: function() {
│ │ │ │ + for (var key in this.styles) {
│ │ │ │ + this.styles[key].destroy();
│ │ │ │ + }
│ │ │ │ + this.styles = null;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: createSymbolizer
│ │ │ │ + * Creates the symbolizer for a feature for a render intent.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * feature - {} The feature to evaluate the rules
│ │ │ │ + * of the intended style against.
│ │ │ │ + * intent - {String} The intent determines the symbolizer that will be
│ │ │ │ + * used to draw the feature. Well known intents are "default"
│ │ │ │ + * (for just drawing the features), "select" (for selected
│ │ │ │ + * features) and "temporary" (for drawing features).
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Object} symbolizer hash
│ │ │ │ + */
│ │ │ │ + createSymbolizer: function(feature, intent) {
│ │ │ │ + if (!feature) {
│ │ │ │ + feature = new OpenLayers.Feature.Vector();
│ │ │ │ + }
│ │ │ │ + if (!this.styles[intent]) {
│ │ │ │ + intent = "default";
│ │ │ │ + }
│ │ │ │ + feature.renderIntent = intent;
│ │ │ │ + var defaultSymbolizer = {};
│ │ │ │ + if (this.extendDefault && intent != "default") {
│ │ │ │ + defaultSymbolizer = this.styles["default"].createSymbolizer(feature);
│ │ │ │ + }
│ │ │ │ + return OpenLayers.Util.extend(defaultSymbolizer,
│ │ │ │ + this.styles[intent].createSymbolizer(feature));
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: addUniqueValueRules
│ │ │ │ + * Convenience method to create comparison rules for unique values of a
│ │ │ │ + * property. The rules will be added to the style object for a specified
│ │ │ │ + * rendering intent. This method is a shortcut for creating something like
│ │ │ │ + * the "unique value legends" familiar from well known desktop GIS systems
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * renderIntent - {String} rendering intent to add the rules to
│ │ │ │ + * property - {String} values of feature attributes to create the
│ │ │ │ + * rules for
│ │ │ │ + * symbolizers - {Object} Hash of symbolizers, keyed by the desired
│ │ │ │ + * property values
│ │ │ │ + * context - {Object} An optional object with properties that
│ │ │ │ + * symbolizers' property values should be evaluated
│ │ │ │ + * against. If no context is specified, feature.attributes
│ │ │ │ + * will be used
│ │ │ │ + */
│ │ │ │ + addUniqueValueRules: function(renderIntent, property, symbolizers, context) {
│ │ │ │ + var rules = [];
│ │ │ │ + for (var value in symbolizers) {
│ │ │ │ + rules.push(new OpenLayers.Rule({
│ │ │ │ + symbolizer: symbolizers[value],
│ │ │ │ + context: context,
│ │ │ │ + filter: new OpenLayers.Filter.Comparison({
│ │ │ │ + type: OpenLayers.Filter.Comparison.EQUAL_TO,
│ │ │ │ + property: property,
│ │ │ │ + value: value
│ │ │ │ + })
│ │ │ │ + }));
│ │ │ │ + }
│ │ │ │ + this.styles[renderIntent].addRules(rules);
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + CLASS_NAME: "OpenLayers.StyleMap"
│ │ │ │ +});
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Icon.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Class: OpenLayers.Icon
│ │ │ │ + *
│ │ │ │ + * The icon represents a graphical icon on the screen. Typically used in
│ │ │ │ + * conjunction with a to represent markers on a screen.
│ │ │ │ + *
│ │ │ │ + * An icon has a url, size and position. It also contains an offset which
│ │ │ │ + * allows the center point to be represented correctly. This can be
│ │ │ │ + * provided either as a fixed offset or a function provided to calculate
│ │ │ │ + * the desired offset.
│ │ │ │ + *
│ │ │ │ + */
│ │ │ │ +OpenLayers.Icon = OpenLayers.Class({
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: url
│ │ │ │ + * {String} image url
│ │ │ │ + */
│ │ │ │ + url: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: size
│ │ │ │ + * {|Object} An OpenLayers.Size or
│ │ │ │ + * an object with a 'w' and 'h' properties.
│ │ │ │ + */
│ │ │ │ + size: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: offset
│ │ │ │ + * {|Object} distance in pixels to offset the
│ │ │ │ + * image when being rendered. An OpenLayers.Pixel or an object
│ │ │ │ + * with a 'x' and 'y' properties.
│ │ │ │ + */
│ │ │ │ + offset: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: calculateOffset
│ │ │ │ + * {Function} Function to calculate the offset (based on the size)
│ │ │ │ + */
│ │ │ │ + calculateOffset: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: imageDiv
│ │ │ │ + * {DOMElement}
│ │ │ │ + */
│ │ │ │ + imageDiv: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: px
│ │ │ │ + * {|Object} An OpenLayers.Pixel or an object
│ │ │ │ + * with a 'x' and 'y' properties.
│ │ │ │ + */
│ │ │ │ + px: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Icon
│ │ │ │ + * Creates an icon, which is an image tag in a div.
│ │ │ │ + *
│ │ │ │ + * url - {String}
│ │ │ │ + * size - {|Object} An OpenLayers.Size or an
│ │ │ │ + * object with a 'w' and 'h'
│ │ │ │ + * properties.
│ │ │ │ + * offset - {|Object} An OpenLayers.Pixel or an
│ │ │ │ + * object with a 'x' and 'y'
│ │ │ │ + * properties.
│ │ │ │ + * calculateOffset - {Function}
│ │ │ │ + */
│ │ │ │ + initialize: function(url, size, offset, calculateOffset) {
│ │ │ │ + this.url = url;
│ │ │ │ + this.size = size || {
│ │ │ │ + w: 20,
│ │ │ │ + h: 20
│ │ │ │ + };
│ │ │ │ + this.offset = offset || {
│ │ │ │ + x: -(this.size.w / 2),
│ │ │ │ + y: -(this.size.h / 2)
│ │ │ │ + };
│ │ │ │ + this.calculateOffset = calculateOffset;
│ │ │ │ +
│ │ │ │ + var id = OpenLayers.Util.createUniqueID("OL_Icon_");
│ │ │ │ + this.imageDiv = OpenLayers.Util.createAlphaImageDiv(id);
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: destroy
│ │ │ │ + * Nullify references and remove event listeners to prevent circular
│ │ │ │ + * references and memory leaks
│ │ │ │ + */
│ │ │ │ + destroy: function() {
│ │ │ │ + // erase any drawn elements
│ │ │ │ + this.erase();
│ │ │ │ +
│ │ │ │ + OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);
│ │ │ │ + this.imageDiv.innerHTML = "";
│ │ │ │ + this.imageDiv = null;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: clone
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {} A fresh copy of the icon.
│ │ │ │ + */
│ │ │ │ + clone: function() {
│ │ │ │ + return new OpenLayers.Icon(this.url,
│ │ │ │ + this.size,
│ │ │ │ + this.offset,
│ │ │ │ + this.calculateOffset);
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: setSize
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * size - {|Object} An OpenLayers.Size or
│ │ │ │ + * an object with a 'w' and 'h' properties.
│ │ │ │ + */
│ │ │ │ + setSize: function(size) {
│ │ │ │ + if (size != null) {
│ │ │ │ + this.size = size;
│ │ │ │ + }
│ │ │ │ + this.draw();
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: setUrl
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * url - {String}
│ │ │ │ + */
│ │ │ │ + setUrl: function(url) {
│ │ │ │ + if (url != null) {
│ │ │ │ + this.url = url;
│ │ │ │ + }
│ │ │ │ + this.draw();
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: draw
│ │ │ │ + * Move the div to the given pixel.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * px - {|Object} An OpenLayers.Pixel or an
│ │ │ │ + * object with a 'x' and 'y' properties.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {DOMElement} A new DOM Image of this icon set at the location passed-in
│ │ │ │ + */
│ │ │ │ + draw: function(px) {
│ │ │ │ + OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,
│ │ │ │ + null,
│ │ │ │ + null,
│ │ │ │ + this.size,
│ │ │ │ + this.url,
│ │ │ │ + "absolute");
│ │ │ │ + this.moveTo(px);
│ │ │ │ + return this.imageDiv;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: erase
│ │ │ │ + * Erase the underlying image element.
│ │ │ │ + */
│ │ │ │ + erase: function() {
│ │ │ │ + if (this.imageDiv != null && this.imageDiv.parentNode != null) {
│ │ │ │ + OpenLayers.Element.remove(this.imageDiv);
│ │ │ │ + }
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: setOpacity
│ │ │ │ + * Change the icon's opacity
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * opacity - {float}
│ │ │ │ + */
│ │ │ │ + setOpacity: function(opacity) {
│ │ │ │ + OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv, null, null, null,
│ │ │ │ + null, null, null, null, opacity);
│ │ │ │ +
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: moveTo
│ │ │ │ + * move icon to passed in px.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * px - {|Object} the pixel position to move to.
│ │ │ │ + * An OpenLayers.Pixel or an object with a 'x' and 'y' properties.
│ │ │ │ + */
│ │ │ │ + moveTo: function(px) {
│ │ │ │ + //if no px passed in, use stored location
│ │ │ │ + if (px != null) {
│ │ │ │ + this.px = px;
│ │ │ │ + }
│ │ │ │ +
│ │ │ │ + if (this.imageDiv != null) {
│ │ │ │ + if (this.px == null) {
│ │ │ │ + this.display(false);
│ │ │ │ + } else {
│ │ │ │ + if (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
│ │ │ │ + });
│ │ │ │ + }
│ │ │ │ + }
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: display
│ │ │ │ + * Hide or show the icon
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * display - {Boolean}
│ │ │ │ + */
│ │ │ │ + display: function(display) {
│ │ │ │ + this.imageDiv.style.display = (display) ? "" : "none";
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: isDrawn
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Boolean} Whether or not the icon is drawn.
│ │ │ │ + */
│ │ │ │ + isDrawn: function() {
│ │ │ │ + // nodeType 11 for ie, whose nodes *always* have a parentNode
│ │ │ │ + // (of type document fragment)
│ │ │ │ + var isDrawn = (this.imageDiv && this.imageDiv.parentNode &&
│ │ │ │ + (this.imageDiv.parentNode.nodeType != 11));
│ │ │ │ +
│ │ │ │ + return isDrawn;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + CLASS_NAME: "OpenLayers.Icon"
│ │ │ │ +});
│ │ │ │ +/* ======================================================================
│ │ │ │ OpenLayers/Rule.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │ @@ -6519,625 +7620,721 @@
│ │ │ │ options.context = this.context && OpenLayers.Util.extend({}, this.context);
│ │ │ │ return new OpenLayers.Rule(options);
│ │ │ │ },
│ │ │ │
│ │ │ │ CLASS_NAME: "OpenLayers.Rule"
│ │ │ │ });
│ │ │ │ /* ======================================================================
│ │ │ │ - OpenLayers/Util/vendorPrefix.js
│ │ │ │ + OpenLayers/Symbolizer.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * @requires OpenLayers/SingleFile.js
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ */
│ │ │ │
│ │ │ │ -OpenLayers.Util = OpenLayers.Util || {};
│ │ │ │ /**
│ │ │ │ - * Namespace: OpenLayers.Util.vendorPrefix
│ │ │ │ - * A collection of utility functions to detect vendor prefixed features
│ │ │ │ + * Class: OpenLayers.Symbolizer
│ │ │ │ + * Base class representing a symbolizer used for feature rendering.
│ │ │ │ */
│ │ │ │ -OpenLayers.Util.vendorPrefix = (function() {
│ │ │ │ - "use strict";
│ │ │ │ -
│ │ │ │ - var VENDOR_PREFIXES = ["", "O", "ms", "Moz", "Webkit"],
│ │ │ │ - divStyle = document.createElement("div").style,
│ │ │ │ - cssCache = {},
│ │ │ │ - jsCache = {};
│ │ │ │ +OpenLayers.Symbolizer = OpenLayers.Class({
│ │ │ │
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Function: domToCss
│ │ │ │ - * Converts a upper camel case DOM style property name to a CSS property
│ │ │ │ - * i.e. transformOrigin -> transform-origin
│ │ │ │ - * or WebkitTransformOrigin -> -webkit-transform-origin
│ │ │ │ - *
│ │ │ │ - * Parameters:
│ │ │ │ - * prefixedDom - {String} The property to convert
│ │ │ │ - *
│ │ │ │ - * Returns:
│ │ │ │ - * {String} The CSS property
│ │ │ │ + * APIProperty: zIndex
│ │ │ │ + * {Number} The zIndex determines the rendering order for a symbolizer.
│ │ │ │ + * Symbolizers with larger zIndex values are rendered over symbolizers
│ │ │ │ + * with smaller zIndex values. Default is 0.
│ │ │ │ */
│ │ │ │ - function domToCss(prefixedDom) {
│ │ │ │ - if (!prefixedDom) {
│ │ │ │ - return null;
│ │ │ │ - }
│ │ │ │ - return prefixedDom.
│ │ │ │ - replace(/([A-Z])/g, function(c) {
│ │ │ │ - return "-" + c.toLowerCase();
│ │ │ │ - }).
│ │ │ │ - replace(/^ms-/, "-ms-");
│ │ │ │ - }
│ │ │ │ + zIndex: 0,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIMethod: css
│ │ │ │ - * Detect which property is used for a CSS property
│ │ │ │ + * Constructor: OpenLayers.Symbolizer
│ │ │ │ + * Instances of this class are not useful. See one of the subclasses.
│ │ │ │ *
│ │ │ │ * Parameters:
│ │ │ │ - * property - {String} The standard (unprefixed) CSS property name
│ │ │ │ + * config - {Object} An object containing properties to be set on the
│ │ │ │ + * symbolizer. Any documented symbolizer property can be set at
│ │ │ │ + * construction.
│ │ │ │ *
│ │ │ │ * Returns:
│ │ │ │ - * {String} The standard CSS property, prefixed property or null if not
│ │ │ │ - * supported
│ │ │ │ + * A new symbolizer.
│ │ │ │ */
│ │ │ │ - function css(property) {
│ │ │ │ - if (cssCache[property] === undefined) {
│ │ │ │ - var domProperty = property.
│ │ │ │ - replace(/(-[\s\S])/g, function(c) {
│ │ │ │ - return c.charAt(1).toUpperCase();
│ │ │ │ - });
│ │ │ │ - var prefixedDom = style(domProperty);
│ │ │ │ - cssCache[property] = domToCss(prefixedDom);
│ │ │ │ - }
│ │ │ │ - return cssCache[property];
│ │ │ │ - }
│ │ │ │ + initialize: function(config) {
│ │ │ │ + OpenLayers.Util.extend(this, config);
│ │ │ │ + },
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * APIMethod: js
│ │ │ │ - * Detect which property is used for a JS property/method
│ │ │ │ - *
│ │ │ │ - * Parameters:
│ │ │ │ - * obj - {Object} The object to test on
│ │ │ │ - * property - {String} The standard (unprefixed) JS property name
│ │ │ │ + /**
│ │ │ │ + * APIMethod: clone
│ │ │ │ + * Create a copy of this symbolizer.
│ │ │ │ *
│ │ │ │ - * Returns:
│ │ │ │ - * {String} The standard JS property, prefixed property or null if not
│ │ │ │ - * supported
│ │ │ │ + * Returns a symbolizer of the same type with the same properties.
│ │ │ │ */
│ │ │ │ - function js(obj, property) {
│ │ │ │ - if (jsCache[property] === undefined) {
│ │ │ │ - var tmpProp,
│ │ │ │ - i = 0,
│ │ │ │ - l = VENDOR_PREFIXES.length,
│ │ │ │ - prefix,
│ │ │ │ - isStyleObj = (typeof obj.cssText !== "undefined");
│ │ │ │ -
│ │ │ │ - jsCache[property] = null;
│ │ │ │ - for (; i < l; i++) {
│ │ │ │ - prefix = VENDOR_PREFIXES[i];
│ │ │ │ - if (prefix) {
│ │ │ │ - if (!isStyleObj) {
│ │ │ │ - // js prefix should be lower-case, while style
│ │ │ │ - // properties have upper case on first character
│ │ │ │ - prefix = prefix.toLowerCase();
│ │ │ │ - }
│ │ │ │ - tmpProp = prefix + property.charAt(0).toUpperCase() + property.slice(1);
│ │ │ │ - } else {
│ │ │ │ - tmpProp = property;
│ │ │ │ - }
│ │ │ │ -
│ │ │ │ - if (obj[tmpProp] !== undefined) {
│ │ │ │ - jsCache[property] = tmpProp;
│ │ │ │ - break;
│ │ │ │ - }
│ │ │ │ - }
│ │ │ │ - }
│ │ │ │ - return jsCache[property];
│ │ │ │ - }
│ │ │ │ + clone: function() {
│ │ │ │ + var Type = eval(this.CLASS_NAME);
│ │ │ │ + return new Type(OpenLayers.Util.extend({}, this));
│ │ │ │ + },
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * APIMethod: style
│ │ │ │ - * Detect which property is used for a DOM style property
│ │ │ │ - *
│ │ │ │ - * Parameters:
│ │ │ │ - * property - {String} The standard (unprefixed) style property name
│ │ │ │ - *
│ │ │ │ - * Returns:
│ │ │ │ - * {String} The standard style property, prefixed property or null if not
│ │ │ │ - * supported
│ │ │ │ - */
│ │ │ │ - function style(property) {
│ │ │ │ - return js(divStyle, property);
│ │ │ │ - }
│ │ │ │ + CLASS_NAME: "OpenLayers.Symbolizer"
│ │ │ │
│ │ │ │ - return {
│ │ │ │ - css: css,
│ │ │ │ - js: js,
│ │ │ │ - style: style,
│ │ │ │ +});
│ │ │ │
│ │ │ │ - // used for testing
│ │ │ │ - cssCache: cssCache,
│ │ │ │ - jsCache: jsCache
│ │ │ │ - };
│ │ │ │ -}());
│ │ │ │ /* ======================================================================
│ │ │ │ - OpenLayers/Animation.js
│ │ │ │ + OpenLayers/Symbolizer/Point.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * @requires OpenLayers/SingleFile.js
│ │ │ │ - * @requires OpenLayers/Util/vendorPrefix.js
│ │ │ │ + * @requires OpenLayers/Symbolizer.js
│ │ │ │ */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Namespace: OpenLayers.Animation
│ │ │ │ - * A collection of utility functions for executing methods that repaint a
│ │ │ │ - * portion of the browser window. These methods take advantage of the
│ │ │ │ - * browser's scheduled repaints where requestAnimationFrame is available.
│ │ │ │ + * Class: OpenLayers.Symbolizer.Point
│ │ │ │ + * A symbolizer used to render point features.
│ │ │ │ */
│ │ │ │ -OpenLayers.Animation = (function(window) {
│ │ │ │ +OpenLayers.Symbolizer.Point = OpenLayers.Class(OpenLayers.Symbolizer, {
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: isNative
│ │ │ │ - * {Boolean} true if a native requestAnimationFrame function is available
│ │ │ │ + * APIProperty: strokeColor
│ │ │ │ + * {String} Color for line stroke. This is a RGB hex value (e.g. "#ff0000"
│ │ │ │ + * for red).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - var requestAnimationFrame = OpenLayers.Util.vendorPrefix.js(window, "requestAnimationFrame");
│ │ │ │ - var isNative = !!(requestAnimationFrame);
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Function: requestFrame
│ │ │ │ - * Schedule a function to be called at the next available animation frame.
│ │ │ │ - * Uses the native method where available. Where requestAnimationFrame is
│ │ │ │ - * not available, setTimeout will be called with a 16ms delay.
│ │ │ │ - *
│ │ │ │ - * Parameters:
│ │ │ │ - * callback - {Function} The function to be called at the next animation frame.
│ │ │ │ - * element - {DOMElement} Optional element that visually bounds the animation.
│ │ │ │ + * APIProperty: strokeOpacity
│ │ │ │ + * {Number} Stroke opacity (0-1).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - var requestFrame = (function() {
│ │ │ │ - var request = window[requestAnimationFrame] ||
│ │ │ │ - function(callback, element) {
│ │ │ │ - window.setTimeout(callback, 16);
│ │ │ │ - };
│ │ │ │ - // bind to window to avoid illegal invocation of native function
│ │ │ │ - return function(callback, element) {
│ │ │ │ - request.apply(window, [callback, element]);
│ │ │ │ - };
│ │ │ │ - })();
│ │ │ │
│ │ │ │ - // private variables for animation loops
│ │ │ │ - var counter = 0;
│ │ │ │ - var loops = {};
│ │ │ │ + /**
│ │ │ │ + * APIProperty: strokeWidth
│ │ │ │ + * {Number} Pixel stroke width.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Function: start
│ │ │ │ - * Executes a method with in series for some
│ │ │ │ - * duration.
│ │ │ │ - *
│ │ │ │ - * Parameters:
│ │ │ │ - * callback - {Function} The function to be called at the next animation frame.
│ │ │ │ - * duration - {Number} Optional duration for the loop. If not provided, the
│ │ │ │ - * animation loop will execute indefinitely.
│ │ │ │ - * element - {DOMElement} Optional element that visually bounds the animation.
│ │ │ │ - *
│ │ │ │ - * Returns:
│ │ │ │ - * {Number} Identifier for the animation loop. Used to stop animations with
│ │ │ │ - * .
│ │ │ │ + * APIProperty: strokeLinecap
│ │ │ │ + * {String} Stroke cap type ("butt", "round", or "square").
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - function start(callback, duration, element) {
│ │ │ │ - duration = duration > 0 ? duration : Number.POSITIVE_INFINITY;
│ │ │ │ - var id = ++counter;
│ │ │ │ - var start = +new Date;
│ │ │ │ - loops[id] = function() {
│ │ │ │ - if (loops[id] && +new Date - start <= duration) {
│ │ │ │ - callback();
│ │ │ │ - if (loops[id]) {
│ │ │ │ - requestFrame(loops[id], element);
│ │ │ │ - }
│ │ │ │ - } else {
│ │ │ │ - delete loops[id];
│ │ │ │ - }
│ │ │ │ - };
│ │ │ │ - requestFrame(loops[id], element);
│ │ │ │ - return id;
│ │ │ │ - }
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Function: stop
│ │ │ │ - * Terminates an animation loop started with .
│ │ │ │ + * Property: strokeDashstyle
│ │ │ │ + * {String} Stroke dash style according to the SLD spec. Note that the
│ │ │ │ + * OpenLayers values for strokeDashstyle ("dot", "dash", "dashdot",
│ │ │ │ + * "longdash", "longdashdot", or "solid") will not work in SLD, but
│ │ │ │ + * most SLD patterns will render correctly in OpenLayers.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: fillColor
│ │ │ │ + * {String} RGB hex fill color (e.g. "#ff0000" for red).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: fillOpacity
│ │ │ │ + * {Number} Fill opacity (0-1).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: pointRadius
│ │ │ │ + * {Number} Pixel point radius.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: externalGraphic
│ │ │ │ + * {String} Url to an external graphic that will be used for rendering
│ │ │ │ + * points.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: graphicWidth
│ │ │ │ + * {Number} Pixel width for sizing an external graphic.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: graphicHeight
│ │ │ │ + * {Number} Pixel height for sizing an external graphic.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: graphicOpacity
│ │ │ │ + * {Number} Opacity (0-1) for an external graphic.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: graphicXOffset
│ │ │ │ + * {Number} Pixel offset along the positive x axis for displacing an
│ │ │ │ + * external graphic.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: graphicYOffset
│ │ │ │ + * {Number} Pixel offset along the positive y axis for displacing an
│ │ │ │ + * external graphic.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: rotation
│ │ │ │ + * {Number} The rotation of a graphic in the clockwise direction about its
│ │ │ │ + * center point (or any point off center as specified by
│ │ │ │ + * and ).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: graphicName
│ │ │ │ + * {String} Named graphic to use when rendering points. Supported values
│ │ │ │ + * include "circle", "square", "star", "x", "cross", and "triangle".
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Symbolizer.Point
│ │ │ │ + * Create a symbolizer for rendering points.
│ │ │ │ *
│ │ │ │ * Parameters:
│ │ │ │ - * id - {Number} Identifier returned from .
│ │ │ │ + * config - {Object} An object containing properties to be set on the
│ │ │ │ + * symbolizer. Any documented symbolizer property can be set at
│ │ │ │ + * construction.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * A new point symbolizer.
│ │ │ │ */
│ │ │ │ - function stop(id) {
│ │ │ │ - delete loops[id];
│ │ │ │ - }
│ │ │ │ + initialize: function(config) {
│ │ │ │ + OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
│ │ │ │ + },
│ │ │ │
│ │ │ │ - return {
│ │ │ │ - isNative: isNative,
│ │ │ │ - requestFrame: requestFrame,
│ │ │ │ - start: start,
│ │ │ │ - stop: stop
│ │ │ │ - };
│ │ │ │ + CLASS_NAME: "OpenLayers.Symbolizer.Point"
│ │ │ │ +
│ │ │ │ +});
│ │ │ │
│ │ │ │ -})(window);
│ │ │ │ /* ======================================================================
│ │ │ │ - OpenLayers/Tween.js
│ │ │ │ + OpenLayers/Symbolizer/Line.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ - * @requires OpenLayers/Animation.js
│ │ │ │ + * @requires OpenLayers/Symbolizer.js
│ │ │ │ */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Namespace: OpenLayers.Tween
│ │ │ │ + * Class: OpenLayers.Symbolizer.Line
│ │ │ │ + * A symbolizer used to render line features.
│ │ │ │ */
│ │ │ │ -OpenLayers.Tween = OpenLayers.Class({
│ │ │ │ +OpenLayers.Symbolizer.Line = OpenLayers.Class(OpenLayers.Symbolizer, {
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: easing
│ │ │ │ - * {(Function)} Easing equation used for the animation
│ │ │ │ - * Defaultly set to OpenLayers.Easing.Expo.easeOut
│ │ │ │ + * APIProperty: strokeColor
│ │ │ │ + * {String} Color for line stroke. This is a RGB hex value (e.g. "#ff0000"
│ │ │ │ + * for red).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - easing: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: begin
│ │ │ │ - * {Object} Values to start the animation with
│ │ │ │ + * APIProperty: strokeOpacity
│ │ │ │ + * {Number} Stroke opacity (0-1).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - begin: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: finish
│ │ │ │ - * {Object} Values to finish the animation with
│ │ │ │ + * APIProperty: strokeWidth
│ │ │ │ + * {Number} Pixel stroke width.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - finish: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: duration
│ │ │ │ - * {int} duration of the tween (number of steps)
│ │ │ │ + * APIProperty: strokeLinecap
│ │ │ │ + * {String} Stroke cap type ("butt", "round", or "square").
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - duration: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: callbacks
│ │ │ │ - * {Object} An object with start, eachStep and done properties whose values
│ │ │ │ - * are functions to be call during the animation. They are passed the
│ │ │ │ - * current computed value as argument.
│ │ │ │ + * Property: strokeDashstyle
│ │ │ │ + * {String} Stroke dash style according to the SLD spec. Note that the
│ │ │ │ + * OpenLayers values for strokeDashstyle ("dot", "dash", "dashdot",
│ │ │ │ + * "longdash", "longdashdot", or "solid") will not work in SLD, but
│ │ │ │ + * most SLD patterns will render correctly in OpenLayers.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - callbacks: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: time
│ │ │ │ - * {int} Step counter
│ │ │ │ + * Constructor: OpenLayers.Symbolizer.Line
│ │ │ │ + * Create a symbolizer for rendering lines.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * config - {Object} An object containing properties to be set on the
│ │ │ │ + * symbolizer. Any documented symbolizer property can be set at
│ │ │ │ + * construction.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * A new line symbolizer.
│ │ │ │ */
│ │ │ │ - time: null,
│ │ │ │ + initialize: function(config) {
│ │ │ │ + OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + CLASS_NAME: "OpenLayers.Symbolizer.Line"
│ │ │ │ +
│ │ │ │ +});
│ │ │ │ +
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Symbolizer/Polygon.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/Symbolizer.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Class: OpenLayers.Symbolizer.Polygon
│ │ │ │ + * A symbolizer used to render line features.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Symbolizer.Polygon = OpenLayers.Class(OpenLayers.Symbolizer, {
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: minFrameRate
│ │ │ │ - * {Number} The minimum framerate for animations in frames per second. After
│ │ │ │ - * each step, the time spent in the animation is compared to the calculated
│ │ │ │ - * time at this frame rate. If the animation runs longer than the calculated
│ │ │ │ - * time, the next step is skipped. Default is 30.
│ │ │ │ + * APIProperty: strokeColor
│ │ │ │ + * {String} Color for line stroke. This is a RGB hex value (e.g. "#ff0000"
│ │ │ │ + * for red).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - minFrameRate: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: startTime
│ │ │ │ - * {Number} The timestamp of the first execution step. Used for skipping
│ │ │ │ - * frames
│ │ │ │ + * APIProperty: strokeOpacity
│ │ │ │ + * {Number} Stroke opacity (0-1).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - startTime: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: animationId
│ │ │ │ - * {int} Loop id returned by OpenLayers.Animation.start
│ │ │ │ + * APIProperty: strokeWidth
│ │ │ │ + * {Number} Pixel stroke width.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - animationId: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: playing
│ │ │ │ - * {Boolean} Tells if the easing is currently playing
│ │ │ │ + * APIProperty: strokeLinecap
│ │ │ │ + * {String} Stroke cap type ("butt", "round", or "square").
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - playing: false,
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Constructor: OpenLayers.Tween
│ │ │ │ - * Creates a Tween.
│ │ │ │ - *
│ │ │ │ - * Parameters:
│ │ │ │ - * easing - {(Function)} easing function method to use
│ │ │ │ + /**
│ │ │ │ + * Property: strokeDashstyle
│ │ │ │ + * {String} Stroke dash style according to the SLD spec. Note that the
│ │ │ │ + * OpenLayers values for strokeDashstyle ("dot", "dash", "dashdot",
│ │ │ │ + * "longdash", "longdashdot", or "solid") will not work in SLD, but
│ │ │ │ + * most SLD patterns will render correctly in OpenLayers.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - initialize: function(easing) {
│ │ │ │ - this.easing = (easing) ? easing : OpenLayers.Easing.Expo.easeOut;
│ │ │ │ - },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIMethod: start
│ │ │ │ - * Plays the Tween, and calls the callback method on each step
│ │ │ │ + * APIProperty: fillColor
│ │ │ │ + * {String} RGB hex fill color (e.g. "#ff0000" for red).
│ │ │ │ *
│ │ │ │ - * Parameters:
│ │ │ │ - * begin - {Object} values to start the animation with
│ │ │ │ - * finish - {Object} values to finish the animation with
│ │ │ │ - * duration - {int} duration of the tween (number of steps)
│ │ │ │ - * options - {Object} hash of options (callbacks (start, eachStep, done),
│ │ │ │ - * minFrameRate)
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - start: function(begin, finish, duration, options) {
│ │ │ │ - this.playing = true;
│ │ │ │ - this.begin = begin;
│ │ │ │ - this.finish = finish;
│ │ │ │ - this.duration = duration;
│ │ │ │ - this.callbacks = options.callbacks;
│ │ │ │ - this.minFrameRate = options.minFrameRate || 30;
│ │ │ │ - this.time = 0;
│ │ │ │ - this.startTime = new Date().getTime();
│ │ │ │ - OpenLayers.Animation.stop(this.animationId);
│ │ │ │ - this.animationId = null;
│ │ │ │ - if (this.callbacks && this.callbacks.start) {
│ │ │ │ - this.callbacks.start.call(this, this.begin);
│ │ │ │ - }
│ │ │ │ - this.animationId = OpenLayers.Animation.start(
│ │ │ │ - OpenLayers.Function.bind(this.play, this)
│ │ │ │ - );
│ │ │ │ - },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIMethod: stop
│ │ │ │ - * Stops the Tween, and calls the done callback
│ │ │ │ - * Doesn't do anything if animation is already finished
│ │ │ │ + * APIProperty: fillOpacity
│ │ │ │ + * {Number} Fill opacity (0-1).
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - stop: function() {
│ │ │ │ - if (!this.playing) {
│ │ │ │ - return;
│ │ │ │ - }
│ │ │ │ -
│ │ │ │ - if (this.callbacks && this.callbacks.done) {
│ │ │ │ - this.callbacks.done.call(this, this.finish);
│ │ │ │ - }
│ │ │ │ - OpenLayers.Animation.stop(this.animationId);
│ │ │ │ - this.animationId = null;
│ │ │ │ - this.playing = false;
│ │ │ │ - },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Method: play
│ │ │ │ - * Calls the appropriate easing method
│ │ │ │ + * Constructor: OpenLayers.Symbolizer.Polygon
│ │ │ │ + * Create a symbolizer for rendering polygons.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * config - {Object} An object containing properties to be set on the
│ │ │ │ + * symbolizer. Any documented symbolizer property can be set at
│ │ │ │ + * construction.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * A new polygon symbolizer.
│ │ │ │ */
│ │ │ │ - play: function() {
│ │ │ │ - var value = {};
│ │ │ │ - for (var i in this.begin) {
│ │ │ │ - var b = this.begin[i];
│ │ │ │ - var f = this.finish[i];
│ │ │ │ - if (b == null || f == null || isNaN(b) || isNaN(f)) {
│ │ │ │ - throw new TypeError('invalid value for Tween');
│ │ │ │ - }
│ │ │ │ + initialize: function(config) {
│ │ │ │ + OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
│ │ │ │ + },
│ │ │ │
│ │ │ │ - var c = f - b;
│ │ │ │ - value[i] = this.easing.apply(this, [this.time, b, c, this.duration]);
│ │ │ │ - }
│ │ │ │ - this.time++;
│ │ │ │ + CLASS_NAME: "OpenLayers.Symbolizer.Polygon"
│ │ │ │
│ │ │ │ - if (this.callbacks && this.callbacks.eachStep) {
│ │ │ │ - // skip frames if frame rate drops below threshold
│ │ │ │ - if ((new Date().getTime() - this.startTime) / this.time <= 1000 / this.minFrameRate) {
│ │ │ │ - this.callbacks.eachStep.call(this, value);
│ │ │ │ - }
│ │ │ │ - }
│ │ │ │ +});
│ │ │ │
│ │ │ │ - if (this.time > this.duration) {
│ │ │ │ - this.stop();
│ │ │ │ - }
│ │ │ │ - },
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Symbolizer/Text.js
│ │ │ │ + ====================================================================== */
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Create empty functions for all easing methods.
│ │ │ │ - */
│ │ │ │ - CLASS_NAME: "OpenLayers.Tween"
│ │ │ │ -});
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Namespace: OpenLayers.Easing
│ │ │ │ - *
│ │ │ │ - * Credits:
│ │ │ │ - * Easing Equations by Robert Penner,
│ │ │ │ + * @requires OpenLayers/Symbolizer.js
│ │ │ │ */
│ │ │ │ -OpenLayers.Easing = {
│ │ │ │ - /**
│ │ │ │ - * Create empty functions for all easing methods.
│ │ │ │ - */
│ │ │ │ - CLASS_NAME: "OpenLayers.Easing"
│ │ │ │ -};
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Namespace: OpenLayers.Easing.Linear
│ │ │ │ + * Class: OpenLayers.Symbolizer.Text
│ │ │ │ + * A symbolizer used to render text labels for features.
│ │ │ │ */
│ │ │ │ -OpenLayers.Easing.Linear = {
│ │ │ │ +OpenLayers.Symbolizer.Text = OpenLayers.Class(OpenLayers.Symbolizer, {
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Function: easeIn
│ │ │ │ + /**
│ │ │ │ + * APIProperty: label
│ │ │ │ + * {String} The text for the label.
│ │ │ │ *
│ │ │ │ - * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ - *
│ │ │ │ - * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - easeIn: function(t, b, c, d) {
│ │ │ │ - return c * t / d + b;
│ │ │ │ - },
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Function: easeOut
│ │ │ │ + /**
│ │ │ │ + * APIProperty: fontFamily
│ │ │ │ + * {String} The font family for the label.
│ │ │ │ *
│ │ │ │ - * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ - *
│ │ │ │ - * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: fontSize
│ │ │ │ + * {String} The font size for the label.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: fontWeight
│ │ │ │ + * {String} The font weight for the label.
│ │ │ │ + *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ */
│ │ │ │ - easeOut: function(t, b, c, d) {
│ │ │ │ - return c * t / d + b;
│ │ │ │ - },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Function: easeInOut
│ │ │ │ + * Property: fontStyle
│ │ │ │ + * {String} The font style for the label.
│ │ │ │ *
│ │ │ │ + * No default set here. Use OpenLayers.Renderer.defaultRenderer for defaults.
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Symbolizer.Text
│ │ │ │ + * Create a symbolizer for rendering text labels.
│ │ │ │ + *
│ │ │ │ * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ + * config - {Object} An object containing properties to be set on the
│ │ │ │ + * symbolizer. Any documented symbolizer property can be set at
│ │ │ │ + * construction.
│ │ │ │ *
│ │ │ │ * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * A new text symbolizer.
│ │ │ │ */
│ │ │ │ - easeInOut: function(t, b, c, d) {
│ │ │ │ - return c * t / d + b;
│ │ │ │ + initialize: function(config) {
│ │ │ │ + OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
│ │ │ │ },
│ │ │ │
│ │ │ │ - CLASS_NAME: "OpenLayers.Easing.Linear"
│ │ │ │ -};
│ │ │ │ + CLASS_NAME: "OpenLayers.Symbolizer.Text"
│ │ │ │ +
│ │ │ │ +});
│ │ │ │ +
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Symbolizer/Raster.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Namespace: OpenLayers.Easing.Expo
│ │ │ │ + * @requires OpenLayers/Symbolizer.js
│ │ │ │ */
│ │ │ │ -OpenLayers.Easing.Expo = {
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Class: OpenLayers.Symbolizer.Raster
│ │ │ │ + * A symbolizer used to render raster images.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Symbolizer.Raster = OpenLayers.Class(OpenLayers.Symbolizer, {
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Function: easeIn
│ │ │ │ - *
│ │ │ │ + * Constructor: OpenLayers.Symbolizer.Raster
│ │ │ │ + * Create a symbolizer for rendering rasters.
│ │ │ │ + *
│ │ │ │ * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ + * config - {Object} An object containing properties to be set on the
│ │ │ │ + * symbolizer. Any documented symbolizer property can be set at
│ │ │ │ + * construction.
│ │ │ │ *
│ │ │ │ * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * A new raster symbolizer.
│ │ │ │ */
│ │ │ │ - easeIn: function(t, b, c, d) {
│ │ │ │ - return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
│ │ │ │ + initialize: function(config) {
│ │ │ │ + OpenLayers.Symbolizer.prototype.initialize.apply(this, arguments);
│ │ │ │ },
│ │ │ │
│ │ │ │ + CLASS_NAME: "OpenLayers.Symbolizer.Raster"
│ │ │ │ +
│ │ │ │ +});
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Style2.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ + * @requires OpenLayers/Rule.js
│ │ │ │ + * @requires OpenLayers/Symbolizer/Point.js
│ │ │ │ + * @requires OpenLayers/Symbolizer/Line.js
│ │ │ │ + * @requires OpenLayers/Symbolizer/Polygon.js
│ │ │ │ + * @requires OpenLayers/Symbolizer/Text.js
│ │ │ │ + * @requires OpenLayers/Symbolizer/Raster.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Class: OpenLayers.Style2
│ │ │ │ + * This class represents a collection of rules for rendering features.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Style2 = OpenLayers.Class({
│ │ │ │ +
│ │ │ │ /**
│ │ │ │ - * Function: easeOut
│ │ │ │ - *
│ │ │ │ + * Property: id
│ │ │ │ + * {String} A unique id for this session.
│ │ │ │ + */
│ │ │ │ + id: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: name
│ │ │ │ + * {String} Style identifier.
│ │ │ │ + */
│ │ │ │ + name: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: title
│ │ │ │ + * {String} Title of this style.
│ │ │ │ + */
│ │ │ │ + title: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: description
│ │ │ │ + * {String} Description of this style.
│ │ │ │ + */
│ │ │ │ + description: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: layerName
│ │ │ │ + * {} Name of the layer that this style belongs to, usually
│ │ │ │ + * according to the NamedLayer attribute of an SLD document.
│ │ │ │ + */
│ │ │ │ + layerName: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: isDefault
│ │ │ │ + * {Boolean}
│ │ │ │ + */
│ │ │ │ + isDefault: false,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIProperty: rules
│ │ │ │ + * {Array()} Collection of rendering rules.
│ │ │ │ + */
│ │ │ │ + rules: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Style2
│ │ │ │ + * Creates a style representing a collection of rendering rules.
│ │ │ │ + *
│ │ │ │ * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ + * config - {Object} An object containing properties to be set on the
│ │ │ │ + * style. Any documented properties may be set at construction.
│ │ │ │ *
│ │ │ │ * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * {} A new style object.
│ │ │ │ */
│ │ │ │ - easeOut: function(t, b, c, d) {
│ │ │ │ - return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
│ │ │ │ + initialize: function(config) {
│ │ │ │ + OpenLayers.Util.extend(this, config);
│ │ │ │ + this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: destroy
│ │ │ │ + * nullify references to prevent circular references and memory leaks
│ │ │ │ + */
│ │ │ │ + destroy: function() {
│ │ │ │ + for (var i = 0, len = this.rules.length; i < len; i++) {
│ │ │ │ + this.rules[i].destroy();
│ │ │ │ + }
│ │ │ │ + delete this.rules;
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Function: easeInOut
│ │ │ │ + * APIMethod: clone
│ │ │ │ + * Clones this style.
│ │ │ │ *
│ │ │ │ - * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ - *
│ │ │ │ * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * {} Clone of this style.
│ │ │ │ */
│ │ │ │ - easeInOut: function(t, b, c, d) {
│ │ │ │ - if (t == 0) return b;
│ │ │ │ - if (t == d) return b + c;
│ │ │ │ - if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
│ │ │ │ - return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
│ │ │ │ + clone: function() {
│ │ │ │ + var config = OpenLayers.Util.extend({}, this);
│ │ │ │ + // clone rules
│ │ │ │ + if (this.rules) {
│ │ │ │ + config.rules = [];
│ │ │ │ + for (var i = 0, len = this.rules.length; i < len; ++i) {
│ │ │ │ + config.rules.push(this.rules[i].clone());
│ │ │ │ + }
│ │ │ │ + }
│ │ │ │ + return new OpenLayers.Style2(config);
│ │ │ │ },
│ │ │ │
│ │ │ │ - CLASS_NAME: "OpenLayers.Easing.Expo"
│ │ │ │ -};
│ │ │ │ + CLASS_NAME: "OpenLayers.Style2"
│ │ │ │ +});
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Filter.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Namespace: OpenLayers.Easing.Quad
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ + * @requires OpenLayers/Util.js
│ │ │ │ + * @requires OpenLayers/Style.js
│ │ │ │ */
│ │ │ │ -OpenLayers.Easing.Quad = {
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Function: easeIn
│ │ │ │ - *
│ │ │ │ - * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ +/**
│ │ │ │ + * Class: OpenLayers.Filter
│ │ │ │ + * This class represents an OGC Filter.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Filter = OpenLayers.Class({
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Filter
│ │ │ │ + * This class represents a generic filter.
│ │ │ │ *
│ │ │ │ + * Parameters:
│ │ │ │ + * options - {Object} Optional object whose properties will be set on the
│ │ │ │ + * instance.
│ │ │ │ + *
│ │ │ │ * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * {}
│ │ │ │ */
│ │ │ │ - easeIn: function(t, b, c, d) {
│ │ │ │ - return c * (t /= d) * t + b;
│ │ │ │ + initialize: function(options) {
│ │ │ │ + OpenLayers.Util.extend(this, options);
│ │ │ │ },
│ │ │ │
│ │ │ │ + /**
│ │ │ │ + * APIMethod: destroy
│ │ │ │ + * Remove reference to anything added.
│ │ │ │ + */
│ │ │ │ + destroy: function() {},
│ │ │ │ +
│ │ │ │ /**
│ │ │ │ - * Function: easeOut
│ │ │ │ + * APIMethod: evaluate
│ │ │ │ + * Evaluates this filter in a specific context. Instances or subclasses
│ │ │ │ + * are supposed to override this method.
│ │ │ │ *
│ │ │ │ * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ - *
│ │ │ │ + * context - {Object} Context to use in evaluating the filter. If a vector
│ │ │ │ + * feature is provided, the feature.attributes will be used as context.
│ │ │ │ + *
│ │ │ │ * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * {Boolean} The filter applies.
│ │ │ │ */
│ │ │ │ - easeOut: function(t, b, c, d) {
│ │ │ │ - return -c * (t /= d) * (t - 2) + b;
│ │ │ │ + evaluate: function(context) {
│ │ │ │ + return true;
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Function: easeInOut
│ │ │ │ + * APIMethod: clone
│ │ │ │ + * Clones this filter. Should be implemented by subclasses.
│ │ │ │ *
│ │ │ │ - * Parameters:
│ │ │ │ - * t - {Float} time
│ │ │ │ - * b - {Float} beginning position
│ │ │ │ - * c - {Float} total change
│ │ │ │ - * d - {Float} duration of the transition
│ │ │ │ + * Returns:
│ │ │ │ + * {} Clone of this filter.
│ │ │ │ + */
│ │ │ │ + clone: function() {
│ │ │ │ + return null;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: toString
│ │ │ │ *
│ │ │ │ * Returns:
│ │ │ │ - * {Float}
│ │ │ │ + * {String} Include in your build to get a CQL
│ │ │ │ + * representation of the filter returned. Otherwise "[Object object]"
│ │ │ │ + * will be returned.
│ │ │ │ */
│ │ │ │ - easeInOut: function(t, b, c, d) {
│ │ │ │ - if ((t /= d / 2) < 1) return c / 2 * t * t + b;
│ │ │ │ - return -c / 2 * ((--t) * (t - 2) - 1) + b;
│ │ │ │ + toString: function() {
│ │ │ │ + var string;
│ │ │ │ + if (OpenLayers.Format && OpenLayers.Format.CQL) {
│ │ │ │ + string = OpenLayers.Format.CQL.prototype.write(this);
│ │ │ │ + } else {
│ │ │ │ + string = Object.prototype.toString.call(this);
│ │ │ │ + }
│ │ │ │ + return string;
│ │ │ │ },
│ │ │ │
│ │ │ │ - CLASS_NAME: "OpenLayers.Easing.Quad"
│ │ │ │ -};
│ │ │ │ + CLASS_NAME: "OpenLayers.Filter"
│ │ │ │ +});
│ │ │ │ /* ======================================================================
│ │ │ │ OpenLayers/Events.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ @@ -12933,249 +14130,553 @@
│ │ │ │ }
│ │ │ │ return bounds;
│ │ │ │ },
│ │ │ │
│ │ │ │ CLASS_NAME: "OpenLayers.Layer"
│ │ │ │ });
│ │ │ │ /* ======================================================================
│ │ │ │ - OpenLayers/Layer/HTTPRequest.js
│ │ │ │ + OpenLayers/Marker.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * @requires OpenLayers/Layer.js
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ + * @requires OpenLayers/Events.js
│ │ │ │ + * @requires OpenLayers/Icon.js
│ │ │ │ */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Class: OpenLayers.Layer.HTTPRequest
│ │ │ │ - *
│ │ │ │ - * Inherits from:
│ │ │ │ - * -
│ │ │ │ + * Class: OpenLayers.Marker
│ │ │ │ + * Instances of OpenLayers.Marker are a combination of a
│ │ │ │ + * and an .
│ │ │ │ + *
│ │ │ │ + * Markers are generally added to a special layer called
│ │ │ │ + * .
│ │ │ │ + *
│ │ │ │ + * Example:
│ │ │ │ + * (code)
│ │ │ │ + * var markers = new OpenLayers.Layer.Markers( "Markers" );
│ │ │ │ + * map.addLayer(markers);
│ │ │ │ + *
│ │ │ │ + * var size = new OpenLayers.Size(21,25);
│ │ │ │ + * var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
│ │ │ │ + * var icon = new OpenLayers.Icon('http://www.openlayers.org/dev/img/marker.png', size, offset);
│ │ │ │ + * markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon));
│ │ │ │ + * markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon.clone()));
│ │ │ │ + *
│ │ │ │ + * (end)
│ │ │ │ + *
│ │ │ │ + * Note that if you pass an icon into the Marker constructor, it will take
│ │ │ │ + * that icon and use it. This means that you should not share icons between
│ │ │ │ + * markers -- you use them once, but you should clone() for any additional
│ │ │ │ + * markers using that same icon.
│ │ │ │ */
│ │ │ │ -OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
│ │ │ │ +OpenLayers.Marker = OpenLayers.Class({
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Constant: URL_HASH_FACTOR
│ │ │ │ - * {Float} Used to hash URL param strings for multi-WMS server selection.
│ │ │ │ - * Set to the Golden Ratio per Knuth's recommendation.
│ │ │ │ + * Property: icon
│ │ │ │ + * {} The icon used by this marker.
│ │ │ │ */
│ │ │ │ - URL_HASH_FACTOR: (Math.sqrt(5) - 1) / 2,
│ │ │ │ + icon: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: url
│ │ │ │ - * {Array(String) or String} This is either an array of url strings or
│ │ │ │ - * a single url string.
│ │ │ │ + * Property: lonlat
│ │ │ │ + * {} location of object
│ │ │ │ */
│ │ │ │ - url: null,
│ │ │ │ + lonlat: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: params
│ │ │ │ - * {Object} Hashtable of key/value parameters
│ │ │ │ + * Property: events
│ │ │ │ + * {} the event handler.
│ │ │ │ */
│ │ │ │ - params: null,
│ │ │ │ + events: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: reproject
│ │ │ │ - * *Deprecated*. See http://docs.openlayers.org/library/spherical_mercator.html
│ │ │ │ - * for information on the replacement for this functionality.
│ │ │ │ - * {Boolean} Whether layer should reproject itself based on base layer
│ │ │ │ - * locations. This allows reprojection onto commercial layers.
│ │ │ │ - * Default is false: Most layers can't reproject, but layers
│ │ │ │ - * which can create non-square geographic pixels can, like WMS.
│ │ │ │ - *
│ │ │ │ + * Property: map
│ │ │ │ + * {} the map this marker is attached to
│ │ │ │ */
│ │ │ │ - reproject: false,
│ │ │ │ + map: null,
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Constructor: OpenLayers.Layer.HTTPRequest
│ │ │ │ - *
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Marker
│ │ │ │ + *
│ │ │ │ * Parameters:
│ │ │ │ - * name - {String}
│ │ │ │ - * url - {Array(String) or String}
│ │ │ │ - * params - {Object}
│ │ │ │ - * options - {Object} Hashtable of extra options to tag onto the layer
│ │ │ │ + * lonlat - {} the position of this marker
│ │ │ │ + * icon - {} the icon for this marker
│ │ │ │ */
│ │ │ │ - initialize: function(name, url, params, options) {
│ │ │ │ - OpenLayers.Layer.prototype.initialize.apply(this, [name, options]);
│ │ │ │ - this.url = url;
│ │ │ │ - if (!this.params) {
│ │ │ │ - this.params = OpenLayers.Util.extend({}, params);
│ │ │ │ + initialize: function(lonlat, icon) {
│ │ │ │ + this.lonlat = lonlat;
│ │ │ │ +
│ │ │ │ + var newIcon = (icon) ? icon : OpenLayers.Marker.defaultIcon();
│ │ │ │ + if (this.icon == null) {
│ │ │ │ + this.icon = newIcon;
│ │ │ │ + } else {
│ │ │ │ + this.icon.url = newIcon.url;
│ │ │ │ + this.icon.size = newIcon.size;
│ │ │ │ + this.icon.offset = newIcon.offset;
│ │ │ │ + this.icon.calculateOffset = newIcon.calculateOffset;
│ │ │ │ }
│ │ │ │ + this.events = new OpenLayers.Events(this, this.icon.imageDiv);
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ * APIMethod: destroy
│ │ │ │ + * Destroy the marker. You must first remove the marker from any
│ │ │ │ + * layer which it has been added to, or you will get buggy behavior.
│ │ │ │ + * (This can not be done within the marker since the marker does not
│ │ │ │ + * know which layer it is attached to.)
│ │ │ │ */
│ │ │ │ destroy: function() {
│ │ │ │ - this.url = null;
│ │ │ │ - this.params = null;
│ │ │ │ - OpenLayers.Layer.prototype.destroy.apply(this, arguments);
│ │ │ │ + // erase any drawn features
│ │ │ │ + this.erase();
│ │ │ │ +
│ │ │ │ + this.map = null;
│ │ │ │ +
│ │ │ │ + this.events.destroy();
│ │ │ │ + this.events = null;
│ │ │ │ +
│ │ │ │ + if (this.icon != null) {
│ │ │ │ + this.icon.destroy();
│ │ │ │ + this.icon = null;
│ │ │ │ + }
│ │ │ │ },
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * APIMethod: clone
│ │ │ │ + /**
│ │ │ │ + * Method: draw
│ │ │ │ + * Calls draw on the icon, and returns that output.
│ │ │ │ *
│ │ │ │ * Parameters:
│ │ │ │ - * obj - {Object}
│ │ │ │ + * px - {}
│ │ │ │ *
│ │ │ │ * Returns:
│ │ │ │ - * {} An exact clone of this
│ │ │ │ - *
│ │ │ │ + * {DOMElement} A new DOM Image with this marker's icon set at the
│ │ │ │ + * location passed-in
│ │ │ │ */
│ │ │ │ - clone: function(obj) {
│ │ │ │ + draw: function(px) {
│ │ │ │ + return this.icon.draw(px);
│ │ │ │ + },
│ │ │ │
│ │ │ │ - if (obj == null) {
│ │ │ │ - obj = new OpenLayers.Layer.HTTPRequest(this.name,
│ │ │ │ - this.url,
│ │ │ │ - this.params,
│ │ │ │ - this.getOptions());
│ │ │ │ + /**
│ │ │ │ + * Method: erase
│ │ │ │ + * Erases any drawn elements for this marker.
│ │ │ │ + */
│ │ │ │ + erase: function() {
│ │ │ │ + if (this.icon != null) {
│ │ │ │ + this.icon.erase();
│ │ │ │ }
│ │ │ │ + },
│ │ │ │
│ │ │ │ - //get all additions from superclasses
│ │ │ │ - obj = OpenLayers.Layer.prototype.clone.apply(this, [obj]);
│ │ │ │ + /**
│ │ │ │ + * Method: moveTo
│ │ │ │ + * Move the marker to the new location.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * px - {|Object} the pixel position to move to.
│ │ │ │ + * An OpenLayers.Pixel or an object with a 'x' and 'y' properties.
│ │ │ │ + */
│ │ │ │ + moveTo: function(px) {
│ │ │ │ + if ((px != null) && (this.icon != null)) {
│ │ │ │ + this.icon.moveTo(px);
│ │ │ │ + }
│ │ │ │ + this.lonlat = this.map.getLonLatFromLayerPx(px);
│ │ │ │ + },
│ │ │ │
│ │ │ │ - // copy/set any non-init, non-simple values here
│ │ │ │ + /**
│ │ │ │ + * APIMethod: isDrawn
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Boolean} Whether or not the marker is drawn.
│ │ │ │ + */
│ │ │ │ + isDrawn: function() {
│ │ │ │ + var isDrawn = (this.icon && this.icon.isDrawn());
│ │ │ │ + return isDrawn;
│ │ │ │ + },
│ │ │ │
│ │ │ │ - return obj;
│ │ │ │ + /**
│ │ │ │ + * Method: onScreen
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Boolean} Whether or not the marker is currently visible on screen.
│ │ │ │ + */
│ │ │ │ + onScreen: function() {
│ │ │ │ +
│ │ │ │ + var onScreen = false;
│ │ │ │ + if (this.map) {
│ │ │ │ + var screenBounds = this.map.getExtent();
│ │ │ │ + onScreen = screenBounds.containsLonLat(this.lonlat);
│ │ │ │ + }
│ │ │ │ + return onScreen;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: inflate
│ │ │ │ + * Englarges the markers icon by the specified ratio.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * inflate - {float} the ratio to enlarge the marker by (passing 2
│ │ │ │ + * will double the size).
│ │ │ │ + */
│ │ │ │ + inflate: function(inflate) {
│ │ │ │ + if (this.icon) {
│ │ │ │ + this.icon.setSize({
│ │ │ │ + w: this.icon.size.w * inflate,
│ │ │ │ + h: this.icon.size.h * inflate
│ │ │ │ + });
│ │ │ │ + }
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIMethod: setUrl
│ │ │ │ + * Method: setOpacity
│ │ │ │ + * Change the opacity of the marker by changin the opacity of
│ │ │ │ + * its icon
│ │ │ │ *
│ │ │ │ * Parameters:
│ │ │ │ - * newUrl - {String}
│ │ │ │ + * opacity - {float} Specified as fraction (0.4, etc)
│ │ │ │ */
│ │ │ │ - setUrl: function(newUrl) {
│ │ │ │ - this.url = newUrl;
│ │ │ │ + setOpacity: function(opacity) {
│ │ │ │ + this.icon.setOpacity(opacity);
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIMethod: mergeNewParams
│ │ │ │ + * Method: setUrl
│ │ │ │ + * Change URL of the Icon Image.
│ │ │ │ + *
│ │ │ │ + * url - {String}
│ │ │ │ + */
│ │ │ │ + setUrl: function(url) {
│ │ │ │ + this.icon.setUrl(url);
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: display
│ │ │ │ + * Hide or show the icon
│ │ │ │ *
│ │ │ │ + * display - {Boolean}
│ │ │ │ + */
│ │ │ │ + display: function(display) {
│ │ │ │ + this.icon.display(display);
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + CLASS_NAME: "OpenLayers.Marker"
│ │ │ │ +});
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Function: defaultIcon
│ │ │ │ + * Creates a default .
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {} A default OpenLayers.Icon to use for a marker
│ │ │ │ + */
│ │ │ │ +OpenLayers.Marker.defaultIcon = function() {
│ │ │ │ + return new OpenLayers.Icon(OpenLayers.Util.getImageLocation("marker.png"), {
│ │ │ │ + w: 21,
│ │ │ │ + h: 25
│ │ │ │ + }, {
│ │ │ │ + x: -10.5,
│ │ │ │ + y: -25
│ │ │ │ + });
│ │ │ │ +};
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +/* ======================================================================
│ │ │ │ + OpenLayers/Protocol.js
│ │ │ │ + ====================================================================== */
│ │ │ │ +
│ │ │ │ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ + * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ + * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ + * full text of the license. */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ + */
│ │ │ │ +
│ │ │ │ +/**
│ │ │ │ + * Class: OpenLayers.Protocol
│ │ │ │ + * Abstract vector layer protocol class. Not to be instantiated directly. Use
│ │ │ │ + * one of the protocol subclasses instead.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Protocol = OpenLayers.Class({
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: format
│ │ │ │ + * {} The format used by this protocol.
│ │ │ │ + */
│ │ │ │ + format: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: options
│ │ │ │ + * {Object} Any options sent to the constructor.
│ │ │ │ + */
│ │ │ │ + options: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: autoDestroy
│ │ │ │ + * {Boolean} The creator of the protocol can set autoDestroy to false
│ │ │ │ + * to fully control when the protocol is destroyed. Defaults to
│ │ │ │ + * true.
│ │ │ │ + */
│ │ │ │ + autoDestroy: true,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: defaultFilter
│ │ │ │ + * {} Optional default filter to read requests
│ │ │ │ + */
│ │ │ │ + defaultFilter: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Protocol
│ │ │ │ + * Abstract class for vector protocols. Create instances of a subclass.
│ │ │ │ + *
│ │ │ │ * Parameters:
│ │ │ │ - * newParams - {Object}
│ │ │ │ + * options - {Object} Optional object whose properties will be set on the
│ │ │ │ + * instance.
│ │ │ │ + */
│ │ │ │ + initialize: function(options) {
│ │ │ │ + options = options || {};
│ │ │ │ + OpenLayers.Util.extend(this, options);
│ │ │ │ + this.options = options;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Method: mergeWithDefaultFilter
│ │ │ │ + * Merge filter passed to the read method with the default one
│ │ │ │ *
│ │ │ │ - * Returns:
│ │ │ │ - * redrawn: {Boolean} whether the layer was actually redrawn.
│ │ │ │ + * Parameters:
│ │ │ │ + * filter - {}
│ │ │ │ */
│ │ │ │ - mergeNewParams: function(newParams) {
│ │ │ │ - this.params = OpenLayers.Util.extend(this.params, newParams);
│ │ │ │ - var ret = this.redraw();
│ │ │ │ - if (this.map != null) {
│ │ │ │ - this.map.events.triggerEvent("changelayer", {
│ │ │ │ - layer: this,
│ │ │ │ - property: "params"
│ │ │ │ + mergeWithDefaultFilter: function(filter) {
│ │ │ │ + var merged;
│ │ │ │ + if (filter && this.defaultFilter) {
│ │ │ │ + merged = new OpenLayers.Filter.Logical({
│ │ │ │ + type: OpenLayers.Filter.Logical.AND,
│ │ │ │ + filters: [this.defaultFilter, filter]
│ │ │ │ });
│ │ │ │ + } else {
│ │ │ │ + merged = filter || this.defaultFilter || undefined;
│ │ │ │ }
│ │ │ │ - return ret;
│ │ │ │ + return merged;
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIMethod: redraw
│ │ │ │ - * Redraws the layer. Returns true if the layer was redrawn, false if not.
│ │ │ │ + * APIMethod: destroy
│ │ │ │ + * Clean up the protocol.
│ │ │ │ + */
│ │ │ │ + destroy: function() {
│ │ │ │ + this.options = null;
│ │ │ │ + this.format = null;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: read
│ │ │ │ + * Construct a request for reading new features.
│ │ │ │ *
│ │ │ │ * Parameters:
│ │ │ │ - * force - {Boolean} Force redraw by adding random parameter.
│ │ │ │ + * options - {Object} Optional object for configuring the request.
│ │ │ │ *
│ │ │ │ * Returns:
│ │ │ │ - * {Boolean} The layer was redrawn.
│ │ │ │ + * {} An
│ │ │ │ + * object, the same object will be passed to the callback function passed
│ │ │ │ + * if one exists in the options object.
│ │ │ │ */
│ │ │ │ - redraw: function(force) {
│ │ │ │ - if (force) {
│ │ │ │ - return this.mergeNewParams({
│ │ │ │ - "_olSalt": Math.random()
│ │ │ │ - });
│ │ │ │ - } else {
│ │ │ │ - return OpenLayers.Layer.prototype.redraw.apply(this, []);
│ │ │ │ - }
│ │ │ │ + read: function(options) {
│ │ │ │ + options = options || {};
│ │ │ │ + options.filter = this.mergeWithDefaultFilter(options.filter);
│ │ │ │ },
│ │ │ │
│ │ │ │ +
│ │ │ │ /**
│ │ │ │ - * Method: selectUrl
│ │ │ │ - * selectUrl() implements the standard floating-point multiplicative
│ │ │ │ - * hash function described by Knuth, and hashes the contents of the
│ │ │ │ - * given param string into a float between 0 and 1. This float is then
│ │ │ │ - * scaled to the size of the provided urls array, and used to select
│ │ │ │ - * a URL.
│ │ │ │ + * APIMethod: create
│ │ │ │ + * Construct a request for writing newly created features.
│ │ │ │ *
│ │ │ │ * Parameters:
│ │ │ │ - * paramString - {String}
│ │ │ │ - * urls - {Array(String)}
│ │ │ │ - *
│ │ │ │ + * features - {Array({})} or
│ │ │ │ + * {}
│ │ │ │ + * options - {Object} Optional object for configuring the request.
│ │ │ │ + *
│ │ │ │ * Returns:
│ │ │ │ - * {String} An entry from the urls array, deterministically selected based
│ │ │ │ - * on the paramString.
│ │ │ │ + * {} An
│ │ │ │ + * object, the same object will be passed to the callback function passed
│ │ │ │ + * if one exists in the options object.
│ │ │ │ */
│ │ │ │ - selectUrl: function(paramString, urls) {
│ │ │ │ - var product = 1;
│ │ │ │ - for (var i = 0, len = paramString.length; i < len; i++) {
│ │ │ │ - product *= paramString.charCodeAt(i) * this.URL_HASH_FACTOR;
│ │ │ │ - product -= Math.floor(product);
│ │ │ │ - }
│ │ │ │ - return urls[Math.floor(product * urls.length)];
│ │ │ │ - },
│ │ │ │ + create: function() {},
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Method: getFullRequestString
│ │ │ │ - * Combine url with layer's params and these newParams.
│ │ │ │ - *
│ │ │ │ - * does checking on the serverPath variable, allowing for cases when it
│ │ │ │ - * is supplied with trailing ? or &, as well as cases where not.
│ │ │ │ + /**
│ │ │ │ + * APIMethod: update
│ │ │ │ + * Construct a request updating modified features.
│ │ │ │ *
│ │ │ │ - * return in formatted string like this:
│ │ │ │ - * "server?key1=value1&key2=value2&key3=value3"
│ │ │ │ - *
│ │ │ │ - * WARNING: The altUrl parameter is deprecated and will be removed in 3.0.
│ │ │ │ + * Parameters:
│ │ │ │ + * features - {Array({})} or
│ │ │ │ + * {}
│ │ │ │ + * options - {Object} Optional object for configuring the request.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {} An
│ │ │ │ + * object, the same object will be passed to the callback function passed
│ │ │ │ + * if one exists in the options object.
│ │ │ │ + */
│ │ │ │ + update: function() {},
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * APIMethod: delete
│ │ │ │ + * Construct a request deleting a removed feature.
│ │ │ │ *
│ │ │ │ * Parameters:
│ │ │ │ - * newParams - {Object}
│ │ │ │ - * altUrl - {String} Use this as the url instead of the layer's url
│ │ │ │ - *
│ │ │ │ - * Returns:
│ │ │ │ - * {String}
│ │ │ │ + * feature - {}
│ │ │ │ + * options - {Object} Optional object for configuring the request.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {} An
│ │ │ │ + * object, the same object will be passed to the callback function passed
│ │ │ │ + * if one exists in the options object.
│ │ │ │ */
│ │ │ │ - getFullRequestString: function(newParams, altUrl) {
│ │ │ │ + "delete": function() {},
│ │ │ │
│ │ │ │ - // if not altUrl passed in, use layer's url
│ │ │ │ - var url = altUrl || this.url;
│ │ │ │ + /**
│ │ │ │ + * APIMethod: commit
│ │ │ │ + * Go over the features and for each take action
│ │ │ │ + * based on the feature state. Possible actions are create,
│ │ │ │ + * update and delete.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * features - {Array({})}
│ │ │ │ + * options - {Object} Object whose possible keys are "create", "update",
│ │ │ │ + * "delete", "callback" and "scope", the values referenced by the
│ │ │ │ + * first three are objects as passed to the "create", "update", and
│ │ │ │ + * "delete" methods, the value referenced by the "callback" key is
│ │ │ │ + * a function which is called when the commit operation is complete
│ │ │ │ + * using the scope referenced by the "scope" key.
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Array({})} An array of
│ │ │ │ + * objects.
│ │ │ │ + */
│ │ │ │ + commit: function() {},
│ │ │ │
│ │ │ │ - // create a new params hashtable with all the layer params and the
│ │ │ │ - // new params together. then convert to string
│ │ │ │ - var allParams = OpenLayers.Util.extend({}, this.params);
│ │ │ │ - allParams = OpenLayers.Util.extend(allParams, newParams);
│ │ │ │ - var paramsString = OpenLayers.Util.getParameterString(allParams);
│ │ │ │ + /**
│ │ │ │ + * Method: abort
│ │ │ │ + * Abort an ongoing request.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * response - {}
│ │ │ │ + */
│ │ │ │ + abort: function(response) {},
│ │ │ │
│ │ │ │ - // if url is not a string, it should be an array of strings,
│ │ │ │ - // in which case we will deterministically select one of them in
│ │ │ │ - // order to evenly distribute requests to different urls.
│ │ │ │ - //
│ │ │ │ - if (OpenLayers.Util.isArray(url)) {
│ │ │ │ - url = this.selectUrl(paramsString, url);
│ │ │ │ - }
│ │ │ │ + /**
│ │ │ │ + * Method: createCallback
│ │ │ │ + * Returns a function that applies the given public method with resp and
│ │ │ │ + * options arguments.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * method - {Function} The method to be applied by the callback.
│ │ │ │ + * response - {} The protocol response object.
│ │ │ │ + * options - {Object} Options sent to the protocol method
│ │ │ │ + */
│ │ │ │ + createCallback: function(method, response, options) {
│ │ │ │ + return OpenLayers.Function.bind(function() {
│ │ │ │ + method.apply(this, [response, options]);
│ │ │ │ + }, this);
│ │ │ │ + },
│ │ │ │
│ │ │ │ - // ignore parameters that are already in the url search string
│ │ │ │ - var urlParams =
│ │ │ │ - OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(url));
│ │ │ │ - for (var key in allParams) {
│ │ │ │ - if (key.toUpperCase() in urlParams) {
│ │ │ │ - delete allParams[key];
│ │ │ │ - }
│ │ │ │ - }
│ │ │ │ - paramsString = OpenLayers.Util.getParameterString(allParams);
│ │ │ │ + CLASS_NAME: "OpenLayers.Protocol"
│ │ │ │ +});
│ │ │ │
│ │ │ │ - return OpenLayers.Util.urlAppend(url, paramsString);
│ │ │ │ +/**
│ │ │ │ + * Class: OpenLayers.Protocol.Response
│ │ │ │ + * Protocols return Response objects to their users.
│ │ │ │ + */
│ │ │ │ +OpenLayers.Protocol.Response = OpenLayers.Class({
│ │ │ │ + /**
│ │ │ │ + * Property: code
│ │ │ │ + * {Number} - OpenLayers.Protocol.Response.SUCCESS or
│ │ │ │ + * OpenLayers.Protocol.Response.FAILURE
│ │ │ │ + */
│ │ │ │ + code: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: requestType
│ │ │ │ + * {String} The type of request this response corresponds to. Either
│ │ │ │ + * "create", "read", "update" or "delete".
│ │ │ │ + */
│ │ │ │ + requestType: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: last
│ │ │ │ + * {Boolean} - true if this is the last response expected in a commit,
│ │ │ │ + * false otherwise, defaults to true.
│ │ │ │ + */
│ │ │ │ + last: true,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: features
│ │ │ │ + * {Array({})} or {}
│ │ │ │ + * The features returned in the response by the server. Depending on the
│ │ │ │ + * protocol's read payload, either features or data will be populated.
│ │ │ │ + */
│ │ │ │ + features: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: data
│ │ │ │ + * {Object}
│ │ │ │ + * The data returned in the response by the server. Depending on the
│ │ │ │ + * protocol's read payload, either features or data will be populated.
│ │ │ │ + */
│ │ │ │ + data: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: reqFeatures
│ │ │ │ + * {Array({})} or {}
│ │ │ │ + * The features provided by the user and placed in the request by the
│ │ │ │ + * protocol.
│ │ │ │ + */
│ │ │ │ + reqFeatures: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: priv
│ │ │ │ + */
│ │ │ │ + priv: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Property: error
│ │ │ │ + * {Object} The error object in case a service exception was encountered.
│ │ │ │ + */
│ │ │ │ + error: null,
│ │ │ │ +
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Protocol.Response
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * options - {Object} Optional object whose properties will be set on the
│ │ │ │ + * instance.
│ │ │ │ + */
│ │ │ │ + initialize: function(options) {
│ │ │ │ + OpenLayers.Util.extend(this, options);
│ │ │ │ },
│ │ │ │
│ │ │ │ - CLASS_NAME: "OpenLayers.Layer.HTTPRequest"
│ │ │ │ + /**
│ │ │ │ + * Method: success
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Boolean} - true on success, false otherwise
│ │ │ │ + */
│ │ │ │ + success: function() {
│ │ │ │ + return this.code > 0;
│ │ │ │ + },
│ │ │ │ +
│ │ │ │ + CLASS_NAME: "OpenLayers.Protocol.Response"
│ │ │ │ });
│ │ │ │ +
│ │ │ │ +OpenLayers.Protocol.Response.SUCCESS = 1;
│ │ │ │ +OpenLayers.Protocol.Response.FAILURE = 0;
│ │ │ │ /* ======================================================================
│ │ │ │ OpenLayers/Tile.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ @@ -13468,2819 +14969,1285 @@
│ │ │ │ clear: function(draw) {
│ │ │ │ // to be extended by subclasses
│ │ │ │ },
│ │ │ │
│ │ │ │ CLASS_NAME: "OpenLayers.Tile"
│ │ │ │ });
│ │ │ │ /* ======================================================================
│ │ │ │ - OpenLayers/Tile/Image.js
│ │ │ │ + OpenLayers/Renderer.js
│ │ │ │ ====================================================================== */
│ │ │ │
│ │ │ │ /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
│ │ │ │ * full list of contributors). Published under the 2-clause BSD license.
│ │ │ │ * See license.txt in the OpenLayers distribution or repository for the
│ │ │ │ * full text of the license. */
│ │ │ │
│ │ │ │ -
│ │ │ │ /**
│ │ │ │ - * @requires OpenLayers/Tile.js
│ │ │ │ - * @requires OpenLayers/Animation.js
│ │ │ │ - * @requires OpenLayers/Util.js
│ │ │ │ + * @requires OpenLayers/BaseTypes/Class.js
│ │ │ │ */
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Class: OpenLayers.Tile.Image
│ │ │ │ - * Instances of OpenLayers.Tile.Image are used to manage the image tiles
│ │ │ │ - * used by various layers. Create a new image tile with the
│ │ │ │ - * constructor.
│ │ │ │ + * Class: OpenLayers.Renderer
│ │ │ │ + * This is the base class for all renderers.
│ │ │ │ + *
│ │ │ │ + * This is based on a merger code written by Paul Spencer and Bertil Chapuis.
│ │ │ │ + * It is largely composed of virtual functions that are to be implemented
│ │ │ │ + * in technology-specific subclasses, but there is some generic code too.
│ │ │ │ + *
│ │ │ │ + * The functions that *are* implemented here merely deal with the maintenance
│ │ │ │ + * of the size and extent variables, as well as the cached 'resolution'
│ │ │ │ + * value.
│ │ │ │ + *
│ │ │ │ + * A note to the user that all subclasses should use getResolution() instead
│ │ │ │ + * of directly accessing this.resolution in order to correctly use the
│ │ │ │ + * cacheing system.
│ │ │ │ *
│ │ │ │ - * Inherits from:
│ │ │ │ - * -
│ │ │ │ */
│ │ │ │ -OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
│ │ │ │ -
│ │ │ │ - /**
│ │ │ │ - * APIProperty: events
│ │ │ │ - * {} An events object that handles all
│ │ │ │ - * events on the tile.
│ │ │ │ - *
│ │ │ │ - * Register a listener for a particular event with the following syntax:
│ │ │ │ - * (code)
│ │ │ │ - * tile.events.register(type, obj, listener);
│ │ │ │ - * (end)
│ │ │ │ - *
│ │ │ │ - * Supported event types (in addition to the events):
│ │ │ │ - * beforeload - Triggered before an image is prepared for loading, when the
│ │ │ │ - * url for the image is known already. Listeners may call on
│ │ │ │ - * the tile instance. If they do so, that image will be used and no new
│ │ │ │ - * one will be created.
│ │ │ │ - */
│ │ │ │ -
│ │ │ │ - /**
│ │ │ │ - * APIProperty: url
│ │ │ │ - * {String} The URL of the image being requested. No default. Filled in by
│ │ │ │ - * layer.getURL() function. May be modified by loadstart listeners.
│ │ │ │ - */
│ │ │ │ - url: null,
│ │ │ │ +OpenLayers.Renderer = OpenLayers.Class({
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: imgDiv
│ │ │ │ - * {HTMLImageElement} The image for this tile.
│ │ │ │ + * Property: container
│ │ │ │ + * {DOMElement}
│ │ │ │ */
│ │ │ │ - imgDiv: null,
│ │ │ │ + container: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: frame
│ │ │ │ - * {DOMElement} The image element is appended to the frame. Any gutter on
│ │ │ │ - * the image will be hidden behind the frame. If no gutter is set,
│ │ │ │ - * this will be null.
│ │ │ │ + * Property: root
│ │ │ │ + * {DOMElement}
│ │ │ │ */
│ │ │ │ - frame: null,
│ │ │ │ + root: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: imageReloadAttempts
│ │ │ │ - * {Integer} Attempts to load the image.
│ │ │ │ + * Property: extent
│ │ │ │ + * {}
│ │ │ │ */
│ │ │ │ - imageReloadAttempts: null,
│ │ │ │ + extent: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: layerAlphaHack
│ │ │ │ - * {Boolean} True if the png alpha hack needs to be applied on the layer's div.
│ │ │ │ + * Property: locked
│ │ │ │ + * {Boolean} If the renderer is currently in a state where many things
│ │ │ │ + * are changing, the 'locked' property is set to true. This means
│ │ │ │ + * that renderers can expect at least one more drawFeature event to be
│ │ │ │ + * called with the 'locked' property set to 'true': In some renderers,
│ │ │ │ + * this might make sense to use as a 'only update local information'
│ │ │ │ + * flag.
│ │ │ │ */
│ │ │ │ - layerAlphaHack: null,
│ │ │ │ + locked: false,
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Property: asyncRequestId
│ │ │ │ - * {Integer} ID of an request to see if request is still valid. This is a
│ │ │ │ - * number which increments by 1 for each asynchronous request.
│ │ │ │ + /**
│ │ │ │ + * Property: size
│ │ │ │ + * {}
│ │ │ │ */
│ │ │ │ - asyncRequestId: null,
│ │ │ │ + size: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: maxGetUrlLength
│ │ │ │ - * {Number} If set, requests that would result in GET urls with more
│ │ │ │ - * characters than the number provided will be made using form-encoded
│ │ │ │ - * HTTP POST. It is good practice to avoid urls that are longer than 2048
│ │ │ │ - * characters.
│ │ │ │ - *
│ │ │ │ - * Caution:
│ │ │ │ - * Older versions of Gecko based browsers (e.g. Firefox < 3.5) and most
│ │ │ │ - * Opera versions do not fully support this option. On all browsers,
│ │ │ │ - * transition effects are not supported if POST requests are used.
│ │ │ │ + * Property: resolution
│ │ │ │ + * {Float} cache of current map resolution
│ │ │ │ */
│ │ │ │ - maxGetUrlLength: null,
│ │ │ │ + resolution: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Property: canvasContext
│ │ │ │ - * {CanvasRenderingContext2D} A canvas context associated with
│ │ │ │ - * the tile image.
│ │ │ │ + * Property: map
│ │ │ │ + * {} Reference to the map -- this is set in Vector's setMap()
│ │ │ │ */
│ │ │ │ - canvasContext: null,
│ │ │ │ + map: null,
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * APIProperty: crossOriginKeyword
│ │ │ │ - * The value of the crossorigin keyword to use when loading images. This is
│ │ │ │ - * only relevant when using for tiles from remote
│ │ │ │ - * origins and should be set to either 'anonymous' or 'use-credentials'
│ │ │ │ - * for servers that send Access-Control-Allow-Origin headers with their
│ │ │ │ - * tiles.
│ │ │ │ - */
│ │ │ │ - crossOriginKeyword: null,
│ │ │ │ -
│ │ │ │ - /** TBD 3.0 - reorder the parameters to the init function to remove
│ │ │ │ - * URL. the getUrl() function on the layer gets called on
│ │ │ │ - * each draw(), so no need to specify it here.
│ │ │ │ + * Property: featureDx
│ │ │ │ + * {Number} Feature offset in x direction. Will be calculated for and
│ │ │ │ + * applied to the current feature while rendering (see
│ │ │ │ + * ).
│ │ │ │ */
│ │ │ │ + featureDx: 0,
│ │ │ │
│ │ │ │ - /**
│ │ │ │ - * Constructor: OpenLayers.Tile.Image
│ │ │ │ - * Constructor for a new instance.
│ │ │ │ - *
│ │ │ │ + /**
│ │ │ │ + * Constructor: OpenLayers.Renderer
│ │ │ │ + *
│ │ │ │ * Parameters:
│ │ │ │ - * layer - {} layer that the tile will go in.
│ │ │ │ - * position - {}
│ │ │ │ - * bounds - {}
│ │ │ │ - * url - {} Deprecated. Remove me in 3.0.
│ │ │ │ - * size - {}
│ │ │ │ - * options - {Object}
│ │ │ │ + * containerID - {}
│ │ │ │ + * options - {Object} options for this renderer. See sublcasses for
│ │ │ │ + * supported options.
│ │ │ │ */
│ │ │ │ - initialize: function(layer, position, bounds, url, size, options) {
│ │ │ │ - OpenLayers.Tile.prototype.initialize.apply(this, arguments);
│ │ │ │ -
│ │ │ │ - this.url = url; //deprecated remove me
│ │ │ │ -
│ │ │ │ - this.layerAlphaHack = this.layer.alpha && OpenLayers.Util.alphaHack();
│ │ │ │ -
│ │ │ │ - if (this.maxGetUrlLength != null || this.layer.gutter || this.layerAlphaHack) {
│ │ │ │ - // only create frame if it's needed
│ │ │ │ - this.frame = document.createElement("div");
│ │ │ │ - this.frame.style.position = "absolute";
│ │ │ │ - this.frame.style.overflow = "hidden";
│ │ │ │ - }
│ │ │ │ - if (this.maxGetUrlLength != null) {
│ │ │ │ - OpenLayers.Util.extend(this, OpenLayers.Tile.Image.IFrame);
│ │ │ │ - }
│ │ │ │ + initialize: function(containerID, options) {
│ │ │ │ + this.container = OpenLayers.Util.getElement(containerID);
│ │ │ │ + OpenLayers.Util.extend(this, options);
│ │ │ │ },
│ │ │ │
│ │ │ │ - /**
│ │ │ │ + /**
│ │ │ │ * APIMethod: destroy
│ │ │ │ - * nullify references to prevent circular references and memory leaks
│ │ │ │ */
│ │ │ │ destroy: function() {
│ │ │ │ - if (this.imgDiv) {
│ │ │ │ - this.clear();
│ │ │ │ - this.imgDiv = null;
│ │ │ │ - this.frame = null;
│ │ │ │ - }
│ │ │ │ - // don't handle async requests any more
│ │ │ │ - this.asyncRequestId = null;
│ │ │ │ - OpenLayers.Tile.prototype.destroy.apply(this, arguments);
│ │ │ │ + this.container = null;
│ │ │ │ + this.extent = null;
│ │ │ │ + this.size = null;
│ │ │ │ + this.resolution = null;
│ │ │ │ + this.map = null;
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Method: draw
│ │ │ │ - * Check that a tile should be drawn, and draw it.
│ │ │ │ + * APIMethod: supported
│ │ │ │ + * This should be overridden by specific subclasses
│ │ │ │ *
│ │ │ │ * Returns:
│ │ │ │ - * {Boolean} Was a tile drawn? Or null if a beforedraw listener returned
│ │ │ │ - * false.
│ │ │ │ + * {Boolean} Whether or not the browser supports the renderer class
│ │ │ │ */
│ │ │ │ - draw: function() {
│ │ │ │ - var shouldDraw = OpenLayers.Tile.prototype.draw.apply(this, arguments);
│ │ │ │ - if (shouldDraw) {
│ │ │ │ - // The layer's reproject option is deprecated.
│ │ │ │ - if (this.layer != this.layer.map.baseLayer && this.layer.reproject) {
│ │ │ │ - // getBoundsFromBaseLayer is defined in deprecated.js.
│ │ │ │ - this.bounds = this.getBoundsFromBaseLayer(this.position);
│ │ │ │ - }
│ │ │ │ - if (this.isLoading) {
│ │ │ │ - //if we're already loading, send 'reload' instead of 'loadstart'.
│ │ │ │ - this._loadEvent = "reload";
│ │ │ │ - } else {
│ │ │ │ - this.isLoading = true;
│ │ │ │ - this._loadEvent = "loadstart";
│ │ │ │ - }
│ │ │ │ - this.renderTile();
│ │ │ │ - this.positionTile();
│ │ │ │ - } else if (shouldDraw === false) {
│ │ │ │ - this.unload();
│ │ │ │ - }
│ │ │ │ - return shouldDraw;
│ │ │ │ + supported: function() {
│ │ │ │ + return false;
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Method: renderTile
│ │ │ │ - * Internal function to actually initialize the image tile,
│ │ │ │ - * position it correctly, and set its url.
│ │ │ │ + * Method: setExtent
│ │ │ │ + * Set the visible part of the layer.
│ │ │ │ + *
│ │ │ │ + * Resolution has probably changed, so we nullify the resolution
│ │ │ │ + * cache (this.resolution) -- this way it will be re-computed when
│ │ │ │ + * next it is needed.
│ │ │ │ + * We nullify the resolution cache (this.resolution) if resolutionChanged
│ │ │ │ + * is set to true - this way it will be re-computed on the next
│ │ │ │ + * getResolution() request.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * extent - {}
│ │ │ │ + * resolutionChanged - {Boolean}
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Boolean} true to notify the layer that the new extent does not exceed
│ │ │ │ + * the coordinate range, and the features will not need to be redrawn.
│ │ │ │ + * False otherwise.
│ │ │ │ */
│ │ │ │ - renderTile: function() {
│ │ │ │ - if (this.layer.async) {
│ │ │ │ - // Asynchronous image requests call the asynchronous getURL method
│ │ │ │ - // on the layer to fetch an image that covers 'this.bounds'.
│ │ │ │ - var id = this.asyncRequestId = (this.asyncRequestId || 0) + 1;
│ │ │ │ - this.layer.getURLasync(this.bounds, function(url) {
│ │ │ │ - if (id == this.asyncRequestId) {
│ │ │ │ - this.url = url;
│ │ │ │ - this.initImage();
│ │ │ │ - }
│ │ │ │ - }, this);
│ │ │ │ - } else {
│ │ │ │ - // synchronous image requests get the url immediately.
│ │ │ │ - this.url = this.layer.getURL(this.bounds);
│ │ │ │ - this.initImage();
│ │ │ │ + setExtent: function(extent, resolutionChanged) {
│ │ │ │ + this.extent = extent.clone();
│ │ │ │ + if (this.map.baseLayer && this.map.baseLayer.wrapDateLine) {
│ │ │ │ + var ratio = extent.getWidth() / this.map.getExtent().getWidth(),
│ │ │ │ + extent = extent.scale(1 / ratio);
│ │ │ │ + this.extent = extent.wrapDateLine(this.map.getMaxExtent()).scale(ratio);
│ │ │ │ + }
│ │ │ │ + if (resolutionChanged) {
│ │ │ │ + this.resolution = null;
│ │ │ │ }
│ │ │ │ + return true;
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Method: positionTile
│ │ │ │ - * Using the properties currenty set on the layer, position the tile correctly.
│ │ │ │ - * This method is used both by the async and non-async versions of the Tile.Image
│ │ │ │ - * code.
│ │ │ │ + * Method: setSize
│ │ │ │ + * Sets the size of the drawing surface.
│ │ │ │ + *
│ │ │ │ + * Resolution has probably changed, so we nullify the resolution
│ │ │ │ + * cache (this.resolution) -- this way it will be re-computed when
│ │ │ │ + * next it is needed.
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * size - {}
│ │ │ │ */
│ │ │ │ - positionTile: function() {
│ │ │ │ - var style = this.getTile().style,
│ │ │ │ - size = this.frame ? this.size :
│ │ │ │ - this.layer.getImageSize(this.bounds),
│ │ │ │ - ratio = 1;
│ │ │ │ - if (this.layer instanceof OpenLayers.Layer.Grid) {
│ │ │ │ - ratio = this.layer.getServerResolution() / this.layer.map.getResolution();
│ │ │ │ - }
│ │ │ │ - style.left = this.position.x + "px";
│ │ │ │ - style.top = this.position.y + "px";
│ │ │ │ - style.width = Math.round(ratio * size.w) + "px";
│ │ │ │ - style.height = Math.round(ratio * size.h) + "px";
│ │ │ │ + setSize: function(size) {
│ │ │ │ + this.size = size.clone();
│ │ │ │ + this.resolution = null;
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Method: clear
│ │ │ │ - * Remove the tile from the DOM, clear it of any image related data so that
│ │ │ │ - * it can be reused in a new location.
│ │ │ │ + * Method: getResolution
│ │ │ │ + * Uses cached copy of resolution if available to minimize computing
│ │ │ │ + *
│ │ │ │ + * Returns:
│ │ │ │ + * {Float} The current map's resolution
│ │ │ │ */
│ │ │ │ - clear: function() {
│ │ │ │ - OpenLayers.Tile.prototype.clear.apply(this, arguments);
│ │ │ │ - var img = this.imgDiv;
│ │ │ │ - if (img) {
│ │ │ │ - var tile = this.getTile();
│ │ │ │ - if (tile.parentNode === this.layer.div) {
│ │ │ │ - this.layer.div.removeChild(tile);
│ │ │ │ - }
│ │ │ │ - this.setImgSrc();
│ │ │ │ - if (this.layerAlphaHack === true) {
│ │ │ │ - img.style.filter = "";
│ │ │ │ - }
│ │ │ │ - OpenLayers.Element.removeClass(img, "olImageLoadError");
│ │ │ │ - }
│ │ │ │ - this.canvasContext = null;
│ │ │ │ + getResolution: function() {
│ │ │ │ + this.resolution = this.resolution || this.map.getResolution();
│ │ │ │ + return this.resolution;
│ │ │ │ },
│ │ │ │
│ │ │ │ /**
│ │ │ │ - * Method: getImage
│ │ │ │ - * Returns or creates and returns the tile image.
│ │ │ │ + * Method: drawFeature
│ │ │ │ + * Draw the feature. The optional style argument can be used
│ │ │ │ + * to override the feature's own style. This method should only
│ │ │ │ + * be called from layer.drawFeature().
│ │ │ │ + *
│ │ │ │ + * Parameters:
│ │ │ │ + * feature - {}
│ │ │ │ + * style - {