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); } } }