Remove hitDetectionOrigin
This commit is contained in:
@@ -70,12 +70,6 @@ ol.style.Circle = function(opt_options) {
|
||||
*/
|
||||
this.origin_ = [0, 0];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
*/
|
||||
this.hitDetectionOrigin_ = [0, 0];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
@@ -189,14 +183,6 @@ ol.style.Circle.prototype.getOrigin = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.style.Circle.prototype.getHitDetectionOrigin = function() {
|
||||
return this.hitDetectionOrigin_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Radius.
|
||||
* @api
|
||||
@@ -323,12 +309,10 @@ ol.style.Circle.prototype.render_ = function(atlasManager) {
|
||||
|
||||
if (hasCustomHitDetectionImage) {
|
||||
this.hitDetectionCanvas_ = info.hitImage;
|
||||
this.hitDetectionOrigin_ = [info.hitOffsetX, info.hitOffsetY];
|
||||
this.hitDetectionImageSize_ =
|
||||
[info.hitImage.width, info.hitImage.height];
|
||||
} else {
|
||||
this.hitDetectionCanvas_ = this.canvas_;
|
||||
this.hitDetectionOrigin_ = this.origin_;
|
||||
this.hitDetectionImageSize_ = [imageSize, imageSize];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,14 +301,6 @@ ol.style.Icon.prototype.getOrigin = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.style.Icon.prototype.getHitDetectionOrigin = function() {
|
||||
return this.getOrigin();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {string|undefined} Image src.
|
||||
* @api
|
||||
|
||||
@@ -161,13 +161,6 @@ ol.style.Image.prototype.getHitDetectionImageSize = goog.abstractMethod;
|
||||
ol.style.Image.prototype.getOrigin = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @return {Array.<number>} Origin for the hit-detection image.
|
||||
*/
|
||||
ol.style.Image.prototype.getHitDetectionOrigin = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @return {ol.Size} Size.
|
||||
|
||||
@@ -60,12 +60,6 @@ ol.style.RegularShape = function(options) {
|
||||
*/
|
||||
this.origin_ = [0, 0];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
*/
|
||||
this.hitDetectionOrigin_ = [0, 0];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
@@ -219,14 +213,6 @@ ol.style.RegularShape.prototype.getOrigin = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.style.RegularShape.prototype.getHitDetectionOrigin = function() {
|
||||
return this.hitDetectionOrigin_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Number of points for stars and regular polygons.
|
||||
* @api
|
||||
@@ -370,12 +356,10 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) {
|
||||
|
||||
if (hasCustomHitDetectionImage) {
|
||||
this.hitDetectionCanvas_ = info.hitImage;
|
||||
this.hitDetectionOrigin_ = [info.hitOffsetX, info.hitOffsetY];
|
||||
this.hitDetectionImageSize_ =
|
||||
[info.hitImage.width, info.hitImage.height];
|
||||
} else {
|
||||
this.hitDetectionCanvas_ = this.canvas_;
|
||||
this.hitDetectionOrigin_ = this.origin_;
|
||||
this.hitDetectionImageSize_ = [imageSize, imageSize];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ describe('ol.style.Circle', function() {
|
||||
expect(style.getImage()).to.not.be(style.getHitDetectionImage());
|
||||
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
|
||||
expect(style.getHitDetectionOrigin()).to.eql([0, 0]);
|
||||
});
|
||||
|
||||
it('creates a canvas if no atlas is used (fill-style)', function() {
|
||||
@@ -35,7 +34,6 @@ describe('ol.style.Circle', function() {
|
||||
expect(style.getImage()).to.be(style.getHitDetectionImage());
|
||||
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
|
||||
expect(style.getHitDetectionOrigin()).to.eql([0, 0]);
|
||||
});
|
||||
|
||||
it('adds itself to an atlas manager (no fill-style)', function() {
|
||||
@@ -50,7 +48,6 @@ describe('ol.style.Circle', function() {
|
||||
expect(style.getImage()).to.not.be(style.getHitDetectionImage());
|
||||
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getHitDetectionImageSize()).to.eql([512, 512]);
|
||||
expect(style.getHitDetectionOrigin()).to.eql([1, 1]);
|
||||
});
|
||||
|
||||
it('adds itself to an atlas manager (fill-style)', function() {
|
||||
@@ -71,7 +68,6 @@ describe('ol.style.Circle', function() {
|
||||
expect(style.getImage()).to.be(style.getHitDetectionImage());
|
||||
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getHitDetectionImageSize()).to.eql([512, 512]);
|
||||
expect(style.getHitDetectionOrigin()).to.eql([1, 1]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ describe('ol.style.RegularShape', function() {
|
||||
expect(style.getImage()).to.not.be(style.getHitDetectionImage());
|
||||
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
|
||||
expect(style.getHitDetectionOrigin()).to.eql([0, 0]);
|
||||
});
|
||||
|
||||
it('creates a canvas if no atlas is used (fill-style)', function() {
|
||||
@@ -68,7 +67,6 @@ describe('ol.style.RegularShape', function() {
|
||||
expect(style.getImage()).to.be(style.getHitDetectionImage());
|
||||
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
|
||||
expect(style.getHitDetectionOrigin()).to.eql([0, 0]);
|
||||
});
|
||||
|
||||
it('adds itself to an atlas manager (no fill-style)', function() {
|
||||
@@ -84,7 +82,6 @@ describe('ol.style.RegularShape', function() {
|
||||
expect(style.getImage()).to.not.be(style.getHitDetectionImage());
|
||||
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getHitDetectionImageSize()).to.eql([512, 512]);
|
||||
expect(style.getHitDetectionOrigin()).to.eql([1, 1]);
|
||||
});
|
||||
|
||||
it('adds itself to an atlas manager (fill-style)', function() {
|
||||
@@ -105,7 +102,6 @@ describe('ol.style.RegularShape', function() {
|
||||
expect(style.getImage()).to.be(style.getHitDetectionImage());
|
||||
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getHitDetectionImageSize()).to.eql([512, 512]);
|
||||
expect(style.getHitDetectionOrigin()).to.eql([1, 1]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user