[OpenLayers-Commits] r4207 - in sandbox/tschaub/xml/lib/OpenLayers: Format Renderer

commits at openlayers.org commits at openlayers.org
Mon Sep 10 18:38:00 EDT 2007


Author: tschaub
Date: 2007-09-10 18:37:59 -0400 (Mon, 10 Sep 2007)
New Revision: 4207

Modified:
   sandbox/tschaub/xml/lib/OpenLayers/Format/KML.js
   sandbox/tschaub/xml/lib/OpenLayers/Renderer/Elements.js
Log:
let renderers render Geometry.Collection

Modified: sandbox/tschaub/xml/lib/OpenLayers/Format/KML.js
===================================================================
--- sandbox/tschaub/xml/lib/OpenLayers/Format/KML.js	2007-09-10 22:02:18 UTC (rev 4206)
+++ sandbox/tschaub/xml/lib/OpenLayers/Format/KML.js	2007-09-10 22:37:59 UTC (rev 4207)
@@ -89,7 +89,7 @@
             }
         }
         return features;
-     },
+    },
 
     /**
      * Method: parseFeature
@@ -104,9 +104,6 @@
      * {<OpenLayers.Feature.Vector>} A vector feature.
      */
     parseFeature: function(node) {
-        var geom;
-        var p; // [points,bounds]
-
         // only accept one geometry per feature - look for highest "order"
         var order = ["MultiGeometry", "Polygon", "LineString", "Point"];
         var type, nodeList, geometry, parser;
@@ -126,7 +123,7 @@
                 break;
             }
         }
-        
+
         // construct feature (optionally with attributes)
         var attributes;
         if(this.extractAttributes) {

Modified: sandbox/tschaub/xml/lib/OpenLayers/Renderer/Elements.js
===================================================================
--- sandbox/tschaub/xml/lib/OpenLayers/Renderer/Elements.js	2007-09-10 22:02:18 UTC (rev 4206)
+++ sandbox/tschaub/xml/lib/OpenLayers/Renderer/Elements.js	2007-09-10 22:37:59 UTC (rev 4207)
@@ -110,10 +110,11 @@
      * featureId - {String}
      */
     drawGeometry: function(geometry, style, featureId) {
-
-        if ((geometry.CLASS_NAME == "OpenLayers.Geometry.MultiPoint") ||
-            (geometry.CLASS_NAME == "OpenLayers.Geometry.MultiLineString") ||
-            (geometry.CLASS_NAME == "OpenLayers.Geometry.MultiPolygon")) {
+        var className = geometry.CLASS_NAME;
+        if ((className == "OpenLayers.Geometry.Collection") ||
+            (className == "OpenLayers.Geometry.MultiPoint") ||
+            (className == "OpenLayers.Geometry.MultiLineString") ||
+            (className == "OpenLayers.Geometry.MultiPolygon")) {
             for (var i = 0; i < geometry.components.length; i++) {
                 this.drawGeometry(geometry.components[i], style, featureId);
             }



More information about the Commits mailing list