@@ -73,21 +73,28 @@ const currentAppFolder = knownFolders.currentApp();
7373
7474export class ZippedAssetPackage extends BaseNative < NTZippedAssetPackage , ZippedAssetPackageOptions > {
7575 createNative ( options : ZippedAssetPackageOptions ) {
76- const zipPath = getRelativePathToApp ( options . zipPath ) ;
77- if ( File . exists ( zipPath ) ) {
78- let assetPackage : NTAssetPackage ;
79- if ( options . basePack ) {
80- assetPackage = options . basePack . getNative ( ) ;
81- }
82- const vectorTileStyleSetData = NTAssetUtils . loadAsset ( zipPath ) ;
83- if ( assetPackage ) {
84- return NTZippedAssetPackage . alloc ( ) . initWithZipDataBaseAssetPackage ( vectorTileStyleSetData , assetPackage ) ;
76+ let zipPath ;
77+ try {
78+ const fullZipPath = getFileName ( options . zipPath ) ;
79+ zipPath = getRelativePathToApp ( options . zipPath ) ;
80+ if ( File . exists ( fullZipPath ) ) {
81+ let assetPackage : NTAssetPackage ;
82+ if ( options . basePack ) {
83+ assetPackage = options . basePack . getNative ( ) ;
84+ }
85+ const vectorTileStyleSetData = NTAssetUtils . loadAsset ( zipPath ) ;
86+ console . log ( 'vectorTileStyleSetData' , vectorTileStyleSetData )
87+ if ( assetPackage ) {
88+ return NTZippedAssetPackage . alloc ( ) . initWithZipDataBaseAssetPackage ( vectorTileStyleSetData , assetPackage ) ;
89+ } else {
90+ return NTZippedAssetPackage . alloc ( ) . initWithZipData ( vectorTileStyleSetData ) ;
91+ }
8592 } else {
86- return NTZippedAssetPackage . alloc ( ) . initWithZipData ( vectorTileStyleSetData ) ;
93+ throw new Error ( `could not find zip file: ${ options . zipPath } ( ${ zipPath } )` )
8794 }
88- } else {
89- console . error ( `could not find zip file: ${ options . zipPath } ( ${ zipPath } ) ` ) ;
90- return null ;
95+ } catch ( error ) {
96+ console . error ( `ZippedAssetPackage( ${ zipPath } , ${ options . zipPath } ): ${ error } ` ) ;
97+ throw error ;
9198 }
9299 }
93100 getAssetNames ( ) {
0 commit comments