Hello,

I'm trying to add a vector layer to a map on an undisplayed element. I get an error in 2.10 and it was working in 2.7.

After looking at the code it seems related to:
 http://trac.osgeo.org/openlayers/ticket/2414

It's working with 2.7 and 2.8 and started to fail at 2.9.

I attached a patch that add a test for this. Is this relevant?
I'm not sure what's the right way to fix this. Fix getCurrentSize() or fix Renderer.js to validate if the size is valid.

Julien
--
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/
Index: tests/Map.html
===================================================================
--- tests/Map.html	(revision 11889)
+++ tests/Map.html	(working copy)
@@ -1654,7 +1654,17 @@
             msg += ": " + err;
         }
         t.ok(!!map, msg);
+
+        t.plan(2);
         
+        var success = 1;
+        try {
+            map.addLayer(new OpenLayers.Layer.Vector("name"));
+        } catch (err) {
+            success = 0;
+        }
+        t.ok(success, "adding a layer to a map in an undisplayed element");
+        
         if (map) {
             map.destroy();
         }        
_______________________________________________
Dev mailing list
d...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-dev

Reply via email to