[OpenLayers-Commits] r10951 - in trunk/openlayers/lib/OpenLayers: . Format Handler Layer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Dec 6 15:15:15 EST 2010


Author: erilem
Date: 2010-12-06 12:15:15 -0800 (Mon, 06 Dec 2010)
New Revision: 10951

Modified:
   trunk/openlayers/lib/OpenLayers/Format/GPX.js
   trunk/openlayers/lib/OpenLayers/Format/KML.js
   trunk/openlayers/lib/OpenLayers/Format/OSM.js
   trunk/openlayers/lib/OpenLayers/Handler/Polygon.js
   trunk/openlayers/lib/OpenLayers/Layer/Zoomify.js
   trunk/openlayers/lib/OpenLayers/Renderer.js
Log:
missing var's, p=jorix (thx), r=me (closes #2960)

Modified: trunk/openlayers/lib/OpenLayers/Format/GPX.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/GPX.js	2010-12-06 11:29:40 UTC (rev 10950)
+++ trunk/openlayers/lib/OpenLayers/Format/GPX.js	2010-12-06 20:15:15 UTC (rev 10951)
@@ -162,10 +162,10 @@
         // node is either a wpt, trk or rte
         // attributes are children of the form <attr>value</attr>
         var attributes = {};
-        var attrNode = node.firstChild;
+        var attrNode = node.firstChild, value, name;
         while(attrNode) {
             if(attrNode.nodeType == 1) {
-                var value = attrNode.firstChild;
+                value = attrNode.firstChild;
                 if(value.nodeType == 3 || value.nodeType == 4) {
                     name = (attrNode.prefix) ?
                         attrNode.nodeName.split(":")[1] :

Modified: trunk/openlayers/lib/OpenLayers/Format/KML.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/KML.js	2010-12-06 11:29:40 UTC (rev 10950)
+++ trunk/openlayers/lib/OpenLayers/Format/KML.js	2010-12-06 20:15:15 UTC (rev 10951)
@@ -353,11 +353,10 @@
         
         var types = ["LineStyle", "PolyStyle", "IconStyle", "BalloonStyle", 
                      "LabelStyle"];
-        var type, nodeList, geometry, parser;
+        var type, styleTypeNode, nodeList, geometry, parser;
         for(var i=0, len=types.length; i<len; ++i) {
             type = types[i];
-            styleTypeNode = this.getElementsByTagNameNS(node, 
-                                                   "*", type)[0];
+            styleTypeNode = this.getElementsByTagNameNS(node, "*", type)[0];
             if(!styleTypeNode) { 
                 continue;
             }

Modified: trunk/openlayers/lib/OpenLayers/Format/OSM.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/OSM.js	2010-12-06 11:29:40 UTC (rev 10950)
+++ trunk/openlayers/lib/OpenLayers/Format/OSM.js	2010-12-06 20:15:15 UTC (rev 10951)
@@ -374,13 +374,14 @@
             return already_exists ? [] : [node];
         }, 
         linestring: function(feature) {
+            var id;
             var nodes = [];
             var geometry = feature.geometry;
             if (feature.osm_id) {
                 id = feature.osm_id;
             } else {
-               id = -this.osm_id;
-               this.osm_id++; 
+                id = -this.osm_id;
+                this.osm_id++; 
             }
             var way = this.createElementNS(null, "way");
             way.setAttribute("id", id);

Modified: trunk/openlayers/lib/OpenLayers/Handler/Polygon.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Polygon.js	2010-12-06 11:29:40 UTC (rev 10950)
+++ trunk/openlayers/lib/OpenLayers/Handler/Polygon.js	2010-12-06 20:15:15 UTC (rev 10951)
@@ -162,7 +162,7 @@
                 // ensure that new ring doesn't contain any other rings
                 var target;
                 outer: for (var i=rings.length-2; i>0; --i) {
-                    points = rings[i].components;
+                    var points = rings[i].components;
                     for (var j=0, jj=points.length; j<jj; ++j) {
                         if (ring.containsPoint(points[j])) {
                             modified = false;

Modified: trunk/openlayers/lib/OpenLayers/Layer/Zoomify.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/Zoomify.js	2010-12-06 11:29:40 UTC (rev 10950)
+++ trunk/openlayers/lib/OpenLayers/Layer/Zoomify.js	2010-12-06 20:15:15 UTC (rev 10951)
@@ -219,7 +219,7 @@
      */
     getImageSize: function() {
         if (arguments.length > 0) {
-            bounds = this.adjustBounds(arguments[0]);
+            var bounds = this.adjustBounds(arguments[0]);
             var res = this.map.getResolution();
             var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w));
             var y = Math.round((this.tileOrigin.lat - bounds.top) / (res * this.tileSize.h));

Modified: trunk/openlayers/lib/OpenLayers/Renderer.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Renderer.js	2010-12-06 11:29:40 UTC (rev 10950)
+++ trunk/openlayers/lib/OpenLayers/Renderer.js	2010-12-06 20:15:15 UTC (rev 10951)
@@ -181,8 +181,8 @@
                 if(style.display != "none" && style.label && rendered !== false) {
                     var location = feature.geometry.getCentroid(); 
                     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);
                     }



More information about the Commits mailing list