* Remove default styling from the Feature.Vector class.

* Add a 'style' property to the layer.
 * When a feature is added to a layer, either uses the style on the 
   layer, or uses the default feature style.
 * Add test to Layer.Vector for this funcionality 
 * Adds a preFeatureInsert hook to change a feature *before* 
   drawing it.
 * Change openmnnd demo to include the use of preFeatureInsert
   and style attribute on layer.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2949 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-04-01 12:08:13 +00:00
parent adee1fb217
commit 53977cf840
4 changed files with 68 additions and 6 deletions

View File

@@ -44,6 +44,17 @@
t.ok(layer.features.length == 1, "OpenLayers.Layer.Vector.removeFeatures removes a feature from the features array");
}
function test_Layer_Vector_addsStyle (t) {
t.plan(2);
layer = new OpenLayers.Layer.Vector(name);
var map = new OpenLayers.Map('map');
map.addLayer(layer);
f = new OpenLayers.Feature.Vector();
t.eq( f.style, null, "Feature style is null by default.");
layer.addFeatures(f);
t.ok( f.style != null, "Feature style is set by layer.");
}
function test_99_Layer_Vector_destroy (t) {
t.plan(1);