From 8daff341d02c472f4e470625c5e09b4b21368977 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Mon, 12 Oct 2015 22:40:01 +0200 Subject: [PATCH] Update after ol.interaction.Select changes --- src/ol/interaction/selectinteraction.js | 6 +++--- .../ol/interaction/modifyinteraction.test.js | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/ol/interaction/selectinteraction.js b/src/ol/interaction/selectinteraction.js index d527dcc248..82cb617c20 100644 --- a/src/ol/interaction/selectinteraction.js +++ b/src/ol/interaction/selectinteraction.js @@ -212,7 +212,7 @@ goog.inherits(ol.interaction.Select, ol.interaction.Interaction); /** - * @param {ol.Feature} feature Feature. + * @param {ol.Feature|ol.render.Feature} feature Feature. * @param {ol.layer.Layer} layer Layer. * @private */ @@ -236,7 +236,7 @@ ol.interaction.Select.prototype.getFeatures = function() { /** * Returns the associated {@link ol.layer.Vector vectorlayer} of * the (last) selected feature. - * @param {ol.Feature} feature Feature + * @param {ol.Feature|ol.render.Feature} feature Feature * @return {ol.layer.Vector} Layer. * @api */ @@ -414,7 +414,7 @@ ol.interaction.Select.prototype.removeFeature_ = function(evt) { /** - * @param {ol.Feature} feature Feature. + * @param {ol.Feature|ol.render.Feature} feature Feature. * @private */ ol.interaction.Select.prototype.removeFeatureLayerAssociation_ = diff --git a/test/spec/ol/interaction/modifyinteraction.test.js b/test/spec/ol/interaction/modifyinteraction.test.js index e1692e4be2..511eee9ec5 100644 --- a/test/spec/ol/interaction/modifyinteraction.test.js +++ b/test/spec/ol/interaction/modifyinteraction.test.js @@ -150,19 +150,21 @@ describe('ol.interaction.Modify', function() { it('works when clicking on a shared vertex', function() { features.push(features[0].clone()); + var first = features[0]; + var firstRevision = first.getGeometry().getRevision(); + var second = features[1]; + var secondRevision = second.getGeometry().getRevision(); + var modify = new ol.interaction.Modify({ features: new ol.Collection(features) }); map.addInteraction(modify); - var first = features[0]; - var second = features[1]; - events = trackEvents(first, modify); - expect(first.getGeometry().getRevision()).to.equal(1); + expect(first.getGeometry().getRevision()).to.equal(firstRevision); expect(first.getGeometry().getCoordinates()[0]).to.have.length(5); - expect(second.getGeometry().getRevision()).to.equal(2); + expect(second.getGeometry().getRevision()).to.equal(secondRevision); expect(second.getGeometry().getCoordinates()[0]).to.have.length(5); simulateEvent('pointerdown', 10, -20, false, 0); @@ -170,9 +172,9 @@ describe('ol.interaction.Modify', function() { simulateEvent('click', 10, -20, false, 0); simulateEvent('singleclick', 10, -20, false, 0); - expect(first.getGeometry().getRevision()).to.equal(2); + expect(first.getGeometry().getRevision()).to.equal(firstRevision + 1); expect(first.getGeometry().getCoordinates()[0]).to.have.length(4); - expect(second.getGeometry().getRevision()).to.equal(3); + expect(second.getGeometry().getRevision()).to.equal(secondRevision + 1); expect(second.getGeometry().getCoordinates()[0]).to.have.length(4); validateEvents(events, features);