Layer is now responsible of its rendering

This commit is contained in:
Florent gravin
2018-11-13 12:23:53 +01:00
parent d21a88edce
commit c2c599a517
2 changed files with 15 additions and 5 deletions
+14
View File
@@ -172,6 +172,20 @@ class Layer extends BaseLayer {
this.changed();
}
/**
* In charge to manage the rendering of the layer. One layer type is
* bounded with one layer renderer.
* @param {?import("../PluggableMap.js").FrameState} frameState Frame state.
* @return {HTMLElement} The rendered element.
*/
render(frameState) {
const layerRenderer = this.getRenderer();
const layerState = this.getLayerState();
if (layerRenderer.prepareFrame(frameState, layerState)) {
return layerRenderer.renderFrame(frameState, layerState);
}
}
/**
* Sets the layer to be rendered on top of other layers on a map. The map will
* not manage this layer in its layers collection, and the callback in