Skip to content

Commit 28ddce0

Browse files
committed
fix: LocalVectorLayer addFeatureCollection fix
1 parent 4f266ba commit 28ddce0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/datasources/vector.android.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { BaseVectorElement, VectorElementVector } from '../vectorelements';
44
import { GeometrySimplifier } from '../geometry/simplifier';
55
import { FeatureCollection } from '../geometry/feature';
66
import { fromNativeMapBounds } from '../core';
7+
import { featureCollectionFromArgs, styleFromArgs } from '..';
78

89
export abstract class VectorDataSource<T extends com.carto.datasources.VectorDataSource, U extends LocalVectorDataSourceOptions> extends DataSource<T, U> {
910
// createNative(options: U) {
@@ -44,8 +45,8 @@ export class LocalVectorDataSource extends VectorDataSource<com.carto.datasource
4445
clear() {
4546
this.getNative().clear();
4647
}
47-
addFeatureCollection(featureCollection: FeatureCollection, style: com.carto.styles.Style) {
48-
this.getNative().addFeatureCollection(featureCollection.getNative(), style);
48+
addFeatureCollection(featureCollection: FeatureCollection, style: any) {
49+
this.getNative().addFeatureCollection(featureCollectionFromArgs(featureCollection), styleFromArgs(style));
4950
}
5051

5152
getDataExtent() {

src/datasources/vector.ios.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { BaseVectorElement, VectorElementVector } from '../vectorelements';
44
import { GeometrySimplifier } from '../geometry/simplifier';
55
import { FeatureCollection } from '../geometry/feature';
66
import { fromNativeMapBounds } from '../core';
7+
import { featureCollectionFromArgs, styleFromArgs } from '..';
78

89
export abstract class VectorDataSource<T extends NTVectorDataSource, U extends LocalVectorDataSourceOptions> extends DataSource<T, U> {
910
// createNative(options: U) {
@@ -33,8 +34,8 @@ export class LocalVectorDataSource extends VectorDataSource<NTLocalVectorDataSou
3334
clear() {
3435
this.getNative().clear();
3536
}
36-
addFeatureCollection(featureCollection: FeatureCollection, style: NTStyle) {
37-
this.getNative().addFeatureCollectionStyle(featureCollection.getNative(), style);
37+
addFeatureCollection(featureCollection: FeatureCollection, style: any) {
38+
this.getNative().addFeatureCollectionStyle(featureCollectionFromArgs(featureCollection), styleFromArgs(style));
3839
}
3940
addAll(elements: VectorElementVector) {
4041
this.getNative().addAll(elements.getNative() as NTVectorElementVector);

0 commit comments

Comments
 (0)