Update after ol.interaction.Select changes

This commit is contained in:
Andreas Hocevar
2015-10-12 22:40:01 +02:00
parent 66338a662d
commit 8daff341d0
2 changed files with 12 additions and 10 deletions

View File

@@ -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. * @param {ol.layer.Layer} layer Layer.
* @private * @private
*/ */
@@ -236,7 +236,7 @@ ol.interaction.Select.prototype.getFeatures = function() {
/** /**
* Returns the associated {@link ol.layer.Vector vectorlayer} of * Returns the associated {@link ol.layer.Vector vectorlayer} of
* the (last) selected feature. * the (last) selected feature.
* @param {ol.Feature} feature Feature * @param {ol.Feature|ol.render.Feature} feature Feature
* @return {ol.layer.Vector} Layer. * @return {ol.layer.Vector} Layer.
* @api * @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 * @private
*/ */
ol.interaction.Select.prototype.removeFeatureLayerAssociation_ = ol.interaction.Select.prototype.removeFeatureLayerAssociation_ =

View File

@@ -150,19 +150,21 @@ describe('ol.interaction.Modify', function() {
it('works when clicking on a shared vertex', function() { it('works when clicking on a shared vertex', function() {
features.push(features[0].clone()); 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({ var modify = new ol.interaction.Modify({
features: new ol.Collection(features) features: new ol.Collection(features)
}); });
map.addInteraction(modify); map.addInteraction(modify);
var first = features[0];
var second = features[1];
events = trackEvents(first, modify); 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(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); expect(second.getGeometry().getCoordinates()[0]).to.have.length(5);
simulateEvent('pointerdown', 10, -20, false, 0); simulateEvent('pointerdown', 10, -20, false, 0);
@@ -170,9 +172,9 @@ describe('ol.interaction.Modify', function() {
simulateEvent('click', 10, -20, false, 0); simulateEvent('click', 10, -20, false, 0);
simulateEvent('singleclick', 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(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); expect(second.getGeometry().getCoordinates()[0]).to.have.length(4);
validateEvents(events, features); validateEvents(events, features);