[OpenLayers-Commits] r11655 - in sandbox/tschaub/click: . examples lib/OpenLayers lib/OpenLayers/Control lib/OpenLayers/Format lib/OpenLayers/Format/OWSContext lib/OpenLayers/Handler lib/OpenLayers/Layer lib/OpenLayers/Renderer lib/OpenLayers/Strategy lib/Rico tests tests/Control tests/Format tests/Format/OWSContext tests/Handler tests/Layer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Mar 7 09:42:09 EST 2011


Author: tschaub
Date: 2011-03-07 06:42:08 -0800 (Mon, 07 Mar 2011)
New Revision: 11655

Added:
   sandbox/tschaub/click/examples/mobile-drawing.html
   sandbox/tschaub/click/examples/mobile-drawing.js
Modified:
   sandbox/tschaub/click/
   sandbox/tschaub/click/lib/OpenLayers/Control.js
   sandbox/tschaub/click/lib/OpenLayers/Control/ArgParser.js
   sandbox/tschaub/click/lib/OpenLayers/Control/Attribution.js
   sandbox/tschaub/click/lib/OpenLayers/Control/KeyboardDefaults.js
   sandbox/tschaub/click/lib/OpenLayers/Control/MousePosition.js
   sandbox/tschaub/click/lib/OpenLayers/Control/PanZoom.js
   sandbox/tschaub/click/lib/OpenLayers/Control/PanZoomBar.js
   sandbox/tschaub/click/lib/OpenLayers/Control/PinchZoom.js
   sandbox/tschaub/click/lib/OpenLayers/Control/ScaleLine.js
   sandbox/tschaub/click/lib/OpenLayers/Control/SelectFeature.js
   sandbox/tschaub/click/lib/OpenLayers/Control/TouchNavigation.js
   sandbox/tschaub/click/lib/OpenLayers/Format/Atom.js
   sandbox/tschaub/click/lib/OpenLayers/Format/Filter.js
   sandbox/tschaub/click/lib/OpenLayers/Format/GeoJSON.js
   sandbox/tschaub/click/lib/OpenLayers/Format/GeoRSS.js
   sandbox/tschaub/click/lib/OpenLayers/Format/JSON.js
   sandbox/tschaub/click/lib/OpenLayers/Format/KML.js
   sandbox/tschaub/click/lib/OpenLayers/Format/OSM.js
   sandbox/tschaub/click/lib/OpenLayers/Format/OWSContext.js
   sandbox/tschaub/click/lib/OpenLayers/Format/OWSContext/v0_3_1.js
   sandbox/tschaub/click/lib/OpenLayers/Format/SLD.js
   sandbox/tschaub/click/lib/OpenLayers/Format/SOSCapabilities.js
   sandbox/tschaub/click/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js
   sandbox/tschaub/click/lib/OpenLayers/Format/SOSGetObservation.js
   sandbox/tschaub/click/lib/OpenLayers/Format/WFSCapabilities.js
   sandbox/tschaub/click/lib/OpenLayers/Format/WFSDescribeFeatureType.js
   sandbox/tschaub/click/lib/OpenLayers/Format/WMC.js
   sandbox/tschaub/click/lib/OpenLayers/Format/WMSCapabilities.js
   sandbox/tschaub/click/lib/OpenLayers/Format/WMSDescribeLayer.js
   sandbox/tschaub/click/lib/OpenLayers/Format/WMSGetFeatureInfo.js
   sandbox/tschaub/click/lib/OpenLayers/Format/WMTSCapabilities.js
   sandbox/tschaub/click/lib/OpenLayers/Handler/Drag.js
   sandbox/tschaub/click/lib/OpenLayers/Layer/Vector.js
   sandbox/tschaub/click/lib/OpenLayers/Map.js
   sandbox/tschaub/click/lib/OpenLayers/Renderer/NG.js
   sandbox/tschaub/click/lib/OpenLayers/Strategy/BBOX.js
   sandbox/tschaub/click/lib/OpenLayers/Strategy/Cluster.js
   sandbox/tschaub/click/lib/OpenLayers/Strategy/Filter.js
   sandbox/tschaub/click/lib/OpenLayers/Strategy/Fixed.js
   sandbox/tschaub/click/lib/OpenLayers/Strategy/Paging.js
   sandbox/tschaub/click/lib/OpenLayers/Strategy/Refresh.js
   sandbox/tschaub/click/lib/Rico/Color.js
   sandbox/tschaub/click/tests/Control.html
   sandbox/tschaub/click/tests/Control/PanZoomBar.html
   sandbox/tschaub/click/tests/Control/SelectFeature.html
   sandbox/tschaub/click/tests/Format/GeoJSON.html
   sandbox/tschaub/click/tests/Format/KML.html
   sandbox/tschaub/click/tests/Format/OSM.html
   sandbox/tschaub/click/tests/Format/OWSContext/v0_3_1.html
   sandbox/tschaub/click/tests/Handler/Drag.html
   sandbox/tschaub/click/tests/Layer/GML.html
Log:
Merge r11624:11654 from trunk.


Property changes on: sandbox/tschaub/click
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11572-11623
   + /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11572-11654

Copied: sandbox/tschaub/click/examples/mobile-drawing.html (from rev 11654, trunk/openlayers/examples/mobile-drawing.html)
===================================================================
--- sandbox/tschaub/click/examples/mobile-drawing.html	                        (rev 0)
+++ sandbox/tschaub/click/examples/mobile-drawing.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>OpenLayers Mobile Drawing</title>
+        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0;">
+        <meta name="apple-mobile-web-app-capable" content="yes">
+        <link rel="stylesheet" href="style.mobile.css" type="text/css">
+        <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+        <script src="../lib/OpenLayers.js"></script>
+        <script src="mobile-drawing.js"></script>
+        <script src="http://192.168.1.122:8124/debug.js?ns=OpenLayers.Console"></script>
+        <script>
+            OpenLayers.Console.log("mobile-drawing");
+        </script>
+        <style>
+            html, body {
+                margin: 0;
+                padding: 0;
+                height: 100%;
+            }
+            #map {
+                position: relative;
+                width: 100%;
+                height: 100%;
+            }
+            .olControlAttribution {
+                font-size: 10px;
+                bottom: 5px;
+                right: 5px;
+            }
+            #title, #tags, #shortdesc {
+                display: none;
+            }
+        </style>
+    </head>
+    <body>
+        <h1 id="title">Mobile Drawing Example</h1>
+        <div id="tags">
+            mobile, drawing
+        </div>
+        <p id="shortdesc">
+            A full-screen map with drawing tools for mobile devices.
+        </p>
+        <div id="map"></div>
+        <script>
+            init();
+        </script>
+    </body>
+</html>

Copied: sandbox/tschaub/click/examples/mobile-drawing.js (from rev 11654, trunk/openlayers/examples/mobile-drawing.js)
===================================================================
--- sandbox/tschaub/click/examples/mobile-drawing.js	                        (rev 0)
+++ sandbox/tschaub/click/examples/mobile-drawing.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -0,0 +1,33 @@
+
+function init() {
+
+    var vector = new OpenLayers.Layer.Vector();
+    var toolbar = new OpenLayers.Control.EditingToolbar(vector);
+
+    map = new OpenLayers.Map({
+        div: 'map',
+        projection: 'EPSG:900913',
+        units: 'm',
+        numZoomLevels: 18,
+        maxResolution: 156543.0339,
+        maxExtent: new OpenLayers.Bounds(
+            -20037508.34, -20037508.34, 20037508.34, 20037508.34
+        ),
+        controls: [
+            new OpenLayers.Control.TouchNavigation({
+                dragPanOptions: {
+                    interval: 100
+                }
+            }),
+            new OpenLayers.Control.ZoomPanel(),
+            toolbar
+        ],
+        layers: [new OpenLayers.Layer.OSM(), vector],
+        center: new OpenLayers.LonLat(0, 0),
+        zoom: 1,
+        theme: null
+    });
+
+    toolbar.controls[0].activate();
+
+};

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/ArgParser.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/ArgParser.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/ArgParser.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -54,6 +54,16 @@
      */
     displayProjection: null, 
 
+    /**
+     * Constructor: OpenLayers.Control.ArgParser
+     *
+     * Parameters:
+     * options - {Object}
+     */
+
+    /**
+     * Method: getParameters
+     */    
     getParameters: function(url) {
         url = url || window.location.href;
         var parameters = OpenLayers.Util.getParameters(url);

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/Attribution.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/Attribution.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/Attribution.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -24,6 +24,13 @@
      */
     separator: ", ",
     
+    /**
+     * Constructor: OpenLayers.Control.Attribution 
+     * 
+     * Parameters:
+     * options - {Object} Options for control.
+     */
+
     /** 
      * Method: destroy
      * Destroy control.

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/KeyboardDefaults.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/KeyboardDefaults.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/KeyboardDefaults.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -33,6 +33,10 @@
      * Pixels to slide by.
      */
     slideFactor: 75,
+
+    /**
+     * Constructor: OpenLayers.Control.KeyboardDefaults
+     */
     
     /**
      * APIMethod: destroy

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/MousePosition.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/MousePosition.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/MousePosition.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -82,6 +82,13 @@
     displayProjection: null, 
     
     /**
+     * Constructor: OpenLayers.Control.MousePosition
+     * 
+     * Parameters:
+     * options - {Object} Options for control.
+     */
+
+    /**
      * Method: destroy
      */
      destroy: function() {

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/PanZoom.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/PanZoom.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/PanZoom.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -64,10 +64,10 @@
      * APIMethod: destroy
      */
     destroy: function() {
-        OpenLayers.Control.prototype.destroy.apply(this, arguments);
         this.removeButtons();
         this.buttons = null;
         this.position = null;
+        OpenLayers.Control.prototype.destroy.apply(this, arguments);
     },
 
     /**

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/PanZoomBar.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/PanZoomBar.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/PanZoomBar.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -85,6 +85,10 @@
     zoomStart: null,
 
     /**
+     * Constructor: OpenLayers.Control.PanZoomBar
+     */ 
+
+    /**
      * APIMethod: destroy
      */
     destroy: function() {

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/PinchZoom.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/PinchZoom.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/PinchZoom.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
  * full list of contributors). Published under the Clear BSD license.
  * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
  * full text of the license. */

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/ScaleLine.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/ScaleLine.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/ScaleLine.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -73,6 +73,15 @@
     geodesic: false,
 
     /**
+     * Constructor: OpenLayers.Control.ScaleLine
+     * Create a new scale line control.
+     * 
+     * Parameters:
+     * options - {Object} An optional object whose properties will be used
+     *     to extend the control.
+     */
+
+    /**
      * Method: draw
      * 
      * Returns:

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/SelectFeature.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/SelectFeature.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/SelectFeature.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -463,8 +463,23 @@
      */
     unhighlight: function(feature) {
         var layer = feature.layer;
-        feature._lastHighlighter = feature._prevHighlighter;
-        delete feature._prevHighlighter;
+        // three cases:
+        // 1. there's no other highlighter, in that case _prev is undefined,
+        //    and we just need to undef _last
+        // 2. another control highlighted the feature after we did it, in
+        //    that case _last references this other control, and we just
+        //    need to undef _prev
+        // 3. another control highlighted the feature before we did it, in
+        //    that case _prev references this other control, and we need to
+        //    set _last to _prev and undef _prev
+        if(feature._prevHighlighter == undefined) {
+            delete feature._lastHighlighter;
+        } else if(feature._prevHighlighter == this.id) {
+            delete feature._prevHighlighter;
+        } else {
+            feature._lastHighlighter = feature._prevHighlighter;
+            delete feature._prevHighlighter;
+        }
         layer.drawFeature(feature, feature.style || feature.layer.style ||
             "default");
         this.events.triggerEvent("featureunhighlighted", {feature : feature});

Modified: sandbox/tschaub/click/lib/OpenLayers/Control/TouchNavigation.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control/TouchNavigation.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control/TouchNavigation.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for
+/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
  * full list of contributors). Published under the Clear BSD license.
  * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
  * full text of the license. */

Modified: sandbox/tschaub/click/lib/OpenLayers/Control.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Control.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Control.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -229,6 +229,7 @@
             this.map.removeControl(this);
             this.map = null;
         }
+        this.div = null;
     },
 
     /** 

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/Atom.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/Atom.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/Atom.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -67,9 +67,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-    },
     
     /**
      * APIMethod: read

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/Filter.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/Filter.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/Filter.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -47,9 +47,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-    },
 
     /**
      * APIMethod: write

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/GeoJSON.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/GeoJSON.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/GeoJSON.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -40,9 +40,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.JSON.prototype.initialize.apply(this, [options]);
-    },
 
     /**
      * APIMethod: read

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/GeoRSS.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/GeoRSS.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/GeoRSS.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -83,9 +83,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-    },
     
     /**
      * Method: createGeometryFromItem

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/JSON.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/JSON.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/JSON.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -75,9 +75,6 @@
      * 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

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/KML.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/KML.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/KML.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -1222,7 +1222,8 @@
      * {DOMElement}
      */
     buildGeometryNode: function(geometry) {
-        if (this.internalProjection && this.externalProjection) {
+        if (this.internalProjection && this.externalProjection && 
+            !(geometry instanceof OpenLayers.Geometry.Collection)) {
             geometry = geometry.clone();
             geometry.transform(this.internalProjection, 
                                this.externalProjection);

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/OSM.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/OSM.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/OSM.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -347,6 +347,13 @@
         'point': function(point) {
             var id = null;
             var geometry = point.geometry ? point.geometry : point;
+            
+            if (this.internalProjection && this.externalProjection) {
+                geometry = geometry.clone();
+                geometry.transform(this.internalProjection, 
+                                   this.externalProjection);
+            }                       
+            
             var already_exists = false; // We don't return anything if the node
                                         // has already been created
             if (point.osm_id) {

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/OWSContext/v0_3_1.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/OWSContext/v0_3_1.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/OWSContext/v0_3_1.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -179,9 +179,10 @@
     decomposeNestingPath: function(nPath){
         var a = [];
         if (nPath instanceof Array) {
-            while (nPath.length > 0) {
-                a.push(nPath.slice());
-                nPath.pop();
+            var path = nPath.slice();
+            while (path.length > 0) {
+                a.push(path.slice());
+                path.pop();
             }
             a.reverse();
         }
@@ -440,7 +441,9 @@
                 var node = this.createElementNSPlus("Style");
                 this.writeNode("Name", style, node);
                 this.writeNode("Title", style, node);
-                this.writeNode("LegendURL", style, node);
+                if (style.legend) {
+                    this.writeNode("LegendURL", style, node);
+                }
                 return node;
             },
             "Name": function(obj) {

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/OWSContext.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/OWSContext.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/OWSContext.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -23,6 +23,15 @@
      * {String} Version number to assume if none found.  Default is "0.3.1".
      */
     defaultVersion: "0.3.1",
+
+    /**
+     * Constructor: OpenLayers.Format.OWSContext
+     * Create a new parser for OWS Context documents.
+     *
+     * Parameters:
+     * options - {Object} An optional object whose properties will be set on
+     *     this instance.
+     */
     
     /**
      * Method: getParser

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/SLD.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/SLD.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/SLD.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -58,9 +58,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-    },
 
     /**
      * APIMethod: write

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/SOSCapabilities.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/SOSCapabilities.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/SOSCapabilities.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -36,16 +36,12 @@
 
     /**
      * Constructor: OpenLayers.Format.SOSCapabilities
-     * Create a new parser for SOS capabilities.
+     * Create a new parser for SOS Capabilities.
      *
      * Parameters:
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-        this.options = options;
-    },
 
     /**
      * APIMethod: read

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -66,9 +66,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-    },
 
     /**
      * APIMethod: read

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/SOSGetObservation.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/SOSGetObservation.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/SOSGetObservation.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -68,9 +68,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-    },
 
     /**
      * Method: read

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/WFSCapabilities.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/WFSCapabilities.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/WFSCapabilities.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -36,10 +36,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-        this.options = options;
-    },
 
     /**
      * APIMethod: read
@@ -77,4 +73,4 @@
     
     CLASS_NAME: "OpenLayers.Format.WFSCapabilities" 
 
-});
\ No newline at end of file
+});

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/WFSDescribeFeatureType.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/WFSDescribeFeatureType.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/WFSDescribeFeatureType.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -31,9 +31,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-    },
     
     /**
      * Property: readers
@@ -195,4 +192,4 @@
     
     CLASS_NAME: "OpenLayers.Format.WFSDescribeFeatureType" 
 
-});
\ No newline at end of file
+});

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/WMC.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/WMC.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/WMC.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -22,6 +22,15 @@
      * {String} Version number to assume if none found.  Default is "1.1.0".
      */
     defaultVersion: "1.1.0",
+
+    /**
+     * Constructor: OpenLayers.Format.WMC
+     * Create a new parser for Web Map Context documents.
+     *
+     * Parameters:
+     * options - {Object} An optional object whose properties will be set on
+     *     this instance.
+     */
     
     /**
      * Method: getParser

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/WMSCapabilities.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/WMSCapabilities.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/WMSCapabilities.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -51,10 +51,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-        this.options = options;
-    },
 
     /**
      * APIMethod: read
@@ -90,4 +86,4 @@
     
     CLASS_NAME: "OpenLayers.Format.WMSCapabilities" 
 
-});
\ No newline at end of file
+});

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/WMSDescribeLayer.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/WMSDescribeLayer.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/WMSDescribeLayer.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -37,10 +37,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-        this.options = options;
-    },
 
     /**
      * APIMethod: read

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/WMSGetFeatureInfo.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/WMSGetFeatureInfo.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/WMSGetFeatureInfo.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -56,11 +56,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, arguments);
-        OpenLayers.Util.extend(this, options);
-        this.options = options;
-    },
 
     /**
      * APIMethod: read

Modified: sandbox/tschaub/click/lib/OpenLayers/Format/WMTSCapabilities.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Format/WMTSCapabilities.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Format/WMTSCapabilities.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -55,10 +55,6 @@
      * options - {Object} An optional object whose properties will be set on
      *     this instance.
      */
-    initialize: function(options) {
-        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
-        this.options = options;
-    },
 
     /**
      * APIMethod: read

Modified: sandbox/tschaub/click/lib/OpenLayers/Handler/Drag.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Handler/Drag.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Handler/Drag.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -63,6 +63,14 @@
     start: null,
 
     /**
+     * Property: lastMoveEvt
+     * {Object} The last mousemove event that occurred. Used to
+     *     position the map correctly when our "delay drag"
+     *     timeout expired.
+     */
+    lastMoveEvt: null,
+
+    /**
      * Property: oldOnselectstart
      * {Function}
      */
@@ -209,7 +217,7 @@
                 this.oldOnselectstart = document.onselectstart;
                 document.onselectstart = OpenLayers.Function.False;
             }
-            this.last = this.evt.xy;
+            this.last = evt.xy;
         }
         return true;
     },
@@ -341,6 +349,7 @@
      * {Boolean} Let the event propagate.
      */
     mousemove: function(evt) {
+        this.lastMoveEvt = evt;
         return this.dragmove(evt);
     },
 
@@ -364,6 +373,12 @@
      */
     removeTimeout: function() {
         this.timeoutId = null;
+        // if timeout expires while we're still dragging (mouseup
+        // hasn't occurred) then call mousemove to move to the
+        // correct position
+        if(this.dragging) {
+            this.mousemove(this.lastMoveEvt);
+        }
     },
 
     /**

Modified: sandbox/tschaub/click/lib/OpenLayers/Layer/Vector.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Layer/Vector.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Layer/Vector.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -472,7 +472,7 @@
     moveTo: function(bounds, zoomChanged, dragging) {
         OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
         
-        var ng = (this.renderer instanceof OpenLayers.Renderer.NG);
+        var ng = (OpenLayers.Renderer.NG && this.renderer instanceof OpenLayers.Renderer.NG);
         if (ng) {
             zoomChanged && this.renderer.updateDimensions();
         } else {
@@ -522,7 +522,7 @@
      * {Boolean} The layer was redrawn.
      */
     redraw: function() {
-        if (this.renderer instanceof OpenLayers.Renderer.NG) {
+        if (OpenLayers.Renderer.NG && this.renderer instanceof OpenLayers.Renderer.NG) {
             this.drawn = false;
         }
         return OpenLayers.Layer.prototype.redraw.apply(this, arguments);

Modified: sandbox/tschaub/click/lib/OpenLayers/Map.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Map.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Map.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -510,6 +510,12 @@
             this.div = document.createElement("div");
             this.div.style.height = "1px";
             this.div.style.width = "1px";
+            
+            // Adding this to the DOM is a fix for Safari SVG rendering bugs;
+            // See #2392. On initial render(), it is removed from the dom,
+            // and a new div is added.
+            this.div.style.display = "none";
+            document.body.appendChild(this.div);
         }
         
         OpenLayers.Element.addClass(this.div, 'olMap');
@@ -644,6 +650,11 @@
      *     will be moved from the current to the new container.
      */
     render: function(div) {
+        // Fix for Safari SVG rendering bugs; See #2392
+        if(this.div && this.div.parentNode) {
+            this.div.parentNode.removeChild(this.div);
+        }
+
         this.div = OpenLayers.Util.getElement(div);
         OpenLayers.Element.addClass(this.div, 'olMap');
         this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);

Modified: sandbox/tschaub/click/lib/OpenLayers/Renderer/NG.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Renderer/NG.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Renderer/NG.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -124,8 +124,8 @@
         label._x = location.x;
         label._y = location.y;
         if(style.labelXOffset || style.labelYOffset) {
-            xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
-            yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset;
+            var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
+            var yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset;
             var res = this.getResolution();
             location.move(xOffset*res, yOffset*res);
         }
@@ -138,4 +138,4 @@
     },
 
     CLASS_NAME: "OpenLayers.Renderer.NG"
-});
\ No newline at end of file
+});

Modified: sandbox/tschaub/click/lib/OpenLayers/Strategy/BBOX.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Strategy/BBOX.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Strategy/BBOX.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -61,18 +61,6 @@
     response: null,
 
     /**
-     * Constructor: OpenLayers.Strategy.BBOX
-     * Create a new BBOX strategy.
-     *
-     * Parameters:
-     * options - {Object} Optional object whose properties will be set on the
-     *     instance.
-     */
-    initialize: function(options) {
-        OpenLayers.Strategy.prototype.initialize.apply(this, [options]);
-    },
-    
-    /**
      * Method: activate
      * Set up strategy with regard to reading new batches of remote data.
      * 

Modified: sandbox/tschaub/click/lib/OpenLayers/Strategy/Cluster.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Strategy/Cluster.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Strategy/Cluster.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -59,18 +59,6 @@
     resolution: null,
 
     /**
-     * Constructor: OpenLayers.Strategy.Cluster
-     * Create a new clustering strategy.
-     *
-     * Parameters:
-     * options - {Object} Optional object whose properties will be set on the
-     *     instance.
-     */
-    initialize: function(options) {
-        OpenLayers.Strategy.prototype.initialize.apply(this, [options]);
-    },
-    
-    /**
      * APIMethod: activate
      * Activate the strategy.  Register any listeners, do appropriate setup.
      * 

Modified: sandbox/tschaub/click/lib/OpenLayers/Strategy/Filter.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Strategy/Filter.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Strategy/Filter.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -40,18 +40,6 @@
     caching: false,
     
     /**
-     * Constructor: OpenLayers.Strategy.Filter
-     * Create a new filter strategy.
-     *
-     * Parameters:
-     * options - {Object} Optional object whose properties will be set on the
-     *     instance.
-     */
-    initialize: function(options) {
-        OpenLayers.Strategy.prototype.initialize.apply(this, [options]);
-    },
-
-    /**
      * APIMethod: activate
      * Activate the strategy.  Register any listeners, do appropriate setup.
      *     By default, this strategy automatically activates itself when a layer

Modified: sandbox/tschaub/click/lib/OpenLayers/Strategy/Fixed.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Strategy/Fixed.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Strategy/Fixed.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -25,26 +25,6 @@
     preload: false,
 
     /**
-     * Constructor: OpenLayers.Strategy.Fixed
-     * Create a new Fixed strategy.
-     *
-     * Parameters:
-     * options - {Object} Optional object whose properties will be set on the
-     *     instance.
-     */
-    initialize: function(options) {
-        OpenLayers.Strategy.prototype.initialize.apply(this, [options]);
-    },
-
-    /**
-     * APIMethod: destroy
-     * Clean up the strategy.
-     */
-    destroy: function() {
-        OpenLayers.Strategy.prototype.destroy.apply(this, arguments);
-    },
-
-    /**
      * Method: activate
      * Activate the strategy: load data or add listener to load when visible
      *

Modified: sandbox/tschaub/click/lib/OpenLayers/Strategy/Paging.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Strategy/Paging.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Strategy/Paging.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -41,18 +41,6 @@
     paging: false,
 
     /**
-     * Constructor: OpenLayers.Strategy.Paging
-     * Create a new paging strategy.
-     *
-     * Parameters:
-     * options - {Object} Optional object whose properties will be set on the
-     *     instance.
-     */
-    initialize: function(options) {
-        OpenLayers.Strategy.prototype.initialize.apply(this, [options]);
-    },
-    
-    /**
      * APIMethod: activate
      * Activate the strategy.  Register any listeners, do appropriate setup.
      * 

Modified: sandbox/tschaub/click/lib/OpenLayers/Strategy/Refresh.js
===================================================================
--- sandbox/tschaub/click/lib/OpenLayers/Strategy/Refresh.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/OpenLayers/Strategy/Refresh.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -38,18 +38,6 @@
     timer: null,
 
     /**
-     * Constructor: OpenLayers.Strategy.Refresh
-     * Create a new Refresh strategy.
-     *
-     * Parameters:
-     * options - {Object} Optional object whose properties will be set on the
-     *     instance.
-     */
-    initialize: function(options) {
-        OpenLayers.Strategy.prototype.initialize.apply(this, [options]);
-    },
-   
-    /**
      * APIMethod: activate
      * Activate the strategy. Register any listeners, do appropriate setup.
      * 

Modified: sandbox/tschaub/click/lib/Rico/Color.js
===================================================================
--- sandbox/tschaub/click/lib/Rico/Color.js	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/lib/Rico/Color.js	2011-03-07 14:42:08 UTC (rev 11655)
@@ -1,5 +1,6 @@
 /** 
  * @requires OpenLayers/BaseTypes/Class.js
+ * @requires OpenLayers/BaseTypes/Element.js
  */
 
 
@@ -124,9 +125,8 @@
 OpenLayers.Rico.Color.createColorFromBackground = function(elem) {
 
    var actualColor = 
-      RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(elem), 
-                                        "backgroundColor", 
-                                        "background-color");
+      OpenLayers.Element.getStyle(OpenLayers.Util.getElement(elem), 
+                                        "backgroundColor");
 
    if ( actualColor == "transparent" && elem.parentNode ) {
       return OpenLayers.Rico.Color.createColorFromBackground(elem.parentNode);

Modified: sandbox/tschaub/click/tests/Control/PanZoomBar.html
===================================================================
--- sandbox/tschaub/click/tests/Control/PanZoomBar.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Control/PanZoomBar.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -44,8 +44,9 @@
         control = new OpenLayers.Control.PanZoomBar();
         map.addControl(control);
         control.removeButtons();
+        var div = control.div;
         map.destroy();
-        t.eq(control.div.childNodes.length, 0, "control's div cleared.");
+        t.eq(div.childNodes.length, 0, "control's div cleared.");
         t.eq(control.zoombarDiv, null, "zoombar div nullified.")
     }
 

Modified: sandbox/tschaub/click/tests/Control/SelectFeature.html
===================================================================
--- sandbox/tschaub/click/tests/Control/SelectFeature.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Control/SelectFeature.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -373,6 +373,114 @@
         map.events.triggerEvent("click", evt);
     }
 
+    // test for http://trac.openlayers.org/ticket/2812
+    function test_highlightOnly_toggle(t) {
+        t.plan(8);
+
+        /*
+         * setup
+         */
+
+        var map, layer, ctrl1, ctrl2, _feature, feature, evt, _style;
+
+        map = new OpenLayers.Map("map");
+        layer = new OpenLayers.Layer.Vector("name", {isBaseLayer: true});
+        map.addLayer(layer);
+
+        ctrl1 = new OpenLayers.Control.SelectFeature(layer, {
+            highlightOnly: false,
+            hover: false,
+            clickout: false,
+            toggle: true
+        });
+        map.addControl(ctrl1);
+
+        ctrl2 = new OpenLayers.Control.SelectFeature(layer, {
+            highlightOnly: true,
+            hover: true
+        });
+        map.addControl(ctrl2);
+
+        ctrl2.activate();
+        ctrl1.activate();
+
+        feature = new OpenLayers.Feature.Vector();
+        feature.layer = layer;
+
+        // override the layer's getFeatureFromEvent func so that it always
+        // returns the feature referenced to by _feature
+        layer.getFeatureFromEvent = function(evt) { return _feature; };
+
+        evt = {xy: new OpenLayers.Pixel(Math.random(), Math.random())};
+
+        map.zoomToMaxExtent();
+
+        /*
+         * tests
+         */
+
+        // with renderIntent
+
+        ctrl1.renderIntent = "select";
+        ctrl2.renderIntent = "temporary";
+
+        // mouse over feature, feature is drawn with "temporary"
+        _feature = feature;
+        evt.type = "mousemove";
+        map.events.triggerEvent("mousemove", evt);
+        t.eq(feature.renderIntent, "temporary",
+             "feature drawn with expected render intent after \"mouseover\"");
+
+        // click in feature, feature is drawn with "select"
+        _feature = feature;
+        evt.type = "click";
+        map.events.triggerEvent("click", evt);
+        t.eq(feature.renderIntent, "select",
+             "feature drawn with expected render intent after \"clickin\"");
+
+        // mouse out of feature, feature is still drawn with "select"
+        _feature = null;
+        evt.type = "mousemove";
+        map.events.triggerEvent("mousemove", evt);
+        t.eq(feature.renderIntent, "select",
+             "feature drawn with expected render intent after \"mouseout\"");
+
+        // mouse over feature again, feature is drawn with "temporary"
+        _feature = feature;
+        evt.type = "mousemove";
+        map.events.triggerEvent("mousemove", evt);
+        t.eq(feature.renderIntent, "temporary",
+             "feature drawn with expected render intent after \"mouseover\"");
+
+        // click in feature again, feature is drawn with "default"
+        _feature = feature;
+        evt.type = "click";
+        map.events.triggerEvent("click", evt);
+        t.eq(feature.renderIntent, "default",
+             "feature drawn with expected render intent after \"clickin\"");
+
+        // mouse out of feature again, feature is still drawn with "default"
+        _feature = null;
+        evt.type = "mousemove";
+        map.events.triggerEvent("mousemove", evt);
+        t.eq(feature.renderIntent, "default",
+             "feature drawn with expected render intent after \"mouseout\"");
+
+        // mouse over feature again, feature is drawn with "temporary"
+        _feature = feature;
+        evt.type = "mousemove";
+        map.events.triggerEvent("mousemove", evt);
+        t.eq(feature.renderIntent, "temporary",
+             "feature drawn with expected render intent after \"mouseover\"");
+
+        // mouse out of feature again, feature is still drawn with "default"
+        _feature = null;
+        evt.type = "mousemove";
+        map.events.triggerEvent("mousemove", evt);
+        t.eq(feature.renderIntent, "default",
+             "feature drawn with expected render intent after \"mouseout\"");
+    }
+
     function test_setLayer(t) {
         t.plan(5);
         var map = new OpenLayers.Map("map");

Modified: sandbox/tschaub/click/tests/Control.html
===================================================================
--- sandbox/tschaub/click/tests/Control.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Control.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -60,7 +60,7 @@
     }
 
     function test_Control_destroy(t) {
-        t.plan(3);
+        t.plan(4);
     
         var map = new OpenLayers.Map('map');
         var control = new OpenLayers.Control();
@@ -70,6 +70,7 @@
         t.ok(map.controls[map.controls.length - 1] != control, "map.controls doesn't contains control");
 
         t.ok(control.map == null, "Control.map is null");
+        t.ok(control.div == null, "Control.div is null");
         t.ok(control.handler == null, "Control.handler is null");
     }
     

Modified: sandbox/tschaub/click/tests/Format/GeoJSON.html
===================================================================
--- sandbox/tschaub/click/tests/Format/GeoJSON.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Format/GeoJSON.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -95,6 +95,19 @@
         t.eq(data.components[1].y, 1, "y of second component is right");    
     }
 
+    function test_Format_GeoJSON_multipoint_projected(t) {
+        t.plan(1);
+        var f = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint([
+            new OpenLayers.Geometry.Point(15555162, 4247484)]));
+        var format = new OpenLayers.Format.GeoJSON({
+            internalProjection: new OpenLayers.Projection("EPSG:900913"),
+            externalProjection: new OpenLayers.Projection("EPSG:4326")
+        });
+        var data = format.write(f);
+        var found = (data.search('139.734') != -1);
+        t.ok(found, "Found 139.734 (correct reprojection) in data output.");
+    }        
+
     function test_Format_GeoJSON_multiline(t) {
         t.plan(3);
 

Modified: sandbox/tschaub/click/tests/Format/KML.html
===================================================================
--- sandbox/tschaub/click/tests/Format/KML.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Format/KML.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -9,7 +9,6 @@
     var test_style_outline = '<kml xmlns="http://earth.google.com/kml/2.0"> <Placemark>    <Style> <PolyStyle> <outline>0</outline> <color>870000ff</color> <width>10</width> </PolyStyle> </Style>  <LineString> <coordinates> -112,36 -113,37 </coordinates> </LineString> </Placemark></kml>';
     var test_style_font = '<kml xmlns="http://earth.google.com/kml/2.0"> <Placemark><Style><LabelStyle><color>870000ff</color><scale>1.5</scale></LabelStyle></Style><LineString><coordinates> -112,36 -113,37 </coordinates></LineString></Placemark></kml>';
     var test_nl = '<kml xmlns="http://earth.google.com/kml/2.2"> <Document> <NetworkLink> <Link> <href>http://maker.geocommons.com/maps/1717/overlays/0</href> </Link> </NetworkLink> </Document></kml>';
-
     function test_Format_KML_constructor(t) { 
         t.plan(5); 
          
@@ -23,7 +22,20 @@
         t.eq(format.externalProjection.getCode(), "EPSG:4326", 
              "default external projection is EPSG:4326"); 
     }
-
+    function test_Format_KML_multipoint(t) {
+        t.plan(1);
+        var f = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint([
+            new OpenLayers.Geometry.Point(15555162, 4247484)]));
+        var format = new OpenLayers.Format.KML({
+            extractStyles:      true, 
+            extractAttributes:  true,
+            internalProjection: new OpenLayers.Projection("EPSG:900913"),
+            externalProjection: new OpenLayers.Projection("EPSG:4326")
+        });
+        var data = format.write(f);
+        var found = (data.search('139.734') != -1);
+        t.ok(found, "Found 139.734 (correct reprojection) in data output.");
+    }        
     function test_Format_KML_read(t) {
         t.plan(5);
         var features = (new OpenLayers.Format.KML()).read(this.test_content);
@@ -35,6 +47,7 @@
              "read geometry collection");
     }
 
+    
     function test_Format_KML_readCdataAttributes_20(t) {
         t.plan(2);
         var cdata = '<kml xmlns="http://earth.google.com/kml/2.0"><Document><Placemark><name><![CDATA[Pezinok]]> </name><description><![CDATA[Full of text.]]></description><styleUrl>#rel1.0</styleUrl><Point> <coordinates>17.266666, 48.283333</coordinates></Point></Placemark></Document></kml>';

Modified: sandbox/tschaub/click/tests/Format/OSM.html
===================================================================
--- sandbox/tschaub/click/tests/Format/OSM.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Format/OSM.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -95,6 +95,18 @@
             output = output.replace(/<\?[^>]*\?>/, '');
             t.eq(output, osm_serialized_data[key], key + " serialized correctly");
         }
+    }   
+    function test_Format_OSM_write_reproject(t) {
+        t.plan(1);
+        var f = new OpenLayers.Format.OSM({'internalProjection': new OpenLayers.Projection("EPSG:900913")});
+        var feat = new OpenLayers.Feature.Vector(
+            new OpenLayers.Geometry.Point(100000, 100000)
+            );
+        var data = f.write([feat]);
+        var f = new OpenLayers.Format.OSM();
+        var features = f.read(data);
+
+        t.eq(OpenLayers.Util.toFloat(features[0].geometry.x, 3), .898, "exported to lonlat and re-read as lonlat correctly")
     }    
     </script> 
 </head> 

Modified: sandbox/tschaub/click/tests/Format/OWSContext/v0_3_1.html
===================================================================
--- sandbox/tschaub/click/tests/Format/OWSContext/v0_3_1.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Format/OWSContext/v0_3_1.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -4,7 +4,7 @@
     <script type="text/javascript">
 
     function test_read_wmswfs(t) {
-        t.plan(16);
+        t.plan(17);
         // taken from http://www.ogcnetwork.net/schemas/owc/0.3.1/context_nested.xml
         // adapted: add an extra slash (roads/railways) in the Title of the WMS layer to test nesting
         var text = '<?xml version="1.0" encoding="UTF-8"?>' +
@@ -61,6 +61,7 @@
         map.zoomToExtent(new OpenLayers.Bounds(-117, 32, -116, 33));
         var owc = parser.write(map, {id: 'ows-context-ex-1-v3', title: 'OWS Context version 0.3.1 showing nested layers'});
         t.xml_eq(text, owc, "Can we roundtrip this nested OWSContext with a WMS and WFS layer?");
+        t.eq(context.layers[1].metadata.nestingPath[0], "Tiger 2005fe major roads/railways", "Nesting path is preserved even after calling write");
     }
 
     function test_write_wmswfs(t) {

Modified: sandbox/tschaub/click/tests/Handler/Drag.html
===================================================================
--- sandbox/tschaub/click/tests/Handler/Drag.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Handler/Drag.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -440,7 +440,159 @@
              "deactivate sets start to null");
     }
 
+    function test_interval_timer_after_mouseup(t) {
+        t.plan(5);
 
+        // set up
+
+        var map = new OpenLayers.Map('map');
+
+        var control = new OpenLayers.Control();
+        map.addControl(control);
+
+        var moveCnt;
+
+        var handler = new OpenLayers.Handler.Drag(control, {}, {
+            interval: 1,
+            move: function() {
+                moveCnt++;
+            }
+        });
+        handler.activate();
+
+        handler.checkModifiers = function() { return true; };
+
+        var ilc = OpenLayers.Event.isLeftClick;
+        OpenLayers.Event.isLeftClick = function() { return true; };
+
+        // test
+
+        moveCnt = 0;
+
+        var xy1 = new OpenLayers.Pixel(1, 2);
+        handler.mousedown({xy: xy1});
+        t.ok(handler.last == xy1, "[mousedown] last is as expected");
+        var xy2 = new OpenLayers.Pixel(2, 3);
+        handler.mousemove({xy: xy2});
+        t.ok(handler.last == xy2, "[mousemove 1] last is as expected");
+        t.ok(handler.timeoutId != null, "[mousemove 1] timeoutId is set");
+        var xy3 = new OpenLayers.Pixel(3, 4);
+        handler.mousemove({xy: xy3});
+        t.ok(handler.last == xy2, "[mousemove 2] last is as expected");
+        var xy4 = new OpenLayers.Pixel(4, 5);
+        handler.mouseup({xy: xy4});
+
+        t.delay_call(3, function() {
+            // the timer should not cause a move
+            t.eq(moveCnt, 1, "move called once");
+            // tear down
+            OpenLayers.Event.isLeftClick = ilc;
+        });
+    }
+
+    function test_interval_timer_after_mousedown(t) {
+        t.plan(5);
+
+        // set up
+
+        var map = new OpenLayers.Map('map');
+
+        var control = new OpenLayers.Control();
+        map.addControl(control);
+
+        var moveCnt;
+
+        var handler = new OpenLayers.Handler.Drag(control, {}, {
+            interval: 1,
+            move: function() {
+                moveCnt++;
+            }
+        });
+        handler.activate();
+
+        handler.checkModifiers = function() { return true; };
+
+        var ilc = OpenLayers.Event.isLeftClick;
+        OpenLayers.Event.isLeftClick = function() { return true; };
+
+        // test
+
+        moveCnt = 0;
+
+        var xy1 = new OpenLayers.Pixel(1, 2);
+        handler.mousedown({xy: xy1});
+        t.ok(handler.last == xy1, "[mousedown] last is as expected");
+        var xy2 = new OpenLayers.Pixel(2, 3);
+        handler.mousemove({xy: xy2});
+        t.ok(handler.last == xy2, "[mousemove 1] last is as expected");
+        t.ok(handler.timeoutId != null, "[mousemove 1] timeoutId is set");
+        var xy3 = new OpenLayers.Pixel(3, 4);
+        handler.mousemove({xy: xy3});
+        t.ok(handler.last == xy2, "[mousemove 2] last is as expected");
+        var xy4 = new OpenLayers.Pixel(4, 5);
+        handler.mouseup({xy: xy4});
+        var xy5 = new OpenLayers.Pixel(5, 6);
+        handler.mousedown({xy: xy4});
+
+        t.delay_call(3, function() {
+            // the timer should not cause a move
+            t.eq(moveCnt, 1, "move called once");
+            // tear down
+            OpenLayers.Event.isLeftClick = ilc;
+        });
+    }
+
+    function test_interval_timer_before_mouseup(t) {
+        t.plan(5);
+
+        // set up
+
+        var map = new OpenLayers.Map('map');
+
+        var control = new OpenLayers.Control();
+        map.addControl(control);
+
+        var moveCnt;
+
+        var handler = new OpenLayers.Handler.Drag(control, {}, {
+            interval: 1,
+            move: function() {
+                moveCnt++;
+            }
+        });
+        handler.activate();
+
+        handler.checkModifiers = function() { return true; };
+
+        var ilc = OpenLayers.Event.isLeftClick;
+        OpenLayers.Event.isLeftClick = function() { return true; };
+
+        // test
+
+        moveCnt = 0;
+
+        var xy1 = new OpenLayers.Pixel(1, 2);
+        handler.mousedown({xy: xy1});
+        t.ok(handler.last == xy1, "[mousedown] last is as expected");
+        var xy2 = new OpenLayers.Pixel(2, 3);
+        handler.mousemove({xy: xy2});
+        t.ok(handler.last == xy2, "[mousemove 1] last is as expected");
+        t.ok(handler.timeoutId != null, "[mousemove 1] timeoutId is set");
+        var xy3 = new OpenLayers.Pixel(3, 4);
+        handler.mousemove({xy: xy3});
+        t.ok(handler.last == xy2, "[mousemove 2] last is as expected");
+
+        t.delay_call(3, function() {
+            // the timer should cause a move
+            t.eq(moveCnt, 2, "move called twice");
+            var xy4 = new OpenLayers.Pixel(4, 5);
+            handler.mouseup({xy: xy4});
+            // tear down
+            OpenLayers.Event.isLeftClick = ilc;
+        });
+    }
+
+
   </script>
 </head>
 <body>

Modified: sandbox/tschaub/click/tests/Layer/GML.html
===================================================================
--- sandbox/tschaub/click/tests/Layer/GML.html	2011-03-07 14:34:45 UTC (rev 11654)
+++ sandbox/tschaub/click/tests/Layer/GML.html	2011-03-07 14:42:08 UTC (rev 11655)
@@ -37,8 +37,8 @@
         var map = new OpenLayers.Map("map");
         map.addLayer(layer);
         map.zoomToMaxExtent();
-        t.delay_call(1, function() { 
-            t.ok(true, "waited for 1s"); 
+        t.delay_call(3, function() { 
+            t.ok(true, "waited for 3s"); 
         });
 
     }



More information about the Commits mailing list