Skip to content

Commit 80417a7

Browse files
author
farfromrefug
committed
fix: support new valhalla addLocale
1 parent 69aee94 commit 80417a7

File tree

12 files changed

+5551
-6066
lines changed

12 files changed

+5551
-6066
lines changed

packages/ui-carto/platforms/android/java/com/akylas/carto/additions/RegisterLicenseCallback.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/ui-carto/routing/index.android.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ abstract class RoutingService<T extends com.carto.routing.RoutingService, U exte
8383
const callback = new com.akylas.carto.additions.RoutingServiceRouteCallback({
8484
onRoutingResult: (err, res, strRes) => (err ? reject(err) : resolve(strRes || (res ? new RoutingResult(res) : null)))
8585
});
86+
console.log('calculateRoute', jsonStr);
8687
AKRoutingServiceAdditions.calculateRoute(this.getNative(), nRequest, profile, jsonStr, callback);
8788
});
8889
}
@@ -132,6 +133,13 @@ abstract class ValhallaRoutingService<
132133
return nativeVariantToJS(native.getConfigurationParameter(param));
133134
}
134135
}
136+
137+
public addLocale(key: string, json: string) {
138+
const native = this.getNative();
139+
if (!(native instanceof com.carto.routing.ValhallaOnlineRoutingService)) {
140+
native.addLocale(key, json);
141+
}
142+
}
135143
}
136144

137145
export class PackageManagerRoutingService extends RoutingService<com.carto.routing.PackageManagerRoutingService, PackageManagerRoutingServiceOptions> {

src/ui-carto/routing/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export class ValhallaRoutingService<T, U extends ValhallaRoutingServiceOptions>
7575
matchRoute<T = DefaultLatLonKeys>(options: RouteMatchingRequest, profile?: string): Promise<RouteMatchingResult<T>>;
7676
public setConfigurationParameter(param: string, value: any);
7777
public getConfigurationParameter(param: string): any;
78+
public addLocale(key: string, json: string);
7879
}
7980

8081
export interface PackageManagerRoutingServiceOptions extends RoutingServiceOptions {

src/ui-carto/routing/index.ios.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ abstract class ValhallaRoutingService<
8989
return nativeVariantToJS(native.getConfigurationParameter(param));
9090
}
9191
}
92+
public addLocale(key: string, json: string) {
93+
const native = this.getNative();
94+
if (!(native instanceof NTValhallaOnlineRoutingService)) {
95+
native.addLocaleJson(key, json);
96+
}
97+
}
9298
}
9399

94100
export class PackageManagerRoutingService extends RoutingService<NTPackageManagerRoutingService, PackageManagerRoutingServiceOptions> {

src/ui-carto/typings/ak.carto.android.d.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,6 @@ declare namespace com {
173173
}
174174
}
175175

176-
declare namespace com {
177-
export namespace akylas {
178-
export namespace carto {
179-
export namespace additions {
180-
export class AKLicenseManager extends java.lang.Object {
181-
public static class: java.lang.Class<AKLicenseManager>;
182-
public static registerLicenseCallback(param0: string, param1: globalAndroid.content.Context, param2: RegisterLicenseCallback): void;
183-
public constructor();
184-
}
185-
}
186-
}
187-
}
188-
}
189176

190177
declare namespace com {
191178
export namespace akylas {
@@ -667,23 +654,6 @@ declare namespace com {
667654
}
668655
}
669656

670-
declare namespace com {
671-
export namespace akylas {
672-
export namespace carto {
673-
export namespace additions {
674-
export class RegisterLicenseCallback extends java.lang.Object {
675-
public static class: java.lang.Class<RegisterLicenseCallback>;
676-
/**
677-
* Constructs a new instance of the com.akylas.carto.additions.RegisterLicenseCallback interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
678-
*/
679-
public constructor(implementation: { onLicenseRegistered(param0: java.lang.Boolean): void });
680-
public constructor();
681-
public onLicenseRegistered(param0: java.lang.Boolean): void;
682-
}
683-
}
684-
}
685-
}
686-
}
687657

688658
declare namespace com {
689659
export namespace akylas {

src/ui-carto/typings/carto.android.d.ts

Lines changed: 2345 additions & 2283 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)