UNPKG

@nativescript-community/ui-carto

Version:

NativeScript plugin for CARTO Mobile SDK

51 lines 1.9 kB
import { Screen } from '@nativescript/core'; import { nativeColorProperty, nativeFontProperty, nativeImageProperty } from '..'; import { BaseNative } from '../BaseNative'; import { fromNativeMapPos } from '../core'; import { nativeProperty } from '../index.common'; import { BaseVectorElement, VectorElementVector } from '../vectorelements'; export class ClusterElementBuilder extends BaseNative { createNative(options) { const result = new com.akylas.carto.additions.AKClusterElementBuilder(Screen.mainScreen.scale); if (!!options.buildClusterElement) { result.setInterface(new com.akylas.carto.additions.AKClusterElementBuilder.Interface({ buildClusterElement: this.nBuildClusterElement.bind(this) })); } return result; } nBuildClusterElement(position, nElements) { const result = this.buildClusterElement(fromNativeMapPos(position), new VectorElementVector(undefined, nElements)); if (result instanceof BaseVectorElement) { return result.getNative(); } else if (result) { return result; } } } __decorate([ nativeImageProperty ], ClusterElementBuilder.prototype, "bitmap", void 0); __decorate([ nativeColorProperty ], ClusterElementBuilder.prototype, "color", void 0); __decorate([ nativeProperty ], ClusterElementBuilder.prototype, "size", void 0); __decorate([ nativeProperty ], ClusterElementBuilder.prototype, "shape", void 0); __decorate([ nativeProperty ], ClusterElementBuilder.prototype, "textSize", void 0); __decorate([ nativeColorProperty ], ClusterElementBuilder.prototype, "textColor", void 0); __decorate([ nativeFontProperty ], ClusterElementBuilder.prototype, "font", void 0); __decorate([ nativeProperty ], ClusterElementBuilder.prototype, "bbox", void 0); //# sourceMappingURL=cluster.android.js.map