From a3d16d70a5a124fe6b7bc6c66e9a55a97ad59644 Mon Sep 17 00:00:00 2001 From: Ogier Maitre Date: Tue, 16 Apr 2019 12:17:26 +0200 Subject: [PATCH] Fix#8154: Add a WebGLRenderingContext argument to CustomLayerInterface --- src/style/style_layer/custom_style_layer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/style/style_layer/custom_style_layer.js b/src/style/style_layer/custom_style_layer.js index 3fea0df7e95..cbd956e8ca8 100644 --- a/src/style/style_layer/custom_style_layer.js +++ b/src/style/style_layer/custom_style_layer.js @@ -97,6 +97,7 @@ type CustomRenderMethod = (gl: WebGLRenderingContext, matrix: Array) => * @instance * @name onRemove * @param {Map} map The Map this custom layer was just added to. + * @param {WebGLRenderingContext} gl The gl context for the map. */ /** @@ -152,7 +153,7 @@ export type CustomLayerInterface = { render: CustomRenderMethod, prerender: ?CustomRenderMethod, onAdd: ?(map: Map, gl: WebGLRenderingContext) => void, - onRemove: ?(map: Map) => void + onRemove: ?(map: Map, gl: WebGLRenderingContext) => void } export function validateCustomStyleLayer(layerObject: CustomLayerInterface) { @@ -215,7 +216,7 @@ class CustomStyleLayer extends StyleLayer { onRemove(map: Map) { if (this.implementation.onRemove) { - this.implementation.onRemove(map); + this.implementation.onRemove(map, map.painter.context.gl); } } }