UNPKG

@nativescript-community/ui-carto

Version:

NativeScript plugin for CARTO Mobile SDK

36 lines 1.21 kB
import { mapPosVectorFromArgs } from '..'; import { MapPosVector, fromNativeMapBounds, fromNativeMapPos, toNativeMapPos } from '../core'; import { BaseNative } from '../BaseNative'; export class Geometry extends BaseNative { getCenterPos() { return fromNativeMapPos(this.getNative().getCenterPos()); } getBounds() { return fromNativeMapBounds(this.getNative().getBounds()); } } export class PointGeometry extends Geometry { createNative(options) { return NTPointGeometry.alloc().initWithPos(toNativeMapPos(options.pos)); } getPos() { return fromNativeMapPos(this.getNative().getPos()); } } export class LineGeometry extends Geometry { createNative(options) { return NTLineGeometry.alloc().initWithPoses(mapPosVectorFromArgs(options.poses)); } getPoses() { return new MapPosVector(this.getNative().getPoses()); } } export class PolygonGeometry extends Geometry { createNative(options) { return NTPolygonGeometry.alloc().initWithPoses(mapPosVectorFromArgs(options.poses)); } getPoses() { return new MapPosVector(this.getNative().getPoses()); } } //# sourceMappingURL=index.ios.js.map