File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -134,19 +134,30 @@ export default class VectorTileLayer<
134134 const tileBbox = props . tile . bbox as any ;
135135 const { west, south, east, north} = tileBbox ;
136136
137+ const extensions = [ new ClipExtension ( ) , ...( props . extensions || [ ] ) ] ;
137138 const clipProps = {
138- extensions : [ new ClipExtension ( ) , ...( props . extensions || [ ] ) ] ,
139139 clipBounds : [ west , south , east , north ]
140140 } ;
141141
142+ const applyClipExtensionToSublayerProps = ( subLayerId : string ) => {
143+ return {
144+ [ subLayerId ] : {
145+ ...clipProps ,
146+ ...props ?. _subLayerProps ?. [ subLayerId ] ,
147+ extensions : [ ...extensions , ...( props ?. _subLayerProps ?. [ subLayerId ] ?. extensions || [ ] ) ]
148+ }
149+ } ;
150+ } ;
151+
142152 const subLayerProps = {
143153 ...props ,
144154 autoHighlight : false ,
145155 // Do not perform clipping on points (#9059)
146156 _subLayerProps : {
147- 'polygons-fill' : clipProps ,
148- 'polygons-stroke' : clipProps ,
149- linestrings : clipProps
157+ ...props . _subLayerProps ,
158+ ...applyClipExtensionToSublayerProps ( 'polygons-fill' ) ,
159+ ...applyClipExtensionToSublayerProps ( 'polygons-stroke' ) ,
160+ ...applyClipExtensionToSublayerProps ( 'linestrings' )
150161 }
151162 } ;
152163
You can’t perform that action at this time.
0 commit comments