Changeset 5470
- Timestamp:
- 12/17/07 09:36:39 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Handler/RegularPolygon.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/Vector.js (modified) (3 diffs)
- trunk/openlayers/tests/Layer/test_Vector.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js
r5467 r5470 515 515 } 516 516 collectComponentVertices.call(this, this.feature.geometry); 517 this.layer.addFeatures(this.vertices );518 this.layer.addFeatures(this.virtualVertices );517 this.layer.addFeatures(this.vertices, {silent: true}); 518 this.layer.addFeatures(this.virtualVertices, {silent: true}); 519 519 }, 520 520 … … 535 535 } 536 536 this.dragHandle = origin; 537 this.layer.addFeatures([this.dragHandle] );537 this.layer.addFeatures([this.dragHandle], {silent: true}); 538 538 }, 539 539 … … 575 575 } 576 576 this.radiusHandle = radius; 577 this.layer.addFeatures([this.radiusHandle] );577 this.layer.addFeatures([this.radiusHandle], {silent: true}); 578 578 }, 579 579 trunk/openlayers/lib/OpenLayers/Handler/RegularPolygon.js
r5200 r5470 217 217 this.feature = new OpenLayers.Feature.Vector(); 218 218 this.createGeometry(); 219 this.layer.addFeatures([this.feature] );219 this.layer.addFeatures([this.feature], {silent: true}); 220 220 this.layer.drawFeature(this.feature, this.style); 221 221 }, trunk/openlayers/lib/OpenLayers/Layer/Vector.js
r5429 r5470 243 243 * Parameters: 244 244 * features - {Array(<OpenLayers.Feature.Vector>)} 245 */ 246 addFeatures: function(features) { 245 * options - {Object} 246 */ 247 addFeatures: function(features, options) { 247 248 if (!(features instanceof Array)) { 248 249 features = [features]; 249 250 } 251 252 var notify = !options || !options.silent; 250 253 251 254 for (var i = 0; i < features.length; i++) { … … 268 271 } 269 272 270 this.preFeatureInsert(feature); 273 if (notify) { 274 this.preFeatureInsert(feature); 275 } 271 276 272 277 if (this.drawn) { … … 274 279 } 275 280 276 this.onFeatureInsert(feature); 281 if (notify) { 282 this.onFeatureInsert(feature); 283 } 277 284 } 278 285 }, trunk/openlayers/tests/Layer/test_Vector.html
r5454 r5470 17 17 18 18 function test_02_Layer_Vector_addFeatures(t) { 19 t.plan( 2);19 t.plan(4); 20 20 21 21 var layer = new OpenLayers.Layer.Vector(name); … … 23 23 var point = new OpenLayers.Geometry.Point(-111.04, 45.68); 24 24 var pointFeature = new OpenLayers.Feature.Vector(point); 25 26 layer.preFeatureInsert = function(feature) { 27 t.ok(feature == pointFeature, "OpenLayers.Layer.Vector.addFeatures calls preFeatureInsert with the right arg"); 28 } 29 layer.onFeatureInsert = function(feature) { 30 t.ok(feature == pointFeature, "OpenLayers.Layer.Vector.addFeatures calls onFeatureInsert with the right arg"); 31 } 32 25 33 layer.addFeatures([pointFeature]); 26 34 27 35 t.eq(layer.features.length, 1, "OpenLayers.Layer.Vector.addFeatures adds something to the array"); 28 36 t.ok(layer.features[0] == pointFeature, "OpenLayers.Layer.Vector.addFeatures returns an array of features"); 37 38 layer.preFeatureInsert = function(feature) { 39 t.fail("OpenLayers.Layer.Vector.addFeatures calls preFeatureInsert while it must not"); 40 } 41 layer.onFeatureInsert = function(feature) { 42 t.fail("OpenLayers.Layer.Vector.addFeatures calls onFeatureInsert while it must not"); 43 } 44 45 layer.addFeatures([pointFeature], {silent: true}); 29 46 } 30 47
