@@ -8,7 +8,7 @@ import CartoVectorTileLoader from './schema/carto-vector-tile-loader';
8
8
registerLoaders ( [ CartoPropertiesTileLoader , CartoVectorTileLoader ] ) ;
9
9
10
10
import { DefaultProps } from '@deck.gl/core' ;
11
- import { ClipExtension } from '@deck.gl/extensions' ;
11
+ import { ClipExtension , CollisionFilterExtension } from '@deck.gl/extensions' ;
12
12
import {
13
13
MVTLayer ,
14
14
MVTLayerProps ,
@@ -22,6 +22,7 @@ import {GeoJsonLayer} from '@deck.gl/layers';
22
22
import type { TilejsonResult } from '@carto/api-client' ;
23
23
import { TilejsonPropType , injectAccessToken , mergeBoundaryData } from './utils' ;
24
24
import { DEFAULT_TILE_SIZE } from '../constants' ;
25
+ import PointLabelLayer from './point-label-layer' ;
25
26
26
27
const defaultProps : DefaultProps < VectorTileLayerProps > = {
27
28
...MVTLayer . defaultProps ,
@@ -153,12 +154,25 @@ export default class VectorTileLayer<
153
154
} ;
154
155
} ;
155
156
157
+ const defaultToPointLabelLayer = {
158
+ 'points-text' : {
159
+ type : PointLabelLayer ,
160
+ ...props ?. _subLayerProps ?. [ 'points-text' ] ,
161
+ extensions : [
162
+ new CollisionFilterExtension ( ) ,
163
+ ...( props . extensions || [ ] ) ,
164
+ ...( props ?. _subLayerProps ?. [ 'points-text' ] ?. extensions || [ ] )
165
+ ]
166
+ }
167
+ } ;
168
+
156
169
const subLayerProps = {
157
170
...props ,
158
171
autoHighlight : false ,
159
172
// Do not perform clipping on points (#9059)
160
173
_subLayerProps : {
161
174
...props . _subLayerProps ,
175
+ ...defaultToPointLabelLayer ,
162
176
...applyClipExtensionToSublayerProps ( 'polygons-fill' ) ,
163
177
...applyClipExtensionToSublayerProps ( 'polygons-stroke' ) ,
164
178
...applyClipExtensionToSublayerProps ( 'linestrings' )
0 commit comments