@@ -2,7 +2,7 @@ import { MBVectorTileDecoderOptions, VectorTileDecoderOptions } from '.';
2
2
import { File } from '@nativescript/core/file-system' ;
3
3
import { BaseVectorTileDecoder } from './index.common' ;
4
4
import { getFileName , getRelativePathToApp } from '../index.common' ;
5
- import { DirAssetPackage } from '../utils' ;
5
+ import { DirAssetPackage , nativeVectorToArray } from '../utils' ;
6
6
import { profile } from '@nativescript/core' ;
7
7
8
8
export class VectorTileDecoder extends BaseVectorTileDecoder < com . carto . vectortiles . VectorTileDecoder , VectorTileDecoderOptions > {
@@ -55,7 +55,52 @@ export class MBVectorTileDecoder extends BaseVectorTileDecoder<com.carto.vectort
55
55
return this . options . style ;
56
56
}
57
57
58
+ reloadStyle ( ) {
59
+ if ( this . native ) {
60
+ if ( this . pack ) {
61
+ if ( this . options . style ) {
62
+ this . getNative ( ) . setCompiledStyleSet ( new com . carto . styles . CompiledStyleSet ( this . pack , this . options . style ) ) ;
63
+ } else if ( this . options . cartoCss ) {
64
+ this . getNative ( ) . setCartoCSSStyleSet ( new com . carto . styles . CartoCSSStyleSet ( this . options . cartoCss , this . pack ) ) ;
65
+ }
66
+ } else if ( this . options . cartoCss ) {
67
+ this . getNative ( ) . setCartoCSSStyleSet ( new com . carto . styles . CartoCSSStyleSet ( this . options . cartoCss ) ) ;
68
+ }
69
+ }
70
+ }
71
+
58
72
setStyleParameter ( param : string , value : string ) {
59
73
this . getNative ( ) . setStyleParameter ( param , value ) ;
60
74
}
75
+ setCartoCSSStyleSet ( cartoCss : string ) {
76
+ if ( this . pack ) {
77
+ this . getNative ( ) . setCartoCSSStyleSet ( new com . carto . styles . CartoCSSStyleSet ( cartoCss , this . pack ) ) ;
78
+ } else {
79
+ this . getNative ( ) . setCartoCSSStyleSet ( new com . carto . styles . CartoCSSStyleSet ( cartoCss ) ) ;
80
+ }
81
+ }
82
+ setCompiledStyleSet ( param0 : com . carto . styles . CompiledStyleSet ) {
83
+ this . getNative ( ) . setCompiledStyleSet ( param0 ) ;
84
+ }
85
+ getCompiledStyleSet ( ) {
86
+ return this . getNative ( ) . getCompiledStyleSet ( ) ;
87
+ }
88
+ getCartoCSSStyleSet ( ) {
89
+ return this . getNative ( ) . getCartoCSSStyleSet ( ) ;
90
+ }
91
+ getStyleParameter ( param0 : string ) {
92
+ return this . getNative ( ) . getStyleParameter ( param0 ) ;
93
+ }
94
+ getStyleParameters ( ) {
95
+ return nativeVectorToArray ( this . getNative ( ) . getStyleParameters ( ) ) ;
96
+ }
97
+ addFallbackFont ( param0 : com . carto . core . BinaryData ) {
98
+ return this . getNative ( ) . addFallbackFont ( param0 ) ;
99
+ }
100
+ getMinZoom ( ) {
101
+ return this . getNative ( ) . getMinZoom ( ) ;
102
+ }
103
+ getMaxZoom ( ) {
104
+ return this . getNative ( ) . getMaxZoom ( ) ;
105
+ }
61
106
}
0 commit comments