style/Icon: Add setAnchor() method
This allows users to adjust the anchor after the `Icon` is defined. This can be useful if the anchor should depend on the rotation of the icon.
This commit is contained in:
@@ -285,6 +285,18 @@ Icon.prototype.getAnchor = function() {
|
||||
return this.normalizedAnchor_;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the anchor point. The anchor determines the center point for the
|
||||
* symbolizer.
|
||||
*
|
||||
* @param {Array.<number>} anchor Anchor.
|
||||
* @api
|
||||
*/
|
||||
Icon.prototype.setAnchor = function(anchor) {
|
||||
this.anchor_ = anchor;
|
||||
this.normalizedAnchor_ = null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the icon color.
|
||||
|
||||
Reference in New Issue
Block a user