Skip to content

Commit

Permalink
RD-453_update-sdk-to-v3 (#75)
Browse files Browse the repository at this point in the history
* Update maptiler-sdk to v3

* RD-453_telemetry (#76)

* Add telemetry

* Simplify telemetry

* Update sdk

* Update MapTiler SDK JS and MapLibre GL JS

* Import only specific fields from package.json
  • Loading branch information
sebstryczek authored Jan 8, 2025
1 parent 4fac809 commit 0435e1a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 50 deletions.
74 changes: 30 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"./types": "./types.d.ts"
},
"devDependencies": {
"@maptiler/sdk": "^2.5.0",
"@maptiler/sdk": "^3.0.0",
"@sveltejs/package": "^2.3.7",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@tsconfig/svelte": "^5.0.4",
Expand All @@ -120,7 +120,7 @@
"husky": "^9.1.7",
"leaflet": "^1.9.4",
"lint-staged": "^15.2.11",
"maplibre-gl": "^4.7.1",
"maplibre-gl": "^5.0.0",
"ol": "10.3",
"prettier": "^3.4.2",
"prettier-plugin-organize-imports": "^4.1.0",
Expand All @@ -138,7 +138,7 @@
"vite": "^5.4.11"
},
"peerDependencies": {
"@maptiler/sdk": "^1 || ^2",
"@maptiler/sdk": "^1 || ^2 || ^3",
"leaflet": "^1.7 || ^1.8 || ^1.9",
"maplibre-gl": "^2 || ^3 || ^4 || ^5",
"ol": "^6 || ^7 || ^8 || ^9 || ^10",
Expand Down
5 changes: 3 additions & 2 deletions src/MapLibreBasedGeocodingControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
Map,
Marker,
MarkerOptions,
Subscription,
} from "maplibre-gl";
import type { SvelteComponent } from "svelte";
import GeocodingControlComponent from "./GeocodingControl.svelte";
Expand Down Expand Up @@ -336,9 +337,9 @@ export function crateClasses<OPTS extends MapLibreBaseControlOptions>(
on<T extends keyof EventTypes>(
type: T,
listener: (ev: EventTypes[T]) => void,
): this;
): Subscription;

on(type: keyof EventTypes, listener: Listener): this {
on(type: keyof EventTypes, listener: Listener): Subscription {
return super.on(type, listener);
}

Expand Down
4 changes: 4 additions & 0 deletions src/maptilersdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import {
crateClasses,
type MapLibreBaseControlOptions,
} from "./MapLibreBasedGeocodingControl";

import { name, version } from "../package.json";

export { createMapLibreGlMapController } from "./maplibregl-controller";

const { MapLibreBasedGeocodingControl, events } =
Expand Down Expand Up @@ -39,6 +42,7 @@ export class GeocodingControl
implements maptilersdk.IControl
{
onAdd(map: maptilersdk.Map): HTMLElement {
map.telemetry.registerModule(name, version);
return super.onAddInt(map as unknown as maplibregl.Map);
}
}
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"allowJs": true,
"checkJs": true,
"strict": true,
"moduleResolution": "Node"
"moduleResolution": "Node",
"resolveJsonModule": true
},
"include": ["src/*.d.ts", "src/*.ts", "src/*.js", "src/*.svelte"],
"references": [{ "path": "./tsconfig.node.json" }],
Expand Down

0 comments on commit 0435e1a

Please sign in to comment.