[OpenLayers-Commits] r11778 - in sandbox/cmoullet/openlayers: examples lib/OpenLayers/Format tests/Layer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Mar 30 08:40:59 EDT 2011


Author: cmoullet
Date: 2011-03-30 05:40:58 -0700 (Wed, 30 Mar 2011)
New Revision: 11778

Removed:
   sandbox/cmoullet/openlayers/examples/3DTransformation.html
   sandbox/cmoullet/openlayers/examples/dpx.html
   sandbox/cmoullet/openlayers/examples/navigator.html
   sandbox/cmoullet/openlayers/examples/navigator.js
   sandbox/cmoullet/openlayers/examples/screen.html
Modified:
   sandbox/cmoullet/openlayers/lib/OpenLayers/Format/WMSGetFeatureInfo.js
   sandbox/cmoullet/openlayers/tests/Layer/Image.html
Log:
Merge with trunk


Deleted: sandbox/cmoullet/openlayers/examples/3DTransformation.html
===================================================================
--- sandbox/cmoullet/openlayers/examples/3DTransformation.html	2011-03-30 12:10:23 UTC (rev 11777)
+++ sandbox/cmoullet/openlayers/examples/3DTransformation.html	2011-03-30 12:40:58 UTC (rev 11778)
@@ -1,57 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-        "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-    <title>CSS 3D transformation</title>
-    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
-    <meta name="apple-mobile-web-app-capable" content="yes"/>
-    <script type="text/javascript" src="../lib/OpenLayers.js"></script>
-    <style type="text/css">
-        body {
-            -webkit-transform-style: preserve-3d;
-            -webkit-perspective: 250;
-            -moz-transform-style: preserve-3d;
-            -moz-perspective: 250;
-            -o-transform-style: preserve-3d;
-            -o-perspective: 250;
-            transform-style: preserve-3d;
-            perspective: 250;
-        }
-    </style>
-    <script type="text/javascript">
-        function init() {
-            var map = new OpenLayers.Map({
-                div: "map",
-                theme: null,
-                controls: [
-                    new OpenLayers.Control.TouchNavigation({
-                        dragPanOptions: {
-                            interval: 100,
-                            enableKinetic: true
-                        }
-                    })
-                ],
-                layers: [
-                    new OpenLayers.Layer.OSM("OpenStreetMap", null, {
-                        transitionEffect: 'resize'
-                    })
-                ],
-                center: new OpenLayers.LonLat(771595.97057525, 5912284.7041793),
-                zoom: 16
-            });
-
-        }
-    </script>
-</head>
-<body onload="init()">
-
-<div id="map" style="
-    -webkit-transform: rotateX(30deg);
-    -moz-transform:rotateX(30deg);
-    -o-transform:rotateX(30deg);
-    transform: rotateX(30deg);
-    height: 600px;
-    width: 100%;"></div>
-
-</body>
-</html>
\ No newline at end of file

Deleted: sandbox/cmoullet/openlayers/examples/dpx.html
===================================================================
--- sandbox/cmoullet/openlayers/examples/dpx.html	2011-03-30 12:10:23 UTC (rev 11777)
+++ sandbox/cmoullet/openlayers/examples/dpx.html	2011-03-30 12:40:58 UTC (rev 11778)
@@ -1,64 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <title>dpx</title>
-    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0;">
-    <style type="text/css">
-        html, body {
-            height: 100%;
-            margin: 0;
-        }
-
-        #target {
-            width: 100%;
-            height: 100%;
-            background: #ccc;
-            font-size: 3em;
-            text-align: center;
-        }
-    </style>
-</head>
-<body>
-<div id="target">tap twice</div>
-
-<script type="text/javascript">
-    var counter = 0;
-    var dist = 0;
-    var distArray = [];
-    var x, y;
-    var target = document.getElementById("target");
-    // Statistic function for average, variance and standard deviation
-    var average = function(a) {
-        var r = {mean: 0, variance: 0, deviation: 0}, t = a.length;
-        for (var m, s = 0, l = t; l--; s += a[l]) {
-        }
-        for (m = r.mean = s / t,l = t,s = 0; l--; s += Math.pow(a[l] - m, 2)) {
-        }
-        return r.deviation = Math.sqrt(r.variance = s / t),r;
-    };
-    function down(evt) {
-        var newX = evt.touches && evt.touches[0].clientX || evt.clientX;
-        var newY = evt.touches && evt.touches[0].clientY || evt.clientY;
-        if (typeof x !== "number") {
-            x = newX;
-            y = newY;
-        } else {
-            ++counter;
-            dist = Math.sqrt(
-                    Math.pow(x - newX, 2) +
-                    Math.pow(y - newY, 2)
-                    );
-            distArray.push(dist);
-            target.innerHTML = "pair " + counter + " - dist : " + ( dist | 0) +
-                               " - avg: " + Math.round(average(distArray).mean * 10) / 10 +
-                               " - std: " + Math.round(average(distArray).deviation * 10) / 10;
-            x = null;
-            y = null;
-        }
-        evt.preventDefault();
-    }
-    target.addEventListener("touchstart", down, false);
-    target.addEventListener("mousedown", down, false);
-</script>
-</body>
-</html>

Deleted: sandbox/cmoullet/openlayers/examples/navigator.html
===================================================================
--- sandbox/cmoullet/openlayers/examples/navigator.html	2011-03-30 12:10:23 UTC (rev 11777)
+++ sandbox/cmoullet/openlayers/examples/navigator.html	2011-03-30 12:40:58 UTC (rev 11778)
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-        "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-    <title>Navigator example</title>
-    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
-    <meta name="apple-mobile-web-app-capable" content="yes"/>
-    <script type="text/javascript" src="../lib/OpenLayers.js"></script>
-    <script type="text/javascript" src="navigator.js"></script>
-    <style type="text/css">
-        body {
-            -webkit-transform-style: preserve-3d;
-            -webkit-perspective: 200;
-        }
-        #title, #tags, #shortdesc {
-            display: none;
-        }
-    </style>
-</head>
-<body onload="init()">
-
-<h1 id="title">Navigator Mobile Example</h1>
-
-<div id="tags">
-    mobile, navigator
-</div>
-<p id="shortdesc">
-    An example of a navigator using accelerometer and direction.
-</p>
-
-<div id="map" style="
-    -webkit-transform: rotateX(30deg);
-    transform: rotateX(30deg);
-    height: 600px;
-    width: 100%;"></div>
-
-</body>
-</html>

Deleted: sandbox/cmoullet/openlayers/examples/navigator.js
===================================================================
--- sandbox/cmoullet/openlayers/examples/navigator.js	2011-03-30 12:10:23 UTC (rev 11777)
+++ sandbox/cmoullet/openlayers/examples/navigator.js	2011-03-30 12:40:58 UTC (rev 11778)
@@ -1,56 +0,0 @@
-// initialize map when page ready
-var map;
-
-var init = function () {
-    // create map
-    map = new OpenLayers.Map({
-        div: "map",
-        theme: null,
-        controls: [
-            new OpenLayers.Control.TouchNavigation({
-                dragPanOptions: {
-                    interval: 100,
-                    enableKinetic: true
-                }
-            })
-        ],
-        layers: [
-            new OpenLayers.Layer.OSM("OpenStreetMap", null, {
-                transitionEffect: 'resize'
-            })
-        ],
-        center: new OpenLayers.LonLat(742000, 5881000),
-        zoom: 3
-    });
-
-    // Create a GeoLocation API Control
-    var geolocate = new OpenLayers.Control.Geolocate({
-        watch: true,
-        geolocationOptions: {
-            enableHighAccuracy: false,
-            maximumAge: 0,
-            timeout: 10000
-        }
-
-    });
-    map.addControl(geolocate);
-    
-    geolocate.events.register("locationupdated", this, function(e) {
-        map.zoomTo(17);
-    });
-
-    geolocate.events.register("locationuncapable", this, function(e) {
-        alert("Your browser doesn't support geolocation. Please update to a modern browser.");
-    });
-
-    geolocate.events.register("locationfailed", this, function(e) {
-        switch (e.error.code) {
-            case 0: alert(OpenLayers.i18n("There was an error while retrieving your location: ") + e.error.message); break;
-            case 1: alert(OpenLayers.i18n("The user didn't accept to provide the location: ")); break;
-            case 2: alert(OpenLayers.i18n("The browser was unable to determine your location: ") + e.error.message); break;
-            case 3: alert(OpenLayers.i18n("The browser timed out before retrieving the location.")); break;
-        }
-    });
-
-    geolocate.activate();
-};

Deleted: sandbox/cmoullet/openlayers/examples/screen.html
===================================================================
--- sandbox/cmoullet/openlayers/examples/screen.html	2011-03-30 12:10:23 UTC (rev 11777)
+++ sandbox/cmoullet/openlayers/examples/screen.html	2011-03-30 12:40:58 UTC (rev 11778)
@@ -1,37 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
-    <meta name="apple-mobile-web-app-capable" content="yes"/>
-    <title>OpenLayers Browser Detection</title>
-    <link rel="stylesheet" href="../theme/default/style.css" type="text/css"/>
-    <link rel="stylesheet" href="style.css" type="text/css"/>
-    <style type="text/css">
-    </style>
-    <script type="text/javascript">
-        function init() {
-            var resultDiv = document.getElementById("result");
-            resultDiv.innerHTML = screen.width+' x '+screen.height + "pixels";
-
-        }
-    </script>
-</head>
-<body onload="init()">
-<h1 id="title">Screen resolution</h1>
-
-<div id="tags">
-    browser, mobile, screen
-</div>
-
-<p id="shortdesc">
-    The goal of this script is to determine the screen resolution of the used device.
-</p>
-
-<h1>Your screen resolution</h1>
-
-<div id="result">
-</div>
-
-
-</body>
-</html>

Modified: sandbox/cmoullet/openlayers/lib/OpenLayers/Format/WMSGetFeatureInfo.js
===================================================================
--- sandbox/cmoullet/openlayers/lib/OpenLayers/Format/WMSGetFeatureInfo.js	2011-03-30 12:10:23 UTC (rev 11777)
+++ sandbox/cmoullet/openlayers/lib/OpenLayers/Format/WMSGetFeatureInfo.js	2011-03-30 12:40:58 UTC (rev 11778)
@@ -1,5 +1,5 @@
-/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
- * full list of contributors). Published under the Clear BSD license.
+/* 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. */
 
@@ -20,12 +20,12 @@
      * APIProperty: layerIdentifier
      * {String} All xml nodes containing this search criteria will populate an
      *     internal array of layer nodes.
-     */
+     */ 
     layerIdentifier: '_layer',
 
     /**
      * APIProperty: featureIdentifier
-     * {String} All xml nodes containing this search criteria will populate an
+     * {String} All xml nodes containing this search criteria will populate an 
      *     internal array of feature nodes for each layer node found.
      */
     featureIdentifier: '_feature',
@@ -88,8 +88,8 @@
         }
         return result;
     },
-
-
+    
+    
     /**
      * Method: read_msGMLOutput
      * Parse msGMLOutput nodes.
@@ -112,14 +112,14 @@
                     layerName = layerName.split(':')[1];
                 }
                 var layerName = layerName.replace(this.layerIdentifier, '');
-                var featureNodes = this.getSiblingNodesByTagCriteria(node,
+                var featureNodes = this.getSiblingNodesByTagCriteria(node, 
                     this.featureIdentifier);
                 if (featureNodes) {
                     for (var j = 0; j < featureNodes.length; j++) {
                         var featureNode = featureNodes[j];
                         var geomInfo = this.parseGeometry(featureNode);
                         var attributes = this.parseAttributes(featureNode);
-                        var feature = new OpenLayers.Feature.Vector(geomInfo.geometry,
+                        var feature = new OpenLayers.Feature.Vector(geomInfo.geometry, 
                             attributes, null);
                         feature.bounds = geomInfo.bounds;
                         feature.type = layerName;
@@ -130,7 +130,7 @@
         }
         return response;
     },
-
+    
     /**
      * Method: read_FeatureInfoResponse
      * Parse FeatureInfoResponse nodes.
@@ -180,18 +180,18 @@
 
     /**
      * Method: getSiblingNodesByTagCriteria
-     * Recursively searches passed xml node and all it's descendant levels for
-     *     nodes whose tagName contains the passed search string. This returns an
-     *     array of all sibling nodes which match the criteria from the highest
+     * Recursively searches passed xml node and all it's descendant levels for 
+     *     nodes whose tagName contains the passed search string. This returns an 
+     *     array of all sibling nodes which match the criteria from the highest 
      *     hierarchial level from which a match is found.
-     *
+     * 
      * Parameters:
      * node - {DOMElement} An xml node
-     * criteria - {String} Search string which will match some part of a tagName
-     *
+     * criteria - {String} Search string which will match some part of a tagName 
+     *                                       
      * Returns:
      * Array({DOMElement)) An array of sibling xml nodes
-     */
+     */                
     getSiblingNodesByTagCriteria: function(node, criteria){
         var nodes = [];
         var children, tagName, n, matchNodes, child;
@@ -213,7 +213,7 @@
                         child, criteria);
 
                     if(matchNodes.length > 0){
-                        (nodes.length == 0) ?
+                        (nodes.length == 0) ? 
                             nodes = matchNodes : nodes.push(matchNodes);
                     }
                 }
@@ -231,11 +231,11 @@
      *
      * Returns:
      * {Object} An attributes object.
-     *
+     * 
      * Notes:
      * Assumes that attributes are direct child xml nodes of the passed node
-     * and contain only a single text node.
-     */
+     * and contain only a single text node. 
+     */    
     parseAttributes: function(node){
         var attributes = {};
         if (node.nodeType == 1) {
@@ -266,7 +266,7 @@
 
     /**
      * Method: parseGeometry
-     * Parse the geometry and the feature bounds out of the node using
+     * Parse the geometry and the feature bounds out of the node using 
      *     Format.GML
      *
      * Parameters:
@@ -276,7 +276,7 @@
      * {Object} An object containing the geometry and the feature bounds
     */
     parseGeometry: function(node) {
-        // we need to use the old Format.GML parser since we do not know the
+        // we need to use the old Format.GML parser since we do not know the 
         // geometry name
         if (!this.gmlFormat) {
             this.gmlFormat = new OpenLayers.Format.GML();
@@ -292,5 +292,5 @@
     },
 
     CLASS_NAME: "OpenLayers.Format.WMSGetFeatureInfo"
-
+    
 });

Modified: sandbox/cmoullet/openlayers/tests/Layer/Image.html
===================================================================
--- sandbox/cmoullet/openlayers/tests/Layer/Image.html	2011-03-30 12:10:23 UTC (rev 11777)
+++ sandbox/cmoullet/openlayers/tests/Layer/Image.html	2011-03-30 12:40:58 UTC (rev 11778)
@@ -146,7 +146,7 @@
             delay = true;
         });
 
-        t.delay_call(0.4,function() {
+        t.delay_call(5, function() {
             t.eq(delay, true, "registered for loadend");
             t.eq(layer.tile.isLoading, false, "loadend triggered after tile is loaded");
             map.destroy(); //tear down



More information about the Commits mailing list