Remove ol.geom.GeometryEvent

This removes geometry specific change events.  Since geometries are mere observables, we only get generic change events.  To minimize changes in other places, as a workaround, we cache geometry bounds on features.  This is not the way things should be long term, but the objective is to remove the geometry specific event.
This commit is contained in:
Tim Schaub
2013-12-13 16:02:51 -07:00
parent 5caa0eb659
commit ec7fea090b
11 changed files with 25 additions and 86 deletions
-4
View File
@@ -143,10 +143,8 @@ describe('ol.geom.Polygon', function() {
it('is fired when outer ring is modified', function(done) {
var poly = new ol.geom.Polygon([outer, inner]);
var rings = poly.getRings();
var bounds = poly.getBounds();
goog.events.listen(poly, 'change', function(evt) {
expect(evt.target).to.be(poly);
expect(evt.oldExtent).to.eql(bounds);
expect(evt.target.getBounds()).to.eql([0, 0, 11, 10]);
done();
});
@@ -159,10 +157,8 @@ describe('ol.geom.Polygon', function() {
it('is fired when inner ring is modified', function(done) {
var poly = new ol.geom.Polygon([outer, inner]);
var rings = poly.getRings();
var bounds = poly.getBounds();
goog.events.listen(poly, 'change', function(evt) {
expect(evt.target).to.be(poly);
expect(evt.oldExtent).to.eql(bounds);
expect(evt.target.getBounds()).to.eql([0, 0, 10, 10]);
done();
});