Fire change events for multi-part geometries

This commit is contained in:
ahocevar
2013-10-04 23:36:16 -06:00
parent 703564fcbb
commit 52552c9b18
19 changed files with 253 additions and 114 deletions

View File

@@ -1,6 +1,8 @@
goog.provide('ol.geom.MultiPoint');
goog.require('goog.asserts');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('ol.CoordinateArray');
goog.require('ol.geom.AbstractCollection');
goog.require('ol.geom.GeometryType');
@@ -21,10 +23,14 @@ ol.geom.MultiPoint = function(coordinates) {
/**
* @type {Array.<ol.geom.Point>}
* @protected
*/
this.components = new Array(numParts);
for (var i = 0; i < numParts; ++i) {
this.components[i] = new ol.geom.Point(coordinates[i]);
var component = new ol.geom.Point(coordinates[i]);
this.components[i] = component;
goog.events.listen(component, goog.events.EventType.CHANGE,
this.handleComponentChange, false, this);
}
};