Skip to content

Commit

Permalink
Fix#8154: Add a WebGLRenderingContext argument to CustomLayerInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
Ogier Maitre authored and ansis committed Apr 16, 2019
1 parent d808d5f commit 8bcf115
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/style/style_layer/custom_style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ type CustomRenderMethod = (gl: WebGLRenderingContext, matrix: Array<number>) =>
* @instance
* @name onRemove
* @param {Map} map The Map this custom layer was just added to.
* @param {WebGLRenderingContext} gl The gl context for the map.
*/

/**
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 8bcf115

Please sign in to comment.