Implement getImageSize in ol.style.Circle and RegularShape
This commit is contained in:
@@ -506,7 +506,6 @@ ol.render.webgl.ImageReplay.prototype.setImageStyle = function(imageStyle) {
|
||||
goog.asserts.assert(!goog.isNull(anchor));
|
||||
var image = imageStyle.getImage(1);
|
||||
goog.asserts.assert(!goog.isNull(image));
|
||||
// FIXME getImageSize does not exist for circles
|
||||
var imageSize = imageStyle.getImageSize();
|
||||
goog.asserts.assert(!goog.isNull(imageSize));
|
||||
var opacity = imageStyle.getOpacity();
|
||||
|
||||
@@ -137,6 +137,14 @@ ol.style.Circle.prototype.getImageState = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.style.Circle.prototype.getImageSize = function() {
|
||||
return this.size_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api
|
||||
|
||||
@@ -132,6 +132,12 @@ ol.style.Image.prototype.getImage = goog.abstractMethod;
|
||||
ol.style.Image.prototype.getImageState = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Size} Image size.
|
||||
*/
|
||||
ol.style.Image.prototype.getImageSize = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @return {HTMLCanvasElement|HTMLVideoElement|Image} Image element.
|
||||
|
||||
@@ -147,6 +147,14 @@ ol.style.RegularShape.prototype.getImage = function(pixelRatio) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.style.RegularShape.prototype.getImageSize = function() {
|
||||
return this.size_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user