Merge pull request #8368 from ahocevar/imagemode-render-listeners
Make render listeners work with image render mode
This commit is contained in:
@@ -33,6 +33,11 @@ import Style from '../style/Style.js';
|
||||
* @property {string|function(module:ol/Feature):number} [weight='weight'] The feature
|
||||
* attribute to use for the weight or a function that returns a weight from a feature. Weight values
|
||||
* should range from 0 to 1 (and values outside will be clamped to that range).
|
||||
* @property {module:ol/layer/VectorRenderType|string} [renderMode='vector'] Render mode for vector layers:
|
||||
* * `'image'`: Vector layers are rendered as images. Great performance, but point symbols and
|
||||
* texts are always rotated with the view and pixels are scaled during zoom animations.
|
||||
* * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during
|
||||
* animations, but slower performance.
|
||||
* @property {module:ol/source/Vector} [source] Source.
|
||||
*/
|
||||
|
||||
|
||||
@@ -210,10 +210,10 @@ CanvasVectorLayerRenderer.prototype.compose = function(context, frameState, laye
|
||||
rotateAtOffset(replayContext, rotation,
|
||||
width / 2, height / 2);
|
||||
|
||||
if (hasRenderListeners) {
|
||||
this.dispatchRenderEvent(replayContext, frameState, transform);
|
||||
}
|
||||
if (replayContext != context) {
|
||||
if (hasRenderListeners) {
|
||||
this.dispatchRenderEvent(replayContext, frameState, transform);
|
||||
}
|
||||
if (transparentLayer) {
|
||||
const mainContextAlpha = context.globalAlpha;
|
||||
context.globalAlpha = layerState.opacity;
|
||||
|
||||
Reference in New Issue
Block a user