[OpenLayers-Commits] r3608 - in sandbox/euzuro/untiled3: apidoc_config build doc_config examples lib lib/OpenLayers lib/OpenLayers/BaseTypes lib/OpenLayers/Control lib/OpenLayers/Format lib/OpenLayers/Geometry tests/Geometry
commits at openlayers.org
commits at openlayers.org
Thu Jul 5 19:46:50 EDT 2007
Author: euzuro
Date: 2007-07-05 19:46:47 -0400 (Thu, 05 Jul 2007)
New Revision: 3608
Added:
sandbox/euzuro/untiled3/examples/rotate-features.html
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Bounds.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Class.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Element.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/LonLat.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Pixel.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Size.js
Removed:
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Bounds.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Class.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Element.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/LonLat.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Pixel.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Size.js
Modified:
sandbox/euzuro/untiled3/apidoc_config/Menu.txt
sandbox/euzuro/untiled3/build/full.cfg
sandbox/euzuro/untiled3/build/library.cfg
sandbox/euzuro/untiled3/build/lite.cfg
sandbox/euzuro/untiled3/doc_config/Menu.txt
sandbox/euzuro/untiled3/lib/OpenLayers.js
sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes.js
sandbox/euzuro/untiled3/lib/OpenLayers/Control/Navigation.js
sandbox/euzuro/untiled3/lib/OpenLayers/Events.js
sandbox/euzuro/untiled3/lib/OpenLayers/Format/GML.js
sandbox/euzuro/untiled3/lib/OpenLayers/Format/GeoRSS.js
sandbox/euzuro/untiled3/lib/OpenLayers/Format/KML.js
sandbox/euzuro/untiled3/lib/OpenLayers/Geometry/Collection.js
sandbox/euzuro/untiled3/lib/OpenLayers/Geometry/Point.js
sandbox/euzuro/untiled3/tests/Geometry/test_LineString.html
sandbox/euzuro/untiled3/tests/Geometry/test_Point.html
sandbox/euzuro/untiled3/tests/Geometry/test_Polygon.html
Log:
bringing up changes from trunk
Modified: sandbox/euzuro/untiled3/apidoc_config/Menu.txt
===================================================================
--- sandbox/euzuro/untiled3/apidoc_config/Menu.txt 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/apidoc_config/Menu.txt 2007-07-05 23:46:47 UTC (rev 3608)
@@ -34,7 +34,18 @@
Group: OpenLayers {
File: Ajax (no auto-title, OpenLayers/Ajax.js)
- File: Base Types (no auto-title, OpenLayers/BaseTypes.js)
+
+ Group: BaseTypes {
+
+ File: Base Types (no auto-title, OpenLayers/BaseTypes.js)
+ File: Bounds (OpenLayers/BaseTypes/Bounds.js)
+ File: Class (OpenLayers/BaseTypes/Class.js)
+ File: Element (OpenLayers/BaseTypes/Element.js)
+ File: LonLat (OpenLayers/BaseTypes/LonLat.js)
+ File: Pixel (OpenLayers/BaseTypes/Pixel.js)
+ File: Size (OpenLayers/BaseTypes/Size.js)
+ } # Group: BaseTypes
+
File: Console (no auto-title, OpenLayers/Console.js)
Group: Control {
Modified: sandbox/euzuro/untiled3/build/full.cfg
===================================================================
--- sandbox/euzuro/untiled3/build/full.cfg 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/build/full.cfg 2007-07-05 23:46:47 UTC (rev 3608)
@@ -2,6 +2,7 @@
OpenLayers/SingleFile.js
OpenLayers.js
OpenLayers/BaseTypes.js
+OpenLayers/BaseTypes/Class.js
OpenLayers/Util.js
Rico/Corner.js
Modified: sandbox/euzuro/untiled3/build/library.cfg
===================================================================
--- sandbox/euzuro/untiled3/build/library.cfg 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/build/library.cfg 2007-07-05 23:46:47 UTC (rev 3608)
@@ -2,6 +2,7 @@
OpenLayers/SingleFile.js
OpenLayers.js
OpenLayers/BaseTypes.js
+OpenLayers/BaseTypes/Class.js
OpenLayers/Util.js
Rico/Corner.js
Modified: sandbox/euzuro/untiled3/build/lite.cfg
===================================================================
--- sandbox/euzuro/untiled3/build/lite.cfg 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/build/lite.cfg 2007-07-05 23:46:47 UTC (rev 3608)
@@ -2,6 +2,7 @@
OpenLayers/SingleFile.js
OpenLayers.js
OpenLayers/BaseTypes.js
+OpenLayers/BaseTypes/Class.js
OpenLayers/Util.js
[last]
Modified: sandbox/euzuro/untiled3/doc_config/Menu.txt
===================================================================
--- sandbox/euzuro/untiled3/doc_config/Menu.txt 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/doc_config/Menu.txt 2007-07-05 23:46:47 UTC (rev 3608)
@@ -34,7 +34,18 @@
Group: OpenLayers {
File: Ajax (no auto-title, OpenLayers/Ajax.js)
- File: Base Types (no auto-title, OpenLayers/BaseTypes.js)
+
+ Group: BaseTypes {
+
+ File: Base Types (no auto-title, OpenLayers/BaseTypes.js)
+ File: Bounds (OpenLayers/BaseTypes/Bounds.js)
+ File: Class (OpenLayers/BaseTypes/Class.js)
+ File: Element (OpenLayers/BaseTypes/Element.js)
+ File: LonLat (OpenLayers/BaseTypes/LonLat.js)
+ File: Pixel (OpenLayers/BaseTypes/Pixel.js)
+ File: Size (OpenLayers/BaseTypes/Size.js)
+ } # Group: BaseTypes
+
File: Console (no auto-title, OpenLayers/Console.js)
Group: Control {
Copied: sandbox/euzuro/untiled3/examples/rotate-features.html (from rev 3607, trunk/openlayers/examples/rotate-features.html)
===================================================================
--- sandbox/euzuro/untiled3/examples/rotate-features.html (rev 0)
+++ sandbox/euzuro/untiled3/examples/rotate-features.html 2007-07-05 23:46:47 UTC (rev 3608)
@@ -0,0 +1,96 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ #map {
+ width: 500px;
+ height: 350px;
+ border: 1px solid #ccc;
+ }
+ p {
+ width: 500px;
+ }
+ </style>
+ <script src="../lib/OpenLayers.js"></script>
+ <script type="text/javascript">
+ <!--
+ var map, pointFeature, lineFeature, polygonFeature;
+
+ function init(){
+ map = new OpenLayers.Map('map');
+ var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
+ "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
+ map.addLayer(layer);
+
+ var style_blue = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
+ style_blue.strokeColor = "blue";
+ style_blue.fillColor = "blue";
+ var style_green = {
+ strokeColor: "#339933",
+ strokeOpacity: 1,
+ strokeWidth: 3,
+ pointRadius: 6,
+ pointerEvents: "visiblePainted"
+ };
+
+ var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry");
+
+ // create a point feature
+ var point = new OpenLayers.Geometry.Point(-111.04, 45.68);
+ pointFeature = new OpenLayers.Feature.Vector(point, null, style_blue);
+
+ // create a line feature from a list of points
+ var pointList = [];
+ var newPoint = point;
+ for(var p=0; p<5; ++p) {
+ newPoint = new OpenLayers.Geometry.Point(newPoint.x + Math.random(1),
+ newPoint.y + Math.random(1));
+ pointList.push(newPoint);
+ }
+ lineFeature = new OpenLayers.Feature.Vector(
+ new OpenLayers.Geometry.LineString(pointList),null,style_green);
+
+ // create a polygon feature from a linear ring of points
+ var pointList = [];
+ for(var p=0; p<6; ++p) {
+ var a = p * (2 * Math.PI) / 7;
+ var r = Math.random(1) + 1;
+ var newPoint = new OpenLayers.Geometry.Point(point.x + (r * Math.cos(a)),
+ point.y + (r * Math.sin(a)));
+ pointList.push(newPoint);
+ }
+ pointList.push(pointList[0]);
+
+ var linearRing = new OpenLayers.Geometry.LinearRing(pointList);
+ polygonFeature = new OpenLayers.Feature.Vector(
+ new OpenLayers.Geometry.Polygon([linearRing]));
+
+
+ map.addLayer(vectorLayer);
+ map.setCenter(new OpenLayers.LonLat(point.x, point.y), 5);
+ vectorLayer.addFeatures([pointFeature, lineFeature, polygonFeature]);
+
+ // start rotating
+ var origin = new OpenLayers.Geometry.Point(-110, 45);
+ window.setInterval(rotateFeature, 100,
+ pointFeature, Math.PI / 10, origin);
+ window.setInterval(rotateFeature, 100,
+ lineFeature, Math.PI / 20, origin);
+ window.setInterval(rotateFeature, 100,
+ polygonFeature, -1 * Math.PI / 10, origin);
+ }
+
+ function rotateFeature(feature, angle, origin) {
+ feature.geometry.rotate(angle, origin);
+ feature.layer.drawFeature(feature);
+ }
+
+ // -->
+ </script>
+ </head>
+ <body onload="init()">
+ <div id="map"></div>
+ <p>This example shows a few features rotating. There is not yet a control
+ built that provides a tool for rotating, but the geometry.rotate method
+ can be accessed to rotate programmatically.</p>
+ </body>
+</html>
Copied: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes (from rev 3607, trunk/openlayers/lib/OpenLayers/BaseTypes)
Deleted: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Bounds.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/BaseTypes/Bounds.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Bounds.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -1,531 +0,0 @@
-/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
- * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
- * for the full text of the license. */
-
-/**
- * Class: OpenLayers.Bounds
- * Instances of this class represent bounding boxes. Data stored as left,
- * bottom, right, top floats
- */
-OpenLayers.Bounds = OpenLayers.Class.create();
-OpenLayers.Bounds.prototype = {
-
- /**
- * Property: left
- * {Number}
- */
- left: 0.0,
-
- /**
- * Property: bottom
- * {Number}
- */
- bottom: 0.0,
-
- /**
- * Property: right
- * {Number}
- */
- right: 0.0,
-
- /**
- * Property: top
- * {Number}
- */
- top: 0.0,
-
- /**
- * Constructor: OpenLayers.Bounds
- * Construct a new bounds object.
- *
- * Parameters:
- * left - {Number} The left bounds of the box. Note that for width
- * calculations, this is assumed to be less than the right value.
- * bottom - {Number} The bottom bounds of the box. Note that for height
- * calculations, this is assumed to be more than the top value.
- * right - {Number} The right bounds.
- * top - {Number} The top bounds.
- */
- initialize: function(left, bottom, right, top) {
- this.left = parseFloat(left);
- this.bottom = parseFloat(bottom);
- this.right = parseFloat(right);
- this.top = parseFloat(top);
- },
-
- /**
- * Method: clone
- * Create a cloned instance of this bounds.
- *
- * Return:
- * {<OpenLayers.Bounds>} A fresh copy of the bounds
- */
- clone:function() {
- return new OpenLayers.Bounds(this.left, this.bottom,
- this.right, this.top);
- },
-
- /**
- * Method: equals
- * Test a two bounds for equivalence
- *
- * Parameters:
- * bounds - {<OpenLayers.Bounds>}
- *
- * Return:
- * {Boolean} The passed-in OpenLayers.Bounds object has the same left,
- * right, top, bottom components as this. Note that if bounds
- * passed in is null, returns false.
- */
- equals:function(bounds) {
- var equals = false;
- if (bounds != null) {
- equals = ((this.left == bounds.left) &&
- (this.right == bounds.right) &&
- (this.top == bounds.top) &&
- (this.bottom == bounds.bottom));
- }
- return equals;
- },
-
- /**
- * APIMethod: toString
- *
- * Return:
- * {String} String representation of OpenLayers.Bounds object.
- * (ex.<i>"left-bottom=(5,42) right-top=(10,45)"</i>)
- */
- toString:function() {
- return ( "left-bottom=(" + this.left + "," + this.bottom + ")"
- + " right-top=(" + this.right + "," + this.top + ")" );
- },
-
- /**
- * APIMethod: toBBOX
- *
- * Parameters:
- * decimal - {Integer} How many significant digits in the bbox coords?
- * Default is 6
- *
- * Return:
- * {String} Simple String representation of OpenLayers.Bounds object.
- * (ex. <i>"5,42,10,45"</i>)
- */
- toBBOX:function(decimal) {
- if (decimal== null) {
- decimal = 6;
- }
- var mult = Math.pow(10, decimal);
- var bbox = Math.round(this.left * mult) / mult + "," +
- Math.round(this.bottom * mult) / mult + "," +
- Math.round(this.right * mult) / mult + "," +
- Math.round(this.top * mult) / mult;
-
- return bbox;
- },
-
- /**
- * APIMethod: getWidth
- *
- * Return:
- * {Float} The width of the bounds
- */
- getWidth:function() {
- return (this.right - this.left);
- },
-
- /**
- * APIMethod: getHeight
- *
- * Return:
- * {Float} The height of the bounds
- */
- getHeight:function() {
- return (this.top - this.bottom);
- },
-
- /**
- * APIMethod: getSize
- *
- * Return:
- * {<OpenLayers.Size>} An <OpenLayers.Size> which represents the size of the box
- */
- getSize:function() {
- return new OpenLayers.Size(this.getWidth(), this.getHeight());
- },
-
- /**
- * APIMethod: getCenterPixel
- *
- * Return:
- * {<OpenLayers.Pixel>} An <OpenLayers.Pixel> which represents the center
- * of the bounds
- */
- getCenterPixel:function() {
- return new OpenLayers.Pixel( (this.left + this.right) / 2,
- (this.bottom + this.top) / 2);
- },
-
- /**
- * APIMethod: getCenterLonLat
- *
- * Return:
- * {<OpenLayers.LonLat>} An <OpenLayers.LonLat> which represents the center
- * of the bounds
- */
- getCenterLonLat:function() {
- return new OpenLayers.LonLat( (this.left + this.right) / 2,
- (this.bottom + this.top) / 2);
- },
-
- /**
- * APIMethod: add
- *
- * Parameters:
- * x - {Float}
- * y - {Float}
- *
- * Return:
- * {<OpenLayers.Bounds>} A new <OpenLayers.Bounds> whose coordinates are
- * the same as this, but shifted by the passed-in
- * x and y values
- */
- add:function(x, y) {
- return new OpenLayers.Bounds(this.left + x, this.bottom + y,
- this.right + x, this.top + y);
- },
-
- /**
- * APIMethod: extend
- * Extend the bounds to include the point, lonlat, or bounds specified.
- * Note: This function assumes that left<right and bottom<top.
- *
- *
- * Parameters:
- * object - {Object} Can be LonLat, Point, or Bounds
- */
- extend:function(object) {
- var bounds = null;
- if (object) {
- switch(object.CLASS_NAME) {
- case "OpenLayers.LonLat":
- bounds = new OpenLayers.Bounds(object.lon, object.lat,
- object.lon, object.lat);
- break;
- case "OpenLayers.Geometry.Point":
- bounds = new OpenLayers.Bounds(object.x, object.y,
- object.x, object.y);
- break;
-
- case "OpenLayers.Bounds":
- bounds = object;
- break;
- }
-
- if (bounds) {
- this.left = (bounds.left < this.left) ? bounds.left
- : this.left;
- this.bottom = (bounds.bottom < this.bottom) ? bounds.bottom
- : this.bottom;
- this.right = (bounds.right > this.right) ? bounds.right
- : this.right;
- this.top = (bounds.top > this.top) ? bounds.top
- : this.top;
- }
- }
- },
-
- /**
- * APIMethod: containsLonLat
- *
- * Parameters:
- * ll - {<OpenLayers.LonLat>}
- * inclusive - {Boolean} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in lonlat is within this bounds.
- */
- containsLonLat:function(ll, inclusive) {
- return this.contains(ll.lon, ll.lat, inclusive);
- },
-
- /**
- * APIMethod: containsPixel
- *
- * Parameters:
- * px - {<OpenLayers.Pixel>}
- * inclusive - {Boolean} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in pixel is within this bounds.
- */
- containsPixel:function(px, inclusive) {
- return this.contains(px.x, px.y, inclusive);
- },
-
- /**
- * APIMethod: contains
- *
- * Parameters:
- * x - {Float}
- * y - {Float}
- * inclusive - {Boolean} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in coordinates are within this
- * bounds.
- */
- contains:function(x, y, inclusive) {
-
- //set default
- if (inclusive == null) {
- inclusive = true;
- }
-
- var contains = false;
- if (inclusive) {
- contains = ((x >= this.left) && (x <= this.right) &&
- (y >= this.bottom) && (y <= this.top));
- } else {
- contains = ((x > this.left) && (x < this.right) &&
- (y > this.bottom) && (y < this.top));
- }
- return contains;
- },
-
- /**
- * APIMethod: intersectsBounds
- *
- * Parameters:
- * bounds - {<OpenLayers.Bounds>}
- * inclusive - {<Boolean>} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in OpenLayers.Bounds object
- * intersects this bounds. Simple math just check if either
- * contains the other, allowing for partial.
- */
- intersectsBounds:function(bounds, inclusive) {
-
- if (inclusive == null) {
- inclusive = true;
- }
- var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ?
- true : (((bounds.bottom > this.bottom) && (bounds.bottom < this.top)) ||
- ((this.bottom > bounds.bottom) && (this.bottom < bounds.top)));
- var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ?
- true : (((bounds.top > this.bottom) && (bounds.top < this.top)) ||
- ((this.top > bounds.bottom) && (this.top < bounds.top)));
- var inRight = (bounds.right == this.right && bounds.left == this.left) ?
- true : (((bounds.right > this.left) && (bounds.right < this.right)) ||
- ((this.right > bounds.left) && (this.right < bounds.right)));
- var inLeft = (bounds.right == this.right && bounds.left == this.left) ?
- true : (((bounds.left > this.left) && (bounds.left < this.right)) ||
- ((this.left > bounds.left) && (this.left < bounds.right)));
-
- return (this.containsBounds(bounds, true, inclusive) ||
- bounds.containsBounds(this, true, inclusive) ||
- ((inTop || inBottom ) && (inLeft || inRight )));
- },
-
- /**
- * APIMethod: containsBounds
- *
- * bounds - {<OpenLayers.Bounds>}
- * partial - {<Boolean>} If true, only part of passed-in
- * <OpenLayers.Bounds> needs be within this bounds.
- * If false, the entire passed-in bounds must be
- * within. Default is false
- * inclusive - {<Boolean>} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in OpenLayers.Bounds object is
- * contained within this bounds.
- */
- containsBounds:function(bounds, partial, inclusive) {
-
- //set defaults
- if (partial == null) {
- partial = false;
- }
- if (inclusive == null) {
- inclusive = true;
- }
-
- var inLeft;
- var inTop;
- var inRight;
- var inBottom;
-
- if (inclusive) {
- inLeft = (bounds.left >= this.left) && (bounds.left <= this.right);
- inTop = (bounds.top >= this.bottom) && (bounds.top <= this.top);
- inRight= (bounds.right >= this.left) && (bounds.right <= this.right);
- inBottom = (bounds.bottom >= this.bottom) && (bounds.bottom <= this.top);
- } else {
- inLeft = (bounds.left > this.left) && (bounds.left < this.right);
- inTop = (bounds.top > this.bottom) && (bounds.top < this.top);
- inRight= (bounds.right > this.left) && (bounds.right < this.right);
- inBottom = (bounds.bottom > this.bottom) && (bounds.bottom < this.top);
- }
-
- return (partial) ? (inTop || inBottom ) && (inLeft || inRight )
- : (inTop && inLeft && inBottom && inRight);
- },
-
- /**
- * APIMethod: determineQuadrant
- *
- * Parameters:
- * lonlat - {<OpenLayers.LonLat>}
- *
- * Return:
- * {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which
- * the coordinate lies.
- */
- determineQuadrant: function(lonlat) {
-
- var quadrant = "";
- var center = this.getCenterLonLat();
-
- quadrant += (lonlat.lat < center.lat) ? "b" : "t";
- quadrant += (lonlat.lon < center.lon) ? "l" : "r";
-
- return quadrant;
- },
-
- /**
- * APIMethod: wrapDateLine
- *
- * Parameters:
- * maxExtent - {<OpenLayers.Bounds>}
- * options - {Object} Some possible options are:
- * leftTolerance - {float} Allow for a margin of error
- * with the 'left' value of this
- * bound.
- * Default is 0.
- * rightTolerance - {float} Allow for a margin of error
- * with the 'right' value of
- * this bound.
- * Default is 0.
- *
- * Return:
- * {<OpenLayers.Bounds>} A copy of this bounds, but wrapped around the
- * "dateline" (as specified by the borders of
- * maxExtent). Note that this function only returns
- * a different bounds value if this bounds is
- * *entirely* outside of the maxExtent. If this
- * bounds straddles the dateline (is part in/part
- * out of maxExtent), the returned bounds will be
- * merely a copy of this one.
- */
- wrapDateLine: function(maxExtent, options) {
- options = options || new Object();
-
- var leftTolerance = options.leftTolerance || 0;
- var rightTolerance = options.rightTolerance || 0;
-
- var newBounds = this.clone();
-
- if (maxExtent) {
-
- //shift right?
- while ( newBounds.left < maxExtent.left &&
- (newBounds.right - rightTolerance) <= maxExtent.left ) {
- newBounds = newBounds.add(maxExtent.getWidth(), 0);
- }
-
- //shift left?
- while ( (newBounds.left + leftTolerance) >= maxExtent.right &&
- newBounds.right > maxExtent.right ) {
- newBounds = newBounds.add(-maxExtent.getWidth(), 0);
- }
- }
-
- return newBounds;
- },
-
- /** @final @type String */
- CLASS_NAME: "OpenLayers.Bounds"
-};
-
-/**
- * APIFunction: fromString
- * Alternative constructor that builds a new OpenLayers.Bounds from a
- * parameter string
- *
- * Parameters:
- * str - {String}Comma-separated bounds string. (ex. <i>"5,42,10,45"</i>)
- *
- * Return:
- * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
- * passed-in String.
- */
-OpenLayers.Bounds.fromString = function(str) {
- var bounds = str.split(",");
- return OpenLayers.Bounds.fromArray(bounds);
-};
-
-/**
- * APIFunction: fromArray
- * Alternative constructor that builds a new OpenLayers.Bounds
- * from an array
- *
- * Parameters:
- * bbox - {Array} Array of bounds values (ex. <i>[5,42,10,45]</i>)
- *
- * Return:
- * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
- * passed-in Array.
- */
-OpenLayers.Bounds.fromArray = function(bbox) {
- return new OpenLayers.Bounds(parseFloat(bbox[0]),
- parseFloat(bbox[1]),
- parseFloat(bbox[2]),
- parseFloat(bbox[3]));
-};
-
-/**
- * APIFunction: fromSize
- * Alternative constructor that builds a new OpenLayers.Bounds
- * from a size
- *
- * Parameters:
- * size - {<OpenLayers.Size>}
- *
- * Return:
- * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
- * passed-in size.
- */
-OpenLayers.Bounds.fromSize = function(size) {
- return new OpenLayers.Bounds(0,
- size.h,
- size.w,
- 0);
-};
-
-/**
- * Function: oppositeQuadrant
- * Get the opposite quadrant for a given quadrant string.
- *
- * Parameters:
- * quadrant - {String} two character quadrant shortstring
- *
- * Return:
- * {String} The opposing quadrant ("br" "tr" "tl" "bl"). For Example, if
- * you pass in "bl" it returns "tr", if you pass in "br" it
- * returns "tl", etc.
- */
-OpenLayers.Bounds.oppositeQuadrant = function(quadrant) {
- var opp = "";
-
- opp += (quadrant.charAt(0) == 't') ? 'b' : 't';
- opp += (quadrant.charAt(1) == 'l') ? 'r' : 'l';
-
- return opp;
-};
Copied: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Bounds.js (from rev 3607, trunk/openlayers/lib/OpenLayers/BaseTypes/Bounds.js)
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Bounds.js (rev 0)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Bounds.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -0,0 +1,531 @@
+/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
+ * for the full text of the license. */
+
+/**
+ * Class: OpenLayers.Bounds
+ * Instances of this class represent bounding boxes. Data stored as left,
+ * bottom, right, top floats
+ */
+OpenLayers.Bounds = OpenLayers.Class.create();
+OpenLayers.Bounds.prototype = {
+
+ /**
+ * Property: left
+ * {Number}
+ */
+ left: 0.0,
+
+ /**
+ * Property: bottom
+ * {Number}
+ */
+ bottom: 0.0,
+
+ /**
+ * Property: right
+ * {Number}
+ */
+ right: 0.0,
+
+ /**
+ * Property: top
+ * {Number}
+ */
+ top: 0.0,
+
+ /**
+ * Constructor: OpenLayers.Bounds
+ * Construct a new bounds object.
+ *
+ * Parameters:
+ * left - {Number} The left bounds of the box. Note that for width
+ * calculations, this is assumed to be less than the right value.
+ * bottom - {Number} The bottom bounds of the box. Note that for height
+ * calculations, this is assumed to be more than the top value.
+ * right - {Number} The right bounds.
+ * top - {Number} The top bounds.
+ */
+ initialize: function(left, bottom, right, top) {
+ this.left = parseFloat(left);
+ this.bottom = parseFloat(bottom);
+ this.right = parseFloat(right);
+ this.top = parseFloat(top);
+ },
+
+ /**
+ * Method: clone
+ * Create a cloned instance of this bounds.
+ *
+ * Return:
+ * {<OpenLayers.Bounds>} A fresh copy of the bounds
+ */
+ clone:function() {
+ return new OpenLayers.Bounds(this.left, this.bottom,
+ this.right, this.top);
+ },
+
+ /**
+ * Method: equals
+ * Test a two bounds for equivalence
+ *
+ * Parameters:
+ * bounds - {<OpenLayers.Bounds>}
+ *
+ * Return:
+ * {Boolean} The passed-in OpenLayers.Bounds object has the same left,
+ * right, top, bottom components as this. Note that if bounds
+ * passed in is null, returns false.
+ */
+ equals:function(bounds) {
+ var equals = false;
+ if (bounds != null) {
+ equals = ((this.left == bounds.left) &&
+ (this.right == bounds.right) &&
+ (this.top == bounds.top) &&
+ (this.bottom == bounds.bottom));
+ }
+ return equals;
+ },
+
+ /**
+ * APIMethod: toString
+ *
+ * Return:
+ * {String} String representation of OpenLayers.Bounds object.
+ * (ex.<i>"left-bottom=(5,42) right-top=(10,45)"</i>)
+ */
+ toString:function() {
+ return ( "left-bottom=(" + this.left + "," + this.bottom + ")"
+ + " right-top=(" + this.right + "," + this.top + ")" );
+ },
+
+ /**
+ * APIMethod: toBBOX
+ *
+ * Parameters:
+ * decimal - {Integer} How many significant digits in the bbox coords?
+ * Default is 6
+ *
+ * Return:
+ * {String} Simple String representation of OpenLayers.Bounds object.
+ * (ex. <i>"5,42,10,45"</i>)
+ */
+ toBBOX:function(decimal) {
+ if (decimal== null) {
+ decimal = 6;
+ }
+ var mult = Math.pow(10, decimal);
+ var bbox = Math.round(this.left * mult) / mult + "," +
+ Math.round(this.bottom * mult) / mult + "," +
+ Math.round(this.right * mult) / mult + "," +
+ Math.round(this.top * mult) / mult;
+
+ return bbox;
+ },
+
+ /**
+ * APIMethod: getWidth
+ *
+ * Return:
+ * {Float} The width of the bounds
+ */
+ getWidth:function() {
+ return (this.right - this.left);
+ },
+
+ /**
+ * APIMethod: getHeight
+ *
+ * Return:
+ * {Float} The height of the bounds
+ */
+ getHeight:function() {
+ return (this.top - this.bottom);
+ },
+
+ /**
+ * APIMethod: getSize
+ *
+ * Return:
+ * {<OpenLayers.Size>} An <OpenLayers.Size> which represents the size of the box
+ */
+ getSize:function() {
+ return new OpenLayers.Size(this.getWidth(), this.getHeight());
+ },
+
+ /**
+ * APIMethod: getCenterPixel
+ *
+ * Return:
+ * {<OpenLayers.Pixel>} An <OpenLayers.Pixel> which represents the center
+ * of the bounds
+ */
+ getCenterPixel:function() {
+ return new OpenLayers.Pixel( (this.left + this.right) / 2,
+ (this.bottom + this.top) / 2);
+ },
+
+ /**
+ * APIMethod: getCenterLonLat
+ *
+ * Return:
+ * {<OpenLayers.LonLat>} An <OpenLayers.LonLat> which represents the center
+ * of the bounds
+ */
+ getCenterLonLat:function() {
+ return new OpenLayers.LonLat( (this.left + this.right) / 2,
+ (this.bottom + this.top) / 2);
+ },
+
+ /**
+ * APIMethod: add
+ *
+ * Parameters:
+ * x - {Float}
+ * y - {Float}
+ *
+ * Return:
+ * {<OpenLayers.Bounds>} A new <OpenLayers.Bounds> whose coordinates are
+ * the same as this, but shifted by the passed-in
+ * x and y values
+ */
+ add:function(x, y) {
+ return new OpenLayers.Bounds(this.left + x, this.bottom + y,
+ this.right + x, this.top + y);
+ },
+
+ /**
+ * APIMethod: extend
+ * Extend the bounds to include the point, lonlat, or bounds specified.
+ * Note: This function assumes that left<right and bottom<top.
+ *
+ *
+ * Parameters:
+ * object - {Object} Can be LonLat, Point, or Bounds
+ */
+ extend:function(object) {
+ var bounds = null;
+ if (object) {
+ switch(object.CLASS_NAME) {
+ case "OpenLayers.LonLat":
+ bounds = new OpenLayers.Bounds(object.lon, object.lat,
+ object.lon, object.lat);
+ break;
+ case "OpenLayers.Geometry.Point":
+ bounds = new OpenLayers.Bounds(object.x, object.y,
+ object.x, object.y);
+ break;
+
+ case "OpenLayers.Bounds":
+ bounds = object;
+ break;
+ }
+
+ if (bounds) {
+ this.left = (bounds.left < this.left) ? bounds.left
+ : this.left;
+ this.bottom = (bounds.bottom < this.bottom) ? bounds.bottom
+ : this.bottom;
+ this.right = (bounds.right > this.right) ? bounds.right
+ : this.right;
+ this.top = (bounds.top > this.top) ? bounds.top
+ : this.top;
+ }
+ }
+ },
+
+ /**
+ * APIMethod: containsLonLat
+ *
+ * Parameters:
+ * ll - {<OpenLayers.LonLat>}
+ * inclusive - {Boolean} Whether or not to include the border.
+ * Default is true.
+ *
+ * Return:
+ * {Boolean} Whether or not the passed-in lonlat is within this bounds.
+ */
+ containsLonLat:function(ll, inclusive) {
+ return this.contains(ll.lon, ll.lat, inclusive);
+ },
+
+ /**
+ * APIMethod: containsPixel
+ *
+ * Parameters:
+ * px - {<OpenLayers.Pixel>}
+ * inclusive - {Boolean} Whether or not to include the border.
+ * Default is true.
+ *
+ * Return:
+ * {Boolean} Whether or not the passed-in pixel is within this bounds.
+ */
+ containsPixel:function(px, inclusive) {
+ return this.contains(px.x, px.y, inclusive);
+ },
+
+ /**
+ * APIMethod: contains
+ *
+ * Parameters:
+ * x - {Float}
+ * y - {Float}
+ * inclusive - {Boolean} Whether or not to include the border.
+ * Default is true.
+ *
+ * Return:
+ * {Boolean} Whether or not the passed-in coordinates are within this
+ * bounds.
+ */
+ contains:function(x, y, inclusive) {
+
+ //set default
+ if (inclusive == null) {
+ inclusive = true;
+ }
+
+ var contains = false;
+ if (inclusive) {
+ contains = ((x >= this.left) && (x <= this.right) &&
+ (y >= this.bottom) && (y <= this.top));
+ } else {
+ contains = ((x > this.left) && (x < this.right) &&
+ (y > this.bottom) && (y < this.top));
+ }
+ return contains;
+ },
+
+ /**
+ * APIMethod: intersectsBounds
+ *
+ * Parameters:
+ * bounds - {<OpenLayers.Bounds>}
+ * inclusive - {<Boolean>} Whether or not to include the border.
+ * Default is true.
+ *
+ * Return:
+ * {Boolean} Whether or not the passed-in OpenLayers.Bounds object
+ * intersects this bounds. Simple math just check if either
+ * contains the other, allowing for partial.
+ */
+ intersectsBounds:function(bounds, inclusive) {
+
+ if (inclusive == null) {
+ inclusive = true;
+ }
+ var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ?
+ true : (((bounds.bottom > this.bottom) && (bounds.bottom < this.top)) ||
+ ((this.bottom > bounds.bottom) && (this.bottom < bounds.top)));
+ var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ?
+ true : (((bounds.top > this.bottom) && (bounds.top < this.top)) ||
+ ((this.top > bounds.bottom) && (this.top < bounds.top)));
+ var inRight = (bounds.right == this.right && bounds.left == this.left) ?
+ true : (((bounds.right > this.left) && (bounds.right < this.right)) ||
+ ((this.right > bounds.left) && (this.right < bounds.right)));
+ var inLeft = (bounds.right == this.right && bounds.left == this.left) ?
+ true : (((bounds.left > this.left) && (bounds.left < this.right)) ||
+ ((this.left > bounds.left) && (this.left < bounds.right)));
+
+ return (this.containsBounds(bounds, true, inclusive) ||
+ bounds.containsBounds(this, true, inclusive) ||
+ ((inTop || inBottom ) && (inLeft || inRight )));
+ },
+
+ /**
+ * APIMethod: containsBounds
+ *
+ * bounds - {<OpenLayers.Bounds>}
+ * partial - {<Boolean>} If true, only part of passed-in
+ * <OpenLayers.Bounds> needs be within this bounds.
+ * If false, the entire passed-in bounds must be
+ * within. Default is false
+ * inclusive - {<Boolean>} Whether or not to include the border.
+ * Default is true.
+ *
+ * Return:
+ * {Boolean} Whether or not the passed-in OpenLayers.Bounds object is
+ * contained within this bounds.
+ */
+ containsBounds:function(bounds, partial, inclusive) {
+
+ //set defaults
+ if (partial == null) {
+ partial = false;
+ }
+ if (inclusive == null) {
+ inclusive = true;
+ }
+
+ var inLeft;
+ var inTop;
+ var inRight;
+ var inBottom;
+
+ if (inclusive) {
+ inLeft = (bounds.left >= this.left) && (bounds.left <= this.right);
+ inTop = (bounds.top >= this.bottom) && (bounds.top <= this.top);
+ inRight= (bounds.right >= this.left) && (bounds.right <= this.right);
+ inBottom = (bounds.bottom >= this.bottom) && (bounds.bottom <= this.top);
+ } else {
+ inLeft = (bounds.left > this.left) && (bounds.left < this.right);
+ inTop = (bounds.top > this.bottom) && (bounds.top < this.top);
+ inRight= (bounds.right > this.left) && (bounds.right < this.right);
+ inBottom = (bounds.bottom > this.bottom) && (bounds.bottom < this.top);
+ }
+
+ return (partial) ? (inTop || inBottom ) && (inLeft || inRight )
+ : (inTop && inLeft && inBottom && inRight);
+ },
+
+ /**
+ * APIMethod: determineQuadrant
+ *
+ * Parameters:
+ * lonlat - {<OpenLayers.LonLat>}
+ *
+ * Return:
+ * {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which
+ * the coordinate lies.
+ */
+ determineQuadrant: function(lonlat) {
+
+ var quadrant = "";
+ var center = this.getCenterLonLat();
+
+ quadrant += (lonlat.lat < center.lat) ? "b" : "t";
+ quadrant += (lonlat.lon < center.lon) ? "l" : "r";
+
+ return quadrant;
+ },
+
+ /**
+ * APIMethod: wrapDateLine
+ *
+ * Parameters:
+ * maxExtent - {<OpenLayers.Bounds>}
+ * options - {Object} Some possible options are:
+ * leftTolerance - {float} Allow for a margin of error
+ * with the 'left' value of this
+ * bound.
+ * Default is 0.
+ * rightTolerance - {float} Allow for a margin of error
+ * with the 'right' value of
+ * this bound.
+ * Default is 0.
+ *
+ * Return:
+ * {<OpenLayers.Bounds>} A copy of this bounds, but wrapped around the
+ * "dateline" (as specified by the borders of
+ * maxExtent). Note that this function only returns
+ * a different bounds value if this bounds is
+ * *entirely* outside of the maxExtent. If this
+ * bounds straddles the dateline (is part in/part
+ * out of maxExtent), the returned bounds will be
+ * merely a copy of this one.
+ */
+ wrapDateLine: function(maxExtent, options) {
+ options = options || new Object();
+
+ var leftTolerance = options.leftTolerance || 0;
+ var rightTolerance = options.rightTolerance || 0;
+
+ var newBounds = this.clone();
+
+ if (maxExtent) {
+
+ //shift right?
+ while ( newBounds.left < maxExtent.left &&
+ (newBounds.right - rightTolerance) <= maxExtent.left ) {
+ newBounds = newBounds.add(maxExtent.getWidth(), 0);
+ }
+
+ //shift left?
+ while ( (newBounds.left + leftTolerance) >= maxExtent.right &&
+ newBounds.right > maxExtent.right ) {
+ newBounds = newBounds.add(-maxExtent.getWidth(), 0);
+ }
+ }
+
+ return newBounds;
+ },
+
+ /** @final @type String */
+ CLASS_NAME: "OpenLayers.Bounds"
+};
+
+/**
+ * APIFunction: fromString
+ * Alternative constructor that builds a new OpenLayers.Bounds from a
+ * parameter string
+ *
+ * Parameters:
+ * str - {String}Comma-separated bounds string. (ex. <i>"5,42,10,45"</i>)
+ *
+ * Return:
+ * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
+ * passed-in String.
+ */
+OpenLayers.Bounds.fromString = function(str) {
+ var bounds = str.split(",");
+ return OpenLayers.Bounds.fromArray(bounds);
+};
+
+/**
+ * APIFunction: fromArray
+ * Alternative constructor that builds a new OpenLayers.Bounds
+ * from an array
+ *
+ * Parameters:
+ * bbox - {Array} Array of bounds values (ex. <i>[5,42,10,45]</i>)
+ *
+ * Return:
+ * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
+ * passed-in Array.
+ */
+OpenLayers.Bounds.fromArray = function(bbox) {
+ return new OpenLayers.Bounds(parseFloat(bbox[0]),
+ parseFloat(bbox[1]),
+ parseFloat(bbox[2]),
+ parseFloat(bbox[3]));
+};
+
+/**
+ * APIFunction: fromSize
+ * Alternative constructor that builds a new OpenLayers.Bounds
+ * from a size
+ *
+ * Parameters:
+ * size - {<OpenLayers.Size>}
+ *
+ * Return:
+ * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
+ * passed-in size.
+ */
+OpenLayers.Bounds.fromSize = function(size) {
+ return new OpenLayers.Bounds(0,
+ size.h,
+ size.w,
+ 0);
+};
+
+/**
+ * Function: oppositeQuadrant
+ * Get the opposite quadrant for a given quadrant string.
+ *
+ * Parameters:
+ * quadrant - {String} two character quadrant shortstring
+ *
+ * Return:
+ * {String} The opposing quadrant ("br" "tr" "tl" "bl"). For Example, if
+ * you pass in "bl" it returns "tr", if you pass in "br" it
+ * returns "tl", etc.
+ */
+OpenLayers.Bounds.oppositeQuadrant = function(quadrant) {
+ var opp = "";
+
+ opp += (quadrant.charAt(0) == 't') ? 'b' : 't';
+ opp += (quadrant.charAt(1) == 'l') ? 'r' : 'l';
+
+ return opp;
+};
Deleted: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Class.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/BaseTypes/Class.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Class.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -1,67 +0,0 @@
-/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
- * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
- * for the full text of the license. */
-
-/**
- * Namespace: OpenLayers.Class
- * Contains functions to create OpenLayers style classes.
- */
-OpenLayers.Class = {
- isPrototype: function () {}, // magic anonymous value
-
- /**
- * APIFunction: create
- * Create an OpenLayers style class
- *
- * Return:
- * An OpenLayers class
- */
- create: function() {
- return function() {
- if (arguments && arguments[0] != OpenLayers.Class.isPrototype)
- this.initialize.apply(this, arguments);
- }
- },
-
- /**
- * APIFunction: inherit
- * Inherit from one or more OpenLayers style classes
- *
- * Parameters:
- * class - One or more classes can be provided as arguments
- *
- * Return:
- * An object prototype
- */
- inherit: function () {
- var superClass = arguments[0];
- var proto = new superClass(OpenLayers.Class.isPrototype);
- for (var i = 1; i < arguments.length; i++) {
- if (typeof arguments[i] == "function") {
- var mixin = arguments[i];
- arguments[i] = new mixin(OpenLayers.Class.isPrototype);
- }
- OpenLayers.Util.extend(proto, arguments[i]);
-
- // This is a hack for IE see
- // http://trac.openlayers.org/attachment/ticket/552
- //
- // The problem is that ie doesnt recognize toString as a property
- // so the util.extend() doesnt copy it over. we do it manually.
- //
- // to be revisited in 3.0
- //
- if((arguments[i].hasOwnProperty && arguments[i].hasOwnProperty('toString')) ||
- (!arguments[i].hasOwnProperty && arguments[i].toString)) {
- proto.toString = arguments[i].toString;
- }
- }
- return proto;
- }
-};
-
-/*
- OpenLayers.Class.inherit( OpenLayers.Layer.Grid, OpenLayers.Layer.HTTPRequest, {
- some stuff
- });
-*/
\ No newline at end of file
Copied: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Class.js (from rev 3607, trunk/openlayers/lib/OpenLayers/BaseTypes/Class.js)
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Class.js (rev 0)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Class.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -0,0 +1,67 @@
+/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
+ * for the full text of the license. */
+
+/**
+ * Namespace: OpenLayers.Class
+ * Contains functions to create OpenLayers style classes.
+ */
+OpenLayers.Class = {
+ isPrototype: function () {}, // magic anonymous value
+
+ /**
+ * APIFunction: create
+ * Create an OpenLayers style class
+ *
+ * Return:
+ * An OpenLayers class
+ */
+ create: function() {
+ return function() {
+ if (arguments && arguments[0] != OpenLayers.Class.isPrototype)
+ this.initialize.apply(this, arguments);
+ }
+ },
+
+ /**
+ * APIFunction: inherit
+ * Inherit from one or more OpenLayers style classes
+ *
+ * Parameters:
+ * class - One or more classes can be provided as arguments
+ *
+ * Return:
+ * An object prototype
+ */
+ inherit: function () {
+ var superClass = arguments[0];
+ var proto = new superClass(OpenLayers.Class.isPrototype);
+ for (var i = 1; i < arguments.length; i++) {
+ if (typeof arguments[i] == "function") {
+ var mixin = arguments[i];
+ arguments[i] = new mixin(OpenLayers.Class.isPrototype);
+ }
+ OpenLayers.Util.extend(proto, arguments[i]);
+
+ // This is a hack for IE see
+ // http://trac.openlayers.org/attachment/ticket/552
+ //
+ // The problem is that ie doesnt recognize toString as a property
+ // so the util.extend() doesnt copy it over. we do it manually.
+ //
+ // to be revisited in 3.0
+ //
+ if((arguments[i].hasOwnProperty && arguments[i].hasOwnProperty('toString')) ||
+ (!arguments[i].hasOwnProperty && arguments[i].toString)) {
+ proto.toString = arguments[i].toString;
+ }
+ }
+ return proto;
+ }
+};
+
+/*
+ OpenLayers.Class.inherit( OpenLayers.Layer.Grid, OpenLayers.Layer.HTTPRequest, {
+ some stuff
+ });
+*/
\ No newline at end of file
Deleted: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Element.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/BaseTypes/Element.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Element.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -1,160 +0,0 @@
-/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
- * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
- * for the full text of the license. */
-
-/**
- * Namespace: OpenLayers.Element
- */
-OpenLayers.Element = {
-
- /**
- * APIFunction: visible
- *
- * Parameters:
- * element - {DOMElement}
- *
- * Return:
- * {Boolean} Is the element visible?
- */
- visible: function(element) {
- return OpenLayers.Util.getElement(element).style.display != 'none';
- },
-
- /**
- * APIFunction: toggle
- * Toggle the visibility of element(s) passed in
- *
- * Parameters:
- * element - {DOMElement} Actually user can pass any number of elements
- */
- toggle: function() {
- for (var i = 0; i < arguments.length; i++) {
- var element = OpenLayers.Util.getElement(arguments[i]);
- var display = OpenLayers.Element.visible(element) ? 'hide'
- : 'show';
- OpenLayers.Element[display](element);
- }
- },
-
-
- /**
- * APIFunction: hide
- * Hide element(s) passed in
- *
- * Parameters:
- * element - {DOMElement} Actually user can pass any number of elements
- */
- hide: function() {
- for (var i = 0; i < arguments.length; i++) {
- var element = OpenLayers.Util.getElement(arguments[i]);
- element.style.display = 'none';
- }
- },
-
- /**
- * APIFunction: show
- * Show element(s) passed in
- *
- * Parameters:
- * element - {DOMElement} Actually user can pass any number of elements
- */
- show: function() {
- for (var i = 0; i < arguments.length; i++) {
- var element = OpenLayers.Util.getElement(arguments[i]);
- element.style.display = '';
- }
- },
-
- /**
- * APIFunction: remove
- * Remove the specified element from the DOM.
- *
- * Parameters:
- * element - {DOMElement}
- */
- remove: function(element) {
- element = OpenLayers.Util.getElement(element);
- element.parentNode.removeChild(element);
- },
-
- /**
- * APIFunction: getHeight
- *
- * Parameters:
- * element - {DOMElement}
- *
- * Return:
- * {Integer} The offset height of the element passed in
- */
- getHeight: function(element) {
- element = OpenLayers.Util.getElement(element);
- return element.offsetHeight;
- },
-
- /**
- * APIFunction: getDimensions
- *
- * Parameters:
- * element - {DOMElement}
- *
- * Return:
- * {Object} Object with 'width' and 'height' properties which are the
- * dimensions of the element passed in.
- */
- getDimensions: function(element) {
- element = OpenLayers.Util.getElement(element);
- if (OpenLayers.Element.getStyle(element, 'display') != 'none') {
- return {width: element.offsetWidth, height: element.offsetHeight};
- }
-
- // All *Width and *Height properties give 0 on elements with display none,
- // so enable the element temporarily
- var els = element.style;
- var originalVisibility = els.visibility;
- var originalPosition = els.position;
- els.visibility = 'hidden';
- els.position = 'absolute';
- els.display = '';
- var originalWidth = element.clientWidth;
- var originalHeight = element.clientHeight;
- els.display = 'none';
- els.position = originalPosition;
- els.visibility = originalVisibility;
- return {width: originalWidth, height: originalHeight};
- },
-
- /**
- * APIFunction: getStyle
- *
- * Parameters:
- * element - {DOMElement}
- * style - {?}
- *
- * Return:
- * {?}
- */
- getStyle: function(element, style) {
- element = OpenLayers.Util.getElement(element);
- var value = element.style[style.camelize()];
- if (!value) {
- if (document.defaultView &&
- document.defaultView.getComputedStyle) {
-
- var css = document.defaultView.getComputedStyle(element, null);
- value = css ? css.getPropertyValue(style) : null;
- } else if (element.currentStyle) {
- value = element.currentStyle[style.camelize()];
- }
- }
-
- var positions = ['left', 'top', 'right', 'bottom'];
- if (window.opera &&
- (OpenLayers.Util.indexOf(positions,style) != -1) &&
- (OpenLayers.Element.getStyle(element, 'position') == 'static')) {
- value = 'auto';
- }
-
- return value == 'auto' ? null : value;
- }
-
-};
Copied: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Element.js (from rev 3607, trunk/openlayers/lib/OpenLayers/BaseTypes/Element.js)
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Element.js (rev 0)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Element.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -0,0 +1,160 @@
+/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
+ * for the full text of the license. */
+
+/**
+ * Namespace: OpenLayers.Element
+ */
+OpenLayers.Element = {
+
+ /**
+ * APIFunction: visible
+ *
+ * Parameters:
+ * element - {DOMElement}
+ *
+ * Return:
+ * {Boolean} Is the element visible?
+ */
+ visible: function(element) {
+ return OpenLayers.Util.getElement(element).style.display != 'none';
+ },
+
+ /**
+ * APIFunction: toggle
+ * Toggle the visibility of element(s) passed in
+ *
+ * Parameters:
+ * element - {DOMElement} Actually user can pass any number of elements
+ */
+ toggle: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = OpenLayers.Util.getElement(arguments[i]);
+ var display = OpenLayers.Element.visible(element) ? 'hide'
+ : 'show';
+ OpenLayers.Element[display](element);
+ }
+ },
+
+
+ /**
+ * APIFunction: hide
+ * Hide element(s) passed in
+ *
+ * Parameters:
+ * element - {DOMElement} Actually user can pass any number of elements
+ */
+ hide: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = OpenLayers.Util.getElement(arguments[i]);
+ element.style.display = 'none';
+ }
+ },
+
+ /**
+ * APIFunction: show
+ * Show element(s) passed in
+ *
+ * Parameters:
+ * element - {DOMElement} Actually user can pass any number of elements
+ */
+ show: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = OpenLayers.Util.getElement(arguments[i]);
+ element.style.display = '';
+ }
+ },
+
+ /**
+ * APIFunction: remove
+ * Remove the specified element from the DOM.
+ *
+ * Parameters:
+ * element - {DOMElement}
+ */
+ remove: function(element) {
+ element = OpenLayers.Util.getElement(element);
+ element.parentNode.removeChild(element);
+ },
+
+ /**
+ * APIFunction: getHeight
+ *
+ * Parameters:
+ * element - {DOMElement}
+ *
+ * Return:
+ * {Integer} The offset height of the element passed in
+ */
+ getHeight: function(element) {
+ element = OpenLayers.Util.getElement(element);
+ return element.offsetHeight;
+ },
+
+ /**
+ * APIFunction: getDimensions
+ *
+ * Parameters:
+ * element - {DOMElement}
+ *
+ * Return:
+ * {Object} Object with 'width' and 'height' properties which are the
+ * dimensions of the element passed in.
+ */
+ getDimensions: function(element) {
+ element = OpenLayers.Util.getElement(element);
+ if (OpenLayers.Element.getStyle(element, 'display') != 'none') {
+ return {width: element.offsetWidth, height: element.offsetHeight};
+ }
+
+ // All *Width and *Height properties give 0 on elements with display none,
+ // so enable the element temporarily
+ var els = element.style;
+ var originalVisibility = els.visibility;
+ var originalPosition = els.position;
+ els.visibility = 'hidden';
+ els.position = 'absolute';
+ els.display = '';
+ var originalWidth = element.clientWidth;
+ var originalHeight = element.clientHeight;
+ els.display = 'none';
+ els.position = originalPosition;
+ els.visibility = originalVisibility;
+ return {width: originalWidth, height: originalHeight};
+ },
+
+ /**
+ * APIFunction: getStyle
+ *
+ * Parameters:
+ * element - {DOMElement}
+ * style - {?}
+ *
+ * Return:
+ * {?}
+ */
+ getStyle: function(element, style) {
+ element = OpenLayers.Util.getElement(element);
+ var value = element.style[style.camelize()];
+ if (!value) {
+ if (document.defaultView &&
+ document.defaultView.getComputedStyle) {
+
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css.getPropertyValue(style) : null;
+ } else if (element.currentStyle) {
+ value = element.currentStyle[style.camelize()];
+ }
+ }
+
+ var positions = ['left', 'top', 'right', 'bottom'];
+ if (window.opera &&
+ (OpenLayers.Util.indexOf(positions,style) != -1) &&
+ (OpenLayers.Element.getStyle(element, 'position') == 'static')) {
+ value = 'auto';
+ }
+
+ return value == 'auto' ? null : value;
+ }
+
+};
Deleted: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/LonLat.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/BaseTypes/LonLat.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/LonLat.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -1,158 +0,0 @@
-/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
- * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
- * for the full text of the license. */
-
-/**
- * Class: OpenLayers.LonLat
- * This class represents a longitude and latitude pair
- */
-OpenLayers.LonLat = OpenLayers.Class.create();
-OpenLayers.LonLat.prototype = {
-
- /**
- * APIProperty: lon
- * {Float}
- */
- lon: 0.0,
-
- /**
- * APIProperty: lat
- * {Float}
- */
- lat: 0.0,
-
- /**
- * Constructor: OpenLayers.LonLat
- * Create a new OpenLayers.LonLat instance
- *
- * Parameters:
- * lon - {Number} The lon coordinate
- * lat - {Number} The lat coordinate
- */
- initialize: function(lon, lat) {
- this.lon = parseFloat(lon);
- this.lat = parseFloat(lat);
- },
-
- /**
- * Method: toString
- * Return a readable string version of the lonlat
- *
- * Return:
- * {String} String representation of OpenLayers.LonLat object.
- * (ex. <i>"lon=5,lat=42"</i>)
- */
- toString:function() {
- return ("lon=" + this.lon + ",lat=" + this.lat);
- },
-
- /**
- * APIMethod: toShortString
- *
- * Return:
- * {String} Shortened String representation of OpenLayers.LonLat object.
- * (ex. <i>"5, 42"</i>)
- */
- toShortString:function() {
- return (this.lon + ", " + this.lat);
- },
-
- /**
- * APIMethod: clone
- *
- * Return:
- * {<OpenLayers.LonLat>} New OpenLayers.LonLat object with the same lon
- * and lat values
- */
- clone:function() {
- return new OpenLayers.LonLat(this.lon, this.lat);
- },
-
- /**
- * APIMethod: add
- *
- * Parameters:
- * lon - {Float}
- * lat - {Float}
- *
- * Return:
- * {<OpenLayers.LonLat>} A new OpenLayers.LonLat object with the lon and
- * lat passed-in added to this's.
- */
- add:function(lon, lat) {
- return new OpenLayers.LonLat(this.lon + lon, this.lat + lat);
- },
-
- /**
- * APIMethod: equals
- *
- * Parameters:
- * ll - {<OpenLayers.LonLat>}
- *
- * Return:
- * {Boolean} Boolean value indicating whether the passed-in
- * <OpenLayers.LonLat> object has the same lon and lat
- * components as this.
- * Note: if ll passed in is null, returns false
- */
- equals:function(ll) {
- var equals = false;
- if (ll != null) {
- equals = ((this.lon == ll.lon && this.lat == ll.lat) ||
- (isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat)));
- }
- return equals;
- },
-
- /**
- * APIMethod: wrapDateLine
- *
- * Parameters:
- * maxExtent - {<OpenLayers.Bounds>}
- *
- * Return:
- * {<OpenLayers.LonLat>} A copy of this lonlat, but wrapped around the
- * "dateline" (as specified by the borders of
- * maxExtent)
- */
- wrapDateLine: function(maxExtent) {
-
- var newLonLat = this.clone();
-
- if (maxExtent) {
- //shift right?
- while (newLonLat.lon < maxExtent.left) {
- newLonLat.lon += maxExtent.getWidth();
- }
-
- //shift left?
- while (newLonLat.lon > maxExtent.right) {
- newLonLat.lon -= maxExtent.getWidth();
- }
- }
-
- return newLonLat;
- },
-
- /** @final @type String */
- CLASS_NAME: "OpenLayers.LonLat"
-};
-
-/**
- * Function: fromString
- * Alternative constructor that builds a new <OpenLayers.LonLat> from a
- * parameter string
- *
- * Parameters:
- * str - {String} Comma-separated Lon,Lat coordinate string.
- * (ex. <i>"5,40"</i>)
- *
- * Return:
- * {<OpenLayers.LonLat>} New <OpenLayers.LonLat> object built from the
- * passed-in String.
- */
-OpenLayers.LonLat.fromString = function(str) {
- var pair = str.split(",");
- return new OpenLayers.LonLat(parseFloat(pair[0]),
- parseFloat(pair[1]));
-};
\ No newline at end of file
Copied: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/LonLat.js (from rev 3607, trunk/openlayers/lib/OpenLayers/BaseTypes/LonLat.js)
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/LonLat.js (rev 0)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/LonLat.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -0,0 +1,158 @@
+/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
+ * for the full text of the license. */
+
+/**
+ * Class: OpenLayers.LonLat
+ * This class represents a longitude and latitude pair
+ */
+OpenLayers.LonLat = OpenLayers.Class.create();
+OpenLayers.LonLat.prototype = {
+
+ /**
+ * APIProperty: lon
+ * {Float}
+ */
+ lon: 0.0,
+
+ /**
+ * APIProperty: lat
+ * {Float}
+ */
+ lat: 0.0,
+
+ /**
+ * Constructor: OpenLayers.LonLat
+ * Create a new OpenLayers.LonLat instance
+ *
+ * Parameters:
+ * lon - {Number} The lon coordinate
+ * lat - {Number} The lat coordinate
+ */
+ initialize: function(lon, lat) {
+ this.lon = parseFloat(lon);
+ this.lat = parseFloat(lat);
+ },
+
+ /**
+ * Method: toString
+ * Return a readable string version of the lonlat
+ *
+ * Return:
+ * {String} String representation of OpenLayers.LonLat object.
+ * (ex. <i>"lon=5,lat=42"</i>)
+ */
+ toString:function() {
+ return ("lon=" + this.lon + ",lat=" + this.lat);
+ },
+
+ /**
+ * APIMethod: toShortString
+ *
+ * Return:
+ * {String} Shortened String representation of OpenLayers.LonLat object.
+ * (ex. <i>"5, 42"</i>)
+ */
+ toShortString:function() {
+ return (this.lon + ", " + this.lat);
+ },
+
+ /**
+ * APIMethod: clone
+ *
+ * Return:
+ * {<OpenLayers.LonLat>} New OpenLayers.LonLat object with the same lon
+ * and lat values
+ */
+ clone:function() {
+ return new OpenLayers.LonLat(this.lon, this.lat);
+ },
+
+ /**
+ * APIMethod: add
+ *
+ * Parameters:
+ * lon - {Float}
+ * lat - {Float}
+ *
+ * Return:
+ * {<OpenLayers.LonLat>} A new OpenLayers.LonLat object with the lon and
+ * lat passed-in added to this's.
+ */
+ add:function(lon, lat) {
+ return new OpenLayers.LonLat(this.lon + lon, this.lat + lat);
+ },
+
+ /**
+ * APIMethod: equals
+ *
+ * Parameters:
+ * ll - {<OpenLayers.LonLat>}
+ *
+ * Return:
+ * {Boolean} Boolean value indicating whether the passed-in
+ * <OpenLayers.LonLat> object has the same lon and lat
+ * components as this.
+ * Note: if ll passed in is null, returns false
+ */
+ equals:function(ll) {
+ var equals = false;
+ if (ll != null) {
+ equals = ((this.lon == ll.lon && this.lat == ll.lat) ||
+ (isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat)));
+ }
+ return equals;
+ },
+
+ /**
+ * APIMethod: wrapDateLine
+ *
+ * Parameters:
+ * maxExtent - {<OpenLayers.Bounds>}
+ *
+ * Return:
+ * {<OpenLayers.LonLat>} A copy of this lonlat, but wrapped around the
+ * "dateline" (as specified by the borders of
+ * maxExtent)
+ */
+ wrapDateLine: function(maxExtent) {
+
+ var newLonLat = this.clone();
+
+ if (maxExtent) {
+ //shift right?
+ while (newLonLat.lon < maxExtent.left) {
+ newLonLat.lon += maxExtent.getWidth();
+ }
+
+ //shift left?
+ while (newLonLat.lon > maxExtent.right) {
+ newLonLat.lon -= maxExtent.getWidth();
+ }
+ }
+
+ return newLonLat;
+ },
+
+ /** @final @type String */
+ CLASS_NAME: "OpenLayers.LonLat"
+};
+
+/**
+ * Function: fromString
+ * Alternative constructor that builds a new <OpenLayers.LonLat> from a
+ * parameter string
+ *
+ * Parameters:
+ * str - {String} Comma-separated Lon,Lat coordinate string.
+ * (ex. <i>"5,40"</i>)
+ *
+ * Return:
+ * {<OpenLayers.LonLat>} New <OpenLayers.LonLat> object built from the
+ * passed-in String.
+ */
+OpenLayers.LonLat.fromString = function(str) {
+ var pair = str.split(",");
+ return new OpenLayers.LonLat(parseFloat(pair[0]),
+ parseFloat(pair[1]));
+};
\ No newline at end of file
Deleted: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Pixel.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/BaseTypes/Pixel.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Pixel.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -1,117 +0,0 @@
-/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
- * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
- * for the full text of the license. */
-
-/**
- * Class: OpenLayers.Pixel
- * This class represents a screen coordinate, in x and y coordinates
- */
-OpenLayers.Pixel = OpenLayers.Class.create();
-OpenLayers.Pixel.prototype = {
-
- /**
- * APIProperty: x
- * {Number} The x coordinate
- */
- x: 0.0,
-
- /**
- * APIProperty: y
- * {Number} The y coordinate
- */
- y: 0.0,
-
- /**
- * Constructor: OpenLayers.Pixel
- * Create a new OpenLayers.Pixel instance
- *
- * Parameters:
- * x - {Number} The x coordinate
- * y - {Number} The y coordinate
- *
- * Return:
- * An instance of OpenLayers.Pixel
- */
- initialize: function(x, y) {
- this.x = parseFloat(x);
- this.y = parseFloat(y);
- },
-
- /**
- * Method: toString
- * Cast this object into a string
- *
- * Return:
- * {String} The string representation of Pixel. ex: "x=200.4,y=242.2"
- */
- toString:function() {
- return ("x=" + this.x + ",y=" + this.y);
- },
-
- /**
- * APIMethod: clone
- * Return a clone of this pixel object
- *
- * Return:
- * {<OpenLayers.Pixel>} A clone pixel
- */
- clone:function() {
- return new OpenLayers.Pixel(this.x, this.y);
- },
-
- /**
- * APIMethod: equals
- * Determine whether one pixel is equivalent to another
- *
- * Parameters:
- * px - {<OpenLayers.Pixel>}
- *
- * Return:
- * {Boolean} The point passed in as parameter is equal to this. Note that
- * if px passed in is null, returns false.
- */
- equals:function(px) {
- var equals = false;
- if (px != null) {
- equals = ((this.x == px.x && this.y == px.y) ||
- (isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y)));
- }
- return equals;
- },
-
- /**
- * APIMethod: add
- *
- * Parameters:
- * x - {Integer}
- * y - {Integer}
- *
- * Return:
- * {<OpenLayers.Pixel>} A new Pixel with this pixel's x&y augmented by the
- * values passed in.
- */
- add:function(x, y) {
- return new OpenLayers.Pixel(this.x + x, this.y + y);
- },
-
- /**
- * APIMethod: offset
- *
- * Parameters
- * px - {<OpenLayers.Pixel>}
- *
- * Return:
- * {<OpenLayers.Pixel>} A new Pixel with this pixel's x&y augmented by the
- * x&y values of the pixel passed in.
- */
- offset:function(px) {
- var newPx = this.clone();
- if (px) {
- newPx = this.add(px.x, px.y);
- }
- return newPx;
- },
-
- /** @final @type str */
- CLASS_NAME: "OpenLayers.Pixel"
-};
\ No newline at end of file
Copied: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Pixel.js (from rev 3607, trunk/openlayers/lib/OpenLayers/BaseTypes/Pixel.js)
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Pixel.js (rev 0)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Pixel.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -0,0 +1,117 @@
+/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
+ * for the full text of the license. */
+
+/**
+ * Class: OpenLayers.Pixel
+ * This class represents a screen coordinate, in x and y coordinates
+ */
+OpenLayers.Pixel = OpenLayers.Class.create();
+OpenLayers.Pixel.prototype = {
+
+ /**
+ * APIProperty: x
+ * {Number} The x coordinate
+ */
+ x: 0.0,
+
+ /**
+ * APIProperty: y
+ * {Number} The y coordinate
+ */
+ y: 0.0,
+
+ /**
+ * Constructor: OpenLayers.Pixel
+ * Create a new OpenLayers.Pixel instance
+ *
+ * Parameters:
+ * x - {Number} The x coordinate
+ * y - {Number} The y coordinate
+ *
+ * Return:
+ * An instance of OpenLayers.Pixel
+ */
+ initialize: function(x, y) {
+ this.x = parseFloat(x);
+ this.y = parseFloat(y);
+ },
+
+ /**
+ * Method: toString
+ * Cast this object into a string
+ *
+ * Return:
+ * {String} The string representation of Pixel. ex: "x=200.4,y=242.2"
+ */
+ toString:function() {
+ return ("x=" + this.x + ",y=" + this.y);
+ },
+
+ /**
+ * APIMethod: clone
+ * Return a clone of this pixel object
+ *
+ * Return:
+ * {<OpenLayers.Pixel>} A clone pixel
+ */
+ clone:function() {
+ return new OpenLayers.Pixel(this.x, this.y);
+ },
+
+ /**
+ * APIMethod: equals
+ * Determine whether one pixel is equivalent to another
+ *
+ * Parameters:
+ * px - {<OpenLayers.Pixel>}
+ *
+ * Return:
+ * {Boolean} The point passed in as parameter is equal to this. Note that
+ * if px passed in is null, returns false.
+ */
+ equals:function(px) {
+ var equals = false;
+ if (px != null) {
+ equals = ((this.x == px.x && this.y == px.y) ||
+ (isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y)));
+ }
+ return equals;
+ },
+
+ /**
+ * APIMethod: add
+ *
+ * Parameters:
+ * x - {Integer}
+ * y - {Integer}
+ *
+ * Return:
+ * {<OpenLayers.Pixel>} A new Pixel with this pixel's x&y augmented by the
+ * values passed in.
+ */
+ add:function(x, y) {
+ return new OpenLayers.Pixel(this.x + x, this.y + y);
+ },
+
+ /**
+ * APIMethod: offset
+ *
+ * Parameters
+ * px - {<OpenLayers.Pixel>}
+ *
+ * Return:
+ * {<OpenLayers.Pixel>} A new Pixel with this pixel's x&y augmented by the
+ * x&y values of the pixel passed in.
+ */
+ offset:function(px) {
+ var newPx = this.clone();
+ if (px) {
+ newPx = this.add(px.x, px.y);
+ }
+ return newPx;
+ },
+
+ /** @final @type str */
+ CLASS_NAME: "OpenLayers.Pixel"
+};
\ No newline at end of file
Deleted: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Size.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/BaseTypes/Size.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Size.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -1,86 +0,0 @@
-/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
- * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
- * for the full text of the license. */
-
-/**
- * Class: OpenLayers.Size
- * Instances of this class represent a width/height pair
- */
-OpenLayers.Size = OpenLayers.Class.create();
-OpenLayers.Size.prototype = {
-
- /**
- * APIProperty: w
- * {Number} width
- */
- w: 0.0,
-
- /**
- * APIProperty: h
- * {Number} height
- */
- h: 0.0,
-
-
- /**
- * Constructor: OpenLayers.Size
- * Create an instance of OpenLayers.Size
- *
- * Parameters:
- * w - {Number} width
- * h - {Number} height
- */
- initialize: function(w, h) {
- this.w = parseFloat(w);
- this.h = parseFloat(h);
- },
-
- /**
- * Method: toString
- * Return the string representation of a size object
- *
- * Return:
- * {String} The string representation of OpenLayers.Size object.
- * (ex. <i>"w=55,h=66"</i>)
- */
- toString:function() {
- return ("w=" + this.w + ",h=" + this.h);
- },
-
- /**
- * APIMethod: clone
- * Create a clone of this size object
- *
- * Return:
- * {<OpenLayers.Size>} A new OpenLayers.Size object with the same w and h
- * values
- */
- clone:function() {
- return new OpenLayers.Size(this.w, this.h);
- },
-
- /**
- *
- * APIMethod: equals
- * Determine where this size is equal to another
- *
- * Parameters:
- * sz - {<OpenLayers.Size>}
- *
- * Return:
- * {Boolean} The passed in size has the same h and w properties as this one.
- * Note that if sz passed in is null, returns false.
- *
- */
- equals:function(sz) {
- var equals = false;
- if (sz != null) {
- equals = ((this.w == sz.w && this.h == sz.h) ||
- (isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h)));
- }
- return equals;
- },
-
- /** @final @type String */
- CLASS_NAME: "OpenLayers.Size"
-};
\ No newline at end of file
Copied: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Size.js (from rev 3607, trunk/openlayers/lib/OpenLayers/BaseTypes/Size.js)
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Size.js (rev 0)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes/Size.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -0,0 +1,86 @@
+/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
+ * for the full text of the license. */
+
+/**
+ * Class: OpenLayers.Size
+ * Instances of this class represent a width/height pair
+ */
+OpenLayers.Size = OpenLayers.Class.create();
+OpenLayers.Size.prototype = {
+
+ /**
+ * APIProperty: w
+ * {Number} width
+ */
+ w: 0.0,
+
+ /**
+ * APIProperty: h
+ * {Number} height
+ */
+ h: 0.0,
+
+
+ /**
+ * Constructor: OpenLayers.Size
+ * Create an instance of OpenLayers.Size
+ *
+ * Parameters:
+ * w - {Number} width
+ * h - {Number} height
+ */
+ initialize: function(w, h) {
+ this.w = parseFloat(w);
+ this.h = parseFloat(h);
+ },
+
+ /**
+ * Method: toString
+ * Return the string representation of a size object
+ *
+ * Return:
+ * {String} The string representation of OpenLayers.Size object.
+ * (ex. <i>"w=55,h=66"</i>)
+ */
+ toString:function() {
+ return ("w=" + this.w + ",h=" + this.h);
+ },
+
+ /**
+ * APIMethod: clone
+ * Create a clone of this size object
+ *
+ * Return:
+ * {<OpenLayers.Size>} A new OpenLayers.Size object with the same w and h
+ * values
+ */
+ clone:function() {
+ return new OpenLayers.Size(this.w, this.h);
+ },
+
+ /**
+ *
+ * APIMethod: equals
+ * Determine where this size is equal to another
+ *
+ * Parameters:
+ * sz - {<OpenLayers.Size>}
+ *
+ * Return:
+ * {Boolean} The passed in size has the same h and w properties as this one.
+ * Note that if sz passed in is null, returns false.
+ *
+ */
+ equals:function(sz) {
+ var equals = false;
+ if (sz != null) {
+ equals = ((this.w == sz.w && this.h == sz.h) ||
+ (isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h)));
+ }
+ return equals;
+ },
+
+ /** @final @type String */
+ CLASS_NAME: "OpenLayers.Size"
+};
\ No newline at end of file
Modified: sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/BaseTypes.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -4,1151 +4,11 @@
/**
* Header: OpenLayers Base Types
- * Basic types in OpenLayers are described here.
+ * Modifications to standard JavaScript types are described here.
*/
-/**
- * Namespace: OpenLayers.Class
- * Contains functions to create OpenLayers style classes.
- */
-OpenLayers.Class = {
- isPrototype: function () {}, // magic anonymous value
-
- /**
- * APIFunction: create
- * Create an OpenLayers style class
- *
- * Return:
- * An OpenLayers class
- */
- create: function() {
- return function() {
- if (arguments && arguments[0] != OpenLayers.Class.isPrototype)
- this.initialize.apply(this, arguments);
- }
- },
-
- /**
- * APIFunction: inherit
- * Inherit from one or more OpenLayers style classes
- *
- * Parameters:
- * class - One or more classes can be provided as arguments
- *
- * Return:
- * An object prototype
- */
- inherit: function () {
- var superClass = arguments[0];
- var proto = new superClass(OpenLayers.Class.isPrototype);
- for (var i = 1; i < arguments.length; i++) {
- if (typeof arguments[i] == "function") {
- var mixin = arguments[i];
- arguments[i] = new mixin(OpenLayers.Class.isPrototype);
- }
- OpenLayers.Util.extend(proto, arguments[i]);
-
- // This is a hack for IE see
- // http://trac.openlayers.org/attachment/ticket/552
- //
- // The problem is that ie doesnt recognize toString as a property
- // so the util.extend() doesnt copy it over. we do it manually.
- //
- // to be revisited in 3.0
- //
- if((arguments[i].hasOwnProperty && arguments[i].hasOwnProperty('toString')) ||
- (!arguments[i].hasOwnProperty && arguments[i].toString)) {
- proto.toString = arguments[i].toString;
- }
- }
- return proto;
- }
-};
-
-/*
- OpenLayers.Class.inherit( OpenLayers.Layer.Grid, OpenLayers.Layer.HTTPRequest, {
- some stuff
- });
-*/
-
/*********************
* *
- * PIXEL *
- * *
- *********************/
-
-/**
- * Class: OpenLayers.Pixel
- * This class represents a screen coordinate, in x and y coordinates
- */
-OpenLayers.Pixel = OpenLayers.Class.create();
-OpenLayers.Pixel.prototype = {
-
- /**
- * APIProperty: x
- * {Number} The x coordinate
- */
- x: 0.0,
-
- /**
- * APIProperty: y
- * {Number} The y coordinate
- */
- y: 0.0,
-
- /**
- * Constructor: OpenLayers.Pixel
- * Create a new OpenLayers.Pixel instance
- *
- * Parameters:
- * x - {Number} The x coordinate
- * y - {Number} The y coordinate
- *
- * Return:
- * An instance of OpenLayers.Pixel
- */
- initialize: function(x, y) {
- this.x = parseFloat(x);
- this.y = parseFloat(y);
- },
-
- /**
- * Method: toString
- * Cast this object into a string
- *
- * Return:
- * {String} The string representation of Pixel. ex: "x=200.4,y=242.2"
- */
- toString:function() {
- return ("x=" + this.x + ",y=" + this.y);
- },
-
- /**
- * APIMethod: clone
- * Return a clone of this pixel object
- *
- * Return:
- * {<OpenLayers.Pixel>} A clone pixel
- */
- clone:function() {
- return new OpenLayers.Pixel(this.x, this.y);
- },
-
- /**
- * APIMethod: equals
- * Determine whether one pixel is equivalent to another
- *
- * Parameters:
- * px - {<OpenLayers.Pixel>}
- *
- * Return:
- * {Boolean} The point passed in as parameter is equal to this. Note that
- * if px passed in is null, returns false.
- */
- equals:function(px) {
- var equals = false;
- if (px != null) {
- equals = ((this.x == px.x && this.y == px.y) ||
- (isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y)));
- }
- return equals;
- },
-
- /**
- * APIMethod: add
- *
- * Parameters:
- * x - {Integer}
- * y - {Integer}
- *
- * Return:
- * {<OpenLayers.Pixel>} A new Pixel with this pixel's x&y augmented by the
- * values passed in.
- */
- add:function(x, y) {
- return new OpenLayers.Pixel(this.x + x, this.y + y);
- },
-
- /**
- * APIMethod: offset
- *
- * Parameters
- * px - {<OpenLayers.Pixel>}
- *
- * Return:
- * {<OpenLayers.Pixel>} A new Pixel with this pixel's x&y augmented by the
- * x&y values of the pixel passed in.
- */
- offset:function(px) {
- var newPx = this.clone();
- if (px) {
- newPx = this.add(px.x, px.y);
- }
- return newPx;
- },
-
- /** @final @type str */
- CLASS_NAME: "OpenLayers.Pixel"
-};
-
-
-/*********************
- * *
- * SIZE *
- * *
- *********************/
-
-
-/**
- * Class: OpenLayers.Size
- * Instances of this class represent a width/height pair
- */
-OpenLayers.Size = OpenLayers.Class.create();
-OpenLayers.Size.prototype = {
-
- /**
- * APIProperty: w
- * {Number} width
- */
- w: 0.0,
-
- /**
- * APIProperty: h
- * {Number} height
- */
- h: 0.0,
-
-
- /**
- * Constructor: OpenLayers.Size
- * Create an instance of OpenLayers.Size
- *
- * Parameters:
- * w - {Number} width
- * h - {Number} height
- */
- initialize: function(w, h) {
- this.w = parseFloat(w);
- this.h = parseFloat(h);
- },
-
- /**
- * Method: toString
- * Return the string representation of a size object
- *
- * Return:
- * {String} The string representation of OpenLayers.Size object.
- * (ex. <i>"w=55,h=66"</i>)
- */
- toString:function() {
- return ("w=" + this.w + ",h=" + this.h);
- },
-
- /**
- * APIMethod: clone
- * Create a clone of this size object
- *
- * Return:
- * {<OpenLayers.Size>} A new OpenLayers.Size object with the same w and h
- * values
- */
- clone:function() {
- return new OpenLayers.Size(this.w, this.h);
- },
-
- /**
- *
- * APIMethod: equals
- * Determine where this size is equal to another
- *
- * Parameters:
- * sz - {<OpenLayers.Size>}
- *
- * Return:
- * {Boolean} The passed in size has the same h and w properties as this one.
- * Note that if sz passed in is null, returns false.
- *
- */
- equals:function(sz) {
- var equals = false;
- if (sz != null) {
- equals = ((this.w == sz.w && this.h == sz.h) ||
- (isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h)));
- }
- return equals;
- },
-
- /** @final @type String */
- CLASS_NAME: "OpenLayers.Size"
-};
-
-/*********************
- * *
- * LONLAT *
- * *
- *********************/
-
-
-/**
- * Class: OpenLayers.LonLat
- * This class represents a longitude and latitude pair
- */
-OpenLayers.LonLat = OpenLayers.Class.create();
-OpenLayers.LonLat.prototype = {
-
- /**
- * APIProperty: lon
- * {Float}
- */
- lon: 0.0,
-
- /**
- * APIProperty: lat
- * {Float}
- */
- lat: 0.0,
-
- /**
- * Constructor: OpenLayers.LonLat
- * Create a new OpenLayers.LonLat instance
- *
- * Parameters:
- * lon - {Number} The lon coordinate
- * lat - {Number} The lat coordinate
- */
- initialize: function(lon, lat) {
- this.lon = parseFloat(lon);
- this.lat = parseFloat(lat);
- },
-
- /**
- * Method: toString
- * Return a readable string version of the lonlat
- *
- * Return:
- * {String} String representation of OpenLayers.LonLat object.
- * (ex. <i>"lon=5,lat=42"</i>)
- */
- toString:function() {
- return ("lon=" + this.lon + ",lat=" + this.lat);
- },
-
- /**
- * APIMethod: toShortString
- *
- * Return:
- * {String} Shortened String representation of OpenLayers.LonLat object.
- * (ex. <i>"5, 42"</i>)
- */
- toShortString:function() {
- return (this.lon + ", " + this.lat);
- },
-
- /**
- * APIMethod: clone
- *
- * Return:
- * {<OpenLayers.LonLat>} New OpenLayers.LonLat object with the same lon
- * and lat values
- */
- clone:function() {
- return new OpenLayers.LonLat(this.lon, this.lat);
- },
-
- /**
- * APIMethod: add
- *
- * Parameters:
- * lon - {Float}
- * lat - {Float}
- *
- * Return:
- * {<OpenLayers.LonLat>} A new OpenLayers.LonLat object with the lon and
- * lat passed-in added to this's.
- */
- add:function(lon, lat) {
- return new OpenLayers.LonLat(this.lon + lon, this.lat + lat);
- },
-
- /**
- * APIMethod: equals
- *
- * Parameters:
- * ll - {<OpenLayers.LonLat>}
- *
- * Return:
- * {Boolean} Boolean value indicating whether the passed-in
- * <OpenLayers.LonLat> object has the same lon and lat
- * components as this.
- * Note: if ll passed in is null, returns false
- */
- equals:function(ll) {
- var equals = false;
- if (ll != null) {
- equals = ((this.lon == ll.lon && this.lat == ll.lat) ||
- (isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat)));
- }
- return equals;
- },
-
- /**
- * APIMethod: wrapDateLine
- *
- * Parameters:
- * maxExtent - {<OpenLayers.Bounds>}
- *
- * Return:
- * {<OpenLayers.LonLat>} A copy of this lonlat, but wrapped around the
- * "dateline" (as specified by the borders of
- * maxExtent)
- */
- wrapDateLine: function(maxExtent) {
-
- var newLonLat = this.clone();
-
- if (maxExtent) {
- //shift right?
- while (newLonLat.lon < maxExtent.left) {
- newLonLat.lon += maxExtent.getWidth();
- }
-
- //shift left?
- while (newLonLat.lon > maxExtent.right) {
- newLonLat.lon -= maxExtent.getWidth();
- }
- }
-
- return newLonLat;
- },
-
- /** @final @type String */
- CLASS_NAME: "OpenLayers.LonLat"
-};
-
-/**
- * Function: fromString
- * Alternative constructor that builds a new <OpenLayers.LonLat> from a
- * parameter string
- *
- * Parameters:
- * str - {String} Comma-separated Lon,Lat coordinate string.
- * (ex. <i>"5,40"</i>)
- *
- * Return:
- * {<OpenLayers.LonLat>} New <OpenLayers.LonLat> object built from the
- * passed-in String.
- */
-OpenLayers.LonLat.fromString = function(str) {
- var pair = str.split(",");
- return new OpenLayers.LonLat(parseFloat(pair[0]),
- parseFloat(pair[1]));
-};
-
-
-
-/*********************
- * *
- * BOUNDS *
- * *
- *********************/
-
-
-
-
-/**
- * Class: OpenLayers.Bounds
- * Instances of this class represent bounding boxes. Data stored as left,
- * bottom, right, top floats
- */
-OpenLayers.Bounds = OpenLayers.Class.create();
-OpenLayers.Bounds.prototype = {
-
- /**
- * Property: left
- * {Number}
- */
- left: 0.0,
-
- /**
- * Property: bottom
- * {Number}
- */
- bottom: 0.0,
-
- /**
- * Property: right
- * {Number}
- */
- right: 0.0,
-
- /**
- * Property: top
- * {Number}
- */
- top: 0.0,
-
- /**
- * Constructor: OpenLayers.Bounds
- * Construct a new bounds object.
- *
- * Parameters:
- * left - {Number} The left bounds of the box. Note that for width
- * calculations, this is assumed to be less than the right value.
- * bottom - {Number} The bottom bounds of the box. Note that for height
- * calculations, this is assumed to be more than the top value.
- * right - {Number} The right bounds.
- * top - {Number} The top bounds.
- */
- initialize: function(left, bottom, right, top) {
- this.left = parseFloat(left);
- this.bottom = parseFloat(bottom);
- this.right = parseFloat(right);
- this.top = parseFloat(top);
- },
-
- /**
- * Method: clone
- * Create a cloned instance of this bounds.
- *
- * Return:
- * {<OpenLayers.Bounds>} A fresh copy of the bounds
- */
- clone:function() {
- return new OpenLayers.Bounds(this.left, this.bottom,
- this.right, this.top);
- },
-
- /**
- * Method: equals
- * Test a two bounds for equivalence
- *
- * Parameters:
- * bounds - {<OpenLayers.Bounds>}
- *
- * Return:
- * {Boolean} The passed-in OpenLayers.Bounds object has the same left,
- * right, top, bottom components as this. Note that if bounds
- * passed in is null, returns false.
- */
- equals:function(bounds) {
- var equals = false;
- if (bounds != null) {
- equals = ((this.left == bounds.left) &&
- (this.right == bounds.right) &&
- (this.top == bounds.top) &&
- (this.bottom == bounds.bottom));
- }
- return equals;
- },
-
- /**
- * APIMethod: toString
- *
- * Return:
- * {String} String representation of OpenLayers.Bounds object.
- * (ex.<i>"left-bottom=(5,42) right-top=(10,45)"</i>)
- */
- toString:function() {
- return ( "left-bottom=(" + this.left + "," + this.bottom + ")"
- + " right-top=(" + this.right + "," + this.top + ")" );
- },
-
- /**
- * APIMethod: toBBOX
- *
- * Parameters:
- * decimal - {Integer} How many significant digits in the bbox coords?
- * Default is 6
- *
- * Return:
- * {String} Simple String representation of OpenLayers.Bounds object.
- * (ex. <i>"5,42,10,45"</i>)
- */
- toBBOX:function(decimal) {
- if (decimal== null) {
- decimal = 6;
- }
- var mult = Math.pow(10, decimal);
- var bbox = Math.round(this.left * mult) / mult + "," +
- Math.round(this.bottom * mult) / mult + "," +
- Math.round(this.right * mult) / mult + "," +
- Math.round(this.top * mult) / mult;
-
- return bbox;
- },
-
- /**
- * APIMethod: getWidth
- *
- * Return:
- * {Float} The width of the bounds
- */
- getWidth:function() {
- return (this.right - this.left);
- },
-
- /**
- * APIMethod: getHeight
- *
- * Return:
- * {Float} The height of the bounds
- */
- getHeight:function() {
- return (this.top - this.bottom);
- },
-
- /**
- * APIMethod: getSize
- *
- * Return:
- * {<OpenLayers.Size>} An <OpenLayers.Size> which represents the size of the box
- */
- getSize:function() {
- return new OpenLayers.Size(this.getWidth(), this.getHeight());
- },
-
- /**
- * APIMethod: getCenterPixel
- *
- * Return:
- * {<OpenLayers.Pixel>} An <OpenLayers.Pixel> which represents the center
- * of the bounds
- */
- getCenterPixel:function() {
- return new OpenLayers.Pixel( (this.left + this.right) / 2,
- (this.bottom + this.top) / 2);
- },
-
- /**
- * APIMethod: getCenterLonLat
- *
- * Return:
- * {<OpenLayers.LonLat>} An <OpenLayers.LonLat> which represents the center
- * of the bounds
- */
- getCenterLonLat:function() {
- return new OpenLayers.LonLat( (this.left + this.right) / 2,
- (this.bottom + this.top) / 2);
- },
-
- /**
- * APIMethod: add
- *
- * Parameters:
- * x - {Float}
- * y - {Float}
- *
- * Return:
- * {<OpenLayers.Bounds>} A new <OpenLayers.Bounds> whose coordinates are
- * the same as this, but shifted by the passed-in
- * x and y values
- */
- add:function(x, y) {
- return new OpenLayers.Bounds(this.left + x, this.bottom + y,
- this.right + x, this.top + y);
- },
-
- /**
- * APIMethod: extend
- * Extend the bounds to include the point, lonlat, or bounds specified.
- * Note: This function assumes that left<right and bottom<top.
- *
- *
- * Parameters:
- * object - {Object} Can be LonLat, Point, or Bounds
- */
- extend:function(object) {
- var bounds = null;
- if (object) {
- switch(object.CLASS_NAME) {
- case "OpenLayers.LonLat":
- bounds = new OpenLayers.Bounds(object.lon, object.lat,
- object.lon, object.lat);
- break;
- case "OpenLayers.Geometry.Point":
- bounds = new OpenLayers.Bounds(object.x, object.y,
- object.x, object.y);
- break;
-
- case "OpenLayers.Bounds":
- bounds = object;
- break;
- }
-
- if (bounds) {
- this.left = (bounds.left < this.left) ? bounds.left
- : this.left;
- this.bottom = (bounds.bottom < this.bottom) ? bounds.bottom
- : this.bottom;
- this.right = (bounds.right > this.right) ? bounds.right
- : this.right;
- this.top = (bounds.top > this.top) ? bounds.top
- : this.top;
- }
- }
- },
-
- /**
- * APIMethod: containsLonLat
- *
- * Parameters:
- * ll - {<OpenLayers.LonLat>}
- * inclusive - {Boolean} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in lonlat is within this bounds.
- */
- containsLonLat:function(ll, inclusive) {
- return this.contains(ll.lon, ll.lat, inclusive);
- },
-
- /**
- * APIMethod: containsPixel
- *
- * Parameters:
- * px - {<OpenLayers.Pixel>}
- * inclusive - {Boolean} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in pixel is within this bounds.
- */
- containsPixel:function(px, inclusive) {
- return this.contains(px.x, px.y, inclusive);
- },
-
- /**
- * APIMethod: contains
- *
- * Parameters:
- * x - {Float}
- * y - {Float}
- * inclusive - {Boolean} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in coordinates are within this
- * bounds.
- */
- contains:function(x, y, inclusive) {
-
- //set default
- if (inclusive == null) {
- inclusive = true;
- }
-
- var contains = false;
- if (inclusive) {
- contains = ((x >= this.left) && (x <= this.right) &&
- (y >= this.bottom) && (y <= this.top));
- } else {
- contains = ((x > this.left) && (x < this.right) &&
- (y > this.bottom) && (y < this.top));
- }
- return contains;
- },
-
- /**
- * APIMethod: intersectsBounds
- *
- * Parameters:
- * bounds - {<OpenLayers.Bounds>}
- * inclusive - {<Boolean>} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in OpenLayers.Bounds object
- * intersects this bounds. Simple math just check if either
- * contains the other, allowing for partial.
- */
- intersectsBounds:function(bounds, inclusive) {
-
- if (inclusive == null) {
- inclusive = true;
- }
- var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ?
- true : (((bounds.bottom > this.bottom) && (bounds.bottom < this.top)) ||
- ((this.bottom > bounds.bottom) && (this.bottom < bounds.top)));
- var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ?
- true : (((bounds.top > this.bottom) && (bounds.top < this.top)) ||
- ((this.top > bounds.bottom) && (this.top < bounds.top)));
- var inRight = (bounds.right == this.right && bounds.left == this.left) ?
- true : (((bounds.right > this.left) && (bounds.right < this.right)) ||
- ((this.right > bounds.left) && (this.right < bounds.right)));
- var inLeft = (bounds.right == this.right && bounds.left == this.left) ?
- true : (((bounds.left > this.left) && (bounds.left < this.right)) ||
- ((this.left > bounds.left) && (this.left < bounds.right)));
-
- return (this.containsBounds(bounds, true, inclusive) ||
- bounds.containsBounds(this, true, inclusive) ||
- ((inTop || inBottom ) && (inLeft || inRight )));
- },
-
- /**
- * APIMethod: containsBounds
- *
- * bounds - {<OpenLayers.Bounds>}
- * partial - {<Boolean>} If true, only part of passed-in
- * <OpenLayers.Bounds> needs be within this bounds.
- * If false, the entire passed-in bounds must be
- * within. Default is false
- * inclusive - {<Boolean>} Whether or not to include the border.
- * Default is true.
- *
- * Return:
- * {Boolean} Whether or not the passed-in OpenLayers.Bounds object is
- * contained within this bounds.
- */
- containsBounds:function(bounds, partial, inclusive) {
-
- //set defaults
- if (partial == null) {
- partial = false;
- }
- if (inclusive == null) {
- inclusive = true;
- }
-
- var inLeft;
- var inTop;
- var inRight;
- var inBottom;
-
- if (inclusive) {
- inLeft = (bounds.left >= this.left) && (bounds.left <= this.right);
- inTop = (bounds.top >= this.bottom) && (bounds.top <= this.top);
- inRight= (bounds.right >= this.left) && (bounds.right <= this.right);
- inBottom = (bounds.bottom >= this.bottom) && (bounds.bottom <= this.top);
- } else {
- inLeft = (bounds.left > this.left) && (bounds.left < this.right);
- inTop = (bounds.top > this.bottom) && (bounds.top < this.top);
- inRight= (bounds.right > this.left) && (bounds.right < this.right);
- inBottom = (bounds.bottom > this.bottom) && (bounds.bottom < this.top);
- }
-
- return (partial) ? (inTop || inBottom ) && (inLeft || inRight )
- : (inTop && inLeft && inBottom && inRight);
- },
-
- /**
- * APIMethod: determineQuadrant
- *
- * Parameters:
- * lonlat - {<OpenLayers.LonLat>}
- *
- * Return:
- * {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which
- * the coordinate lies.
- */
- determineQuadrant: function(lonlat) {
-
- var quadrant = "";
- var center = this.getCenterLonLat();
-
- quadrant += (lonlat.lat < center.lat) ? "b" : "t";
- quadrant += (lonlat.lon < center.lon) ? "l" : "r";
-
- return quadrant;
- },
-
- /**
- * APIMethod: wrapDateLine
- *
- * Parameters:
- * maxExtent - {<OpenLayers.Bounds>}
- * options - {Object} Some possible options are:
- * leftTolerance - {float} Allow for a margin of error
- * with the 'left' value of this
- * bound.
- * Default is 0.
- * rightTolerance - {float} Allow for a margin of error
- * with the 'right' value of
- * this bound.
- * Default is 0.
- *
- * Return:
- * {<OpenLayers.Bounds>} A copy of this bounds, but wrapped around the
- * "dateline" (as specified by the borders of
- * maxExtent). Note that this function only returns
- * a different bounds value if this bounds is
- * *entirely* outside of the maxExtent. If this
- * bounds straddles the dateline (is part in/part
- * out of maxExtent), the returned bounds will be
- * merely a copy of this one.
- */
- wrapDateLine: function(maxExtent, options) {
- options = options || new Object();
-
- var leftTolerance = options.leftTolerance || 0;
- var rightTolerance = options.rightTolerance || 0;
-
- var newBounds = this.clone();
-
- if (maxExtent) {
-
- //shift right?
- while ( newBounds.left < maxExtent.left &&
- (newBounds.right - rightTolerance) <= maxExtent.left ) {
- newBounds = newBounds.add(maxExtent.getWidth(), 0);
- }
-
- //shift left?
- while ( (newBounds.left + leftTolerance) >= maxExtent.right &&
- newBounds.right > maxExtent.right ) {
- newBounds = newBounds.add(-maxExtent.getWidth(), 0);
- }
- }
-
- return newBounds;
- },
-
- /** @final @type String */
- CLASS_NAME: "OpenLayers.Bounds"
-};
-
-/**
- * APIFunction: fromString
- * Alternative constructor that builds a new OpenLayers.Bounds from a
- * parameter string
- *
- * Parameters:
- * str - {String}Comma-separated bounds string. (ex. <i>"5,42,10,45"</i>)
- *
- * Return:
- * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
- * passed-in String.
- */
-OpenLayers.Bounds.fromString = function(str) {
- var bounds = str.split(",");
- return OpenLayers.Bounds.fromArray(bounds);
-};
-
-/**
- * APIFunction: fromArray
- * Alternative constructor that builds a new OpenLayers.Bounds
- * from an array
- *
- * Parameters:
- * bbox - {Array} Array of bounds values (ex. <i>[5,42,10,45]</i>)
- *
- * Return:
- * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
- * passed-in Array.
- */
-OpenLayers.Bounds.fromArray = function(bbox) {
- return new OpenLayers.Bounds(parseFloat(bbox[0]),
- parseFloat(bbox[1]),
- parseFloat(bbox[2]),
- parseFloat(bbox[3]));
-};
-
-/**
- * APIFunction: fromSize
- * Alternative constructor that builds a new OpenLayers.Bounds
- * from a size
- *
- * Parameters:
- * size - {<OpenLayers.Size>}
- *
- * Return:
- * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
- * passed-in size.
- */
-OpenLayers.Bounds.fromSize = function(size) {
- return new OpenLayers.Bounds(0,
- size.h,
- size.w,
- 0);
-};
-
-/**
- * Function: oppositeQuadrant
- * Get the opposite quadrant for a given quadrant string.
- *
- * Parameters:
- * quadrant - {String} two character quadrant shortstring
- *
- * Return:
- * {String} The opposing quadrant ("br" "tr" "tl" "bl"). For Example, if
- * you pass in "bl" it returns "tr", if you pass in "br" it
- * returns "tl", etc.
- */
-OpenLayers.Bounds.oppositeQuadrant = function(quadrant) {
- var opp = "";
-
- opp += (quadrant.charAt(0) == 't') ? 'b' : 't';
- opp += (quadrant.charAt(1) == 'l') ? 'r' : 'l';
-
- return opp;
-};
-
-
-/*********************
- * *
- * ELEMENT *
- * *
- *********************/
-
-/**
- * Namespace: OpenLayers.Element
- */
-OpenLayers.Element = {
-
- /**
- * APIFunction: visible
- *
- * Parameters:
- * element - {DOMElement}
- *
- * Return:
- * {Boolean} Is the element visible?
- */
- visible: function(element) {
- return OpenLayers.Util.getElement(element).style.display != 'none';
- },
-
- /**
- * APIFunction: toggle
- * Toggle the visibility of element(s) passed in
- *
- * Parameters:
- * element - {DOMElement} Actually user can pass any number of elements
- */
- toggle: function() {
- for (var i = 0; i < arguments.length; i++) {
- var element = OpenLayers.Util.getElement(arguments[i]);
- var display = OpenLayers.Element.visible(element) ? 'hide'
- : 'show';
- OpenLayers.Element[display](element);
- }
- },
-
-
- /**
- * APIFunction: hide
- * Hide element(s) passed in
- *
- * Parameters:
- * element - {DOMElement} Actually user can pass any number of elements
- */
- hide: function() {
- for (var i = 0; i < arguments.length; i++) {
- var element = OpenLayers.Util.getElement(arguments[i]);
- element.style.display = 'none';
- }
- },
-
- /**
- * APIFunction: show
- * Show element(s) passed in
- *
- * Parameters:
- * element - {DOMElement} Actually user can pass any number of elements
- */
- show: function() {
- for (var i = 0; i < arguments.length; i++) {
- var element = OpenLayers.Util.getElement(arguments[i]);
- element.style.display = '';
- }
- },
-
- /**
- * APIFunction: remove
- * Remove the specified element from the DOM.
- *
- * Parameters:
- * element - {DOMElement}
- */
- remove: function(element) {
- element = OpenLayers.Util.getElement(element);
- element.parentNode.removeChild(element);
- },
-
- /**
- * APIFunction: getHeight
- *
- * Parameters:
- * element - {DOMElement}
- *
- * Return:
- * {Integer} The offset height of the element passed in
- */
- getHeight: function(element) {
- element = OpenLayers.Util.getElement(element);
- return element.offsetHeight;
- },
-
- /**
- * APIFunction: getDimensions
- *
- * Parameters:
- * element - {DOMElement}
- *
- * Return:
- * {Object} Object with 'width' and 'height' properties which are the
- * dimensions of the element passed in.
- */
- getDimensions: function(element) {
- element = OpenLayers.Util.getElement(element);
- if (OpenLayers.Element.getStyle(element, 'display') != 'none') {
- return {width: element.offsetWidth, height: element.offsetHeight};
- }
-
- // All *Width and *Height properties give 0 on elements with display none,
- // so enable the element temporarily
- var els = element.style;
- var originalVisibility = els.visibility;
- var originalPosition = els.position;
- els.visibility = 'hidden';
- els.position = 'absolute';
- els.display = '';
- var originalWidth = element.clientWidth;
- var originalHeight = element.clientHeight;
- els.display = 'none';
- els.position = originalPosition;
- els.visibility = originalVisibility;
- return {width: originalWidth, height: originalHeight};
- },
-
- /**
- * APIFunction: getStyle
- *
- * Parameters:
- * element - {DOMElement}
- * style - {?}
- *
- * Return:
- * {?}
- */
- getStyle: function(element, style) {
- element = OpenLayers.Util.getElement(element);
- var value = element.style[style.camelize()];
- if (!value) {
- if (document.defaultView &&
- document.defaultView.getComputedStyle) {
-
- var css = document.defaultView.getComputedStyle(element, null);
- value = css ? css.getPropertyValue(style) : null;
- } else if (element.currentStyle) {
- value = element.currentStyle[style.camelize()];
- }
- }
-
- var positions = ['left', 'top', 'right', 'bottom'];
- if (window.opera &&
- (OpenLayers.Util.indexOf(positions,style) != -1) &&
- (OpenLayers.Element.getStyle(element, 'position') == 'static')) {
- value = 'auto';
- }
-
- return value == 'auto' ? null : value;
- }
-
-};
-
-/*********************
- * *
* STRING *
* *
*********************/
Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Control/Navigation.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Control/Navigation.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Control/Navigation.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -8,7 +8,14 @@
* @requires OpenLayers/Handler/MouseWheel.js
*
* Class: OpenLayers.Control.Navigation
+ * The navigation control handles map browsing with mouse events (dragging,
+ * double-clicking, and scrolling the wheel). Create a new navigation
+ * control with the <OpenLayers.Control.Navigation> control.
*
+ * Note that this control is added to the map by default (if no controls
+ * array is sent in the options object to the <OpenLayers.Map>
+ * constructor).
+ *
* Inherits:
* - <OpenLayers.Control>
*/
@@ -35,6 +42,18 @@
wheelHandler: null,
/**
+ * Constructor: OpenLayers.Control.Navigation
+ * Create a new navigation control
+ *
+ * Parameters:
+ * options - {Object} An optional object whose properties will be set on
+ * the control
+ */
+ initialize: function(options) {
+ OpenLayers.Control.prototype.initialize.apply(this, arguments);
+ },
+
+ /**
* Method: activate
*/
activate: function() {
Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Events.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Events.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Events.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -4,11 +4,9 @@
/**
- * @requires OpenLayers/Util.js
+ * @requires OpenLayers/Util.js
*
- * Title: OpenLayers.Events
- *
- * Class: OpenLayers.Event
+ * Namespace: OpenLayers.Event
* Utility functions for event handling.
*/
OpenLayers.Event = {
Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Format/GML.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Format/GML.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Format/GML.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -9,7 +9,8 @@
* @requires OpenLayers/Geometry.js
*
* Class: OpenLayers.Format.GML
- * Read/Wite GML.
+ * Read/Wite GML. Create a new instance with the <OpenLayers.Format.GML>
+ * constructor.
*
* Inherits from:
* - <OpenLayers.Format>
@@ -65,7 +66,20 @@
*/
extractAttributes: true,
+
/**
+ * Constructor: OpenLayers.Format.GML
+ * Create a new parser for GML
+ *
+ * Parameters:
+ * options - {Object} An optional object whose properties will be set on
+ * this instance.
+ */
+ initialize: function(options) {
+ OpenLayers.Format.prototype.initialize.apply(this, [options]);
+ },
+
+ /**
* APIMethod: read
* Read data from a string, and return a list of features.
*
Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Format/GeoRSS.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Format/GeoRSS.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Format/GeoRSS.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -6,7 +6,8 @@
* @requires OpenLayers/Format.js
*
* Class: OpenLayers.Format.GeoRSS
- * Write-only GeoRSS.
+ * Write-only GeoRSS. Create a new instance with the
+ * <OpenLayers.Format.GeoRSS> constructor.
*
* Inherits from:
* - <OpenLayers.Format>
@@ -33,7 +34,20 @@
*/
georssns: "http://www.georss.org/georss",
+
/**
+ * Constructor: OpenLayers.Format.GeoRSS
+ * Create a new parser for GeoRSS
+ *
+ * Parameters:
+ * options - {Object} An optional object whose properties will be set on
+ * this instance.
+ */
+ initialize: function(options) {
+ OpenLayers.Format.prototype.initialize.apply(this, [options]);
+ },
+
+ /**
* APIMethod: write
* Accept Feature Collection, and return a string.
*
Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Format/KML.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Format/KML.js 2007-07-05 23:23:53 UTC (rev 3607)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Format/KML.js 2007-07-05 23:46:47 UTC (rev 3608)
@@ -9,7 +9,8 @@
*
* Class: OpenLayers.Format.KML
* Read only KML. Largely Proof of Concept: does not support advanced Features,
- * including Polygons.
+ * including Polygons. Create a new instance with the
+ * <OpenLayers.Format.KML> constructor.
*
* Inherits from:
* - <OpenLayers.Format>
@@ -25,6 +26,18 @@
kmlns: "http://earth.google.com/kml/2.0",
/**
+ * Constructor: