Add renderOrder option to ol.layer.Vector
This commit is contained in:
@@ -6,8 +6,17 @@ goog.require('ol.feature');
|
||||
goog.require('ol.layer.Layer');
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.layer.VectorProperty = {
|
||||
RENDER_ORDER: 'renderOrder'
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.layer.Layer}
|
||||
* @fires {@link ol.render.Event} ol.render.Event
|
||||
@@ -46,6 +55,16 @@ ol.layer.Vector = function(opt_options) {
|
||||
goog.inherits(ol.layer.Vector, ol.layer.Layer);
|
||||
|
||||
|
||||
/**
|
||||
* @return {function(ol.Feature, ol.Feature): number|null|undefined} Render
|
||||
* order.
|
||||
*/
|
||||
ol.layer.Vector.prototype.getRenderOrder = function() {
|
||||
return /** @type {function(ol.Feature, ol.Feature):number|null|undefined} */ (
|
||||
this.get(ol.layer.VectorProperty.RENDER_ORDER));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the style for features. This returns whatever was passed to the `style`
|
||||
* option at construction or to the `setStyle` method.
|
||||
@@ -67,6 +86,15 @@ ol.layer.Vector.prototype.getStyleFunction = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {function(ol.Feature, ol.Feature):number|null|undefined} renderOrder
|
||||
* Render order.
|
||||
*/
|
||||
ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
|
||||
this.set(ol.layer.VectorProperty.RENDER_ORDER, renderOrder);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Set the style for features. This can be a single style object, an array
|
||||
* of styles, or a function that takes a feature and resolution and returns
|
||||
|
||||
Reference in New Issue
Block a user