File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,13 @@ export abstract class BaseVectorTileLayer<T extends com.carto.layers.VectorTileL
100
100
const geometry = feature . getGeometry ( ) ;
101
101
let position = info . getClickPos ( ) ;
102
102
const geoPosIndex = info . getFeaturePosIndex ( ) ;
103
- let featurePos = geoPosIndex !== - 1 && geometry instanceof com . carto . geometry . MultiPointGeometry ? geometry . getGeometry ( geoPosIndex ) . getCenterPos ( ) : geometry . getCenterPos ( ) ;
103
+ let featurePos : com . carto . core . MapPos ;
104
+ if ( geoPosIndex !== - 1 && / M u l t i P o i n t / . test ( geometry . constructor . name ) ) {
105
+ featurePos = ( geometry as com . carto . geometry . MultiPointGeometry ) . getGeometry ( geoPosIndex ) ?. getCenterPos ( ) ;
106
+ }
107
+ if ( ! featurePos ) {
108
+ featurePos = geometry . getCenterPos ( ) ;
109
+ }
104
110
let projection : com . carto . projections . Projection ;
105
111
const dataSourceProjection = this . getNative ( ) . getDataSource ( ) . getProjection ( ) ;
106
112
if ( this . listenerProjection ) {
You can’t perform that action at this time.
0 commit comments