File tree Expand file tree Collapse file tree 1 file changed +13
-21
lines changed
Expand file tree Collapse file tree 1 file changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -139,33 +139,25 @@ export default class VectorTileLayer<
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 : {
147157 ...props . _subLayerProps ,
148- 'polygons-fill' : {
149- ...clipProps ,
150- ...props ?. _subLayerProps ?. [ 'polygons-fill' ] ,
151- extensions : [
152- ...extensions ,
153- ...( props ?. _subLayerProps ?. [ 'polygons-fill' ] ?. extensions || [ ] )
154- ]
155- } ,
156- 'polygons-stroke' : {
157- ...clipProps ,
158- ...props ?. _subLayerProps ?. [ 'polygons-stroke' ] ,
159- extensions : [
160- ...extensions ,
161- ...( props ?. _subLayerProps ?. [ 'polygons-stroke' ] ?. extensions || [ ] )
162- ]
163- } ,
164- linestrings : {
165- ...clipProps ,
166- ...props ?. _subLayerProps ?. linestrings ,
167- extensions : [ ...extensions , ...( props ?. _subLayerProps ?. linestrings ?. extensions || [ ] ) ]
168- }
158+ ...applyClipExtensionToSublayerProps ( 'polygons-fill' ) ,
159+ ...applyClipExtensionToSublayerProps ( 'polygons-stroke' ) ,
160+ ...applyClipExtensionToSublayerProps ( 'linestrings' )
169161 }
170162 } ;
171163
You can’t perform that action at this time.
0 commit comments