Skip to content

Commit c52ce64

Browse files
committed
fix: toJSON for MapBounds
1 parent c818cec commit c52ce64

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/core/index.android.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export class MapBounds<T = DefaultLatLonKeys> extends BaseNative<com.carto.core.
5252
getCenter() {
5353
return fromNativeMapPos(this.getNative().getCenter());
5454
}
55+
toJSON() {
56+
return { southwest: this.southwest, northeast: this.northeast };
57+
}
5558
}
5659

5760

src/core/index.ios.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export class MapBounds<T = DefaultLatLonKeys> extends BaseNative<NTMapBounds, {}
3939
getCenter() {
4040
return fromNativeMapPos(this.getNative().getCenter());
4141
}
42+
43+
toJSON() {
44+
return { southwest: this.southwest, northeast: this.northeast };
45+
}
4246
}
4347

4448
export function nativeVectorToArray<T>(vector: NativeVector<T>) {

0 commit comments

Comments
 (0)