Allow styles to configure a custom renderer
Two new examples show how custom renderers can be used to render text along paths, and to declutter labels using 3rd party libraries.
This commit is contained in:
@@ -43,6 +43,12 @@ ol.render.Feature = function(type, flatCoordinates, ends, properties, id) {
|
||||
*/
|
||||
this.flatCoordinates_ = flatCoordinates;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>|Array.<Array.<number>>|Array.<Array.<Array.<number>>>}
|
||||
*/
|
||||
this.renderCoordinates_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>|Array.<Array.<number>>}
|
||||
@@ -111,6 +117,18 @@ ol.render.Feature.prototype.getOrientedFlatCoordinates = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<number>|Array.<Array.<number>>|Array.<Array.<Array.<number>>>}
|
||||
* Render coordinates.
|
||||
*/
|
||||
ol.render.Feature.prototype.getRenderCoordinates = function() {
|
||||
if (!this.renderCoordinates_) {
|
||||
this.renderCoordinates_ = [];
|
||||
}
|
||||
return this.renderCoordinates_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user