Skip to content

Commit

Permalink
Simplify telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
sebstryczek committed Dec 11, 2024
1 parent ce424aa commit 682dc73
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 37 deletions.
23 changes: 21 additions & 2 deletions src/markerlayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,26 @@ import type {
Map as MapSDK,
MapGeoJSONFeature,
} from "@maptiler/sdk";
import { registerTelemetry } from "./telemetry";

import packagejson from "../package.json";

/**
* TODO: Remove when telemetry will be implemented
*/
declare module "@maptiler/sdk" {
interface Map {
telemetry: {
registerModule: (name: string, version: string) => void;
};
}
}

MapSDK.prototype.telemetry = {
registerModule: (name: string, version: string) => {
console.log(`Telemetry module registered: ${name} ${version}`);
},
};
/* *** */

/**
* How the markers are anchored to a given point
Expand Down Expand Up @@ -222,7 +241,7 @@ export class MarkerLayout {
private maxNbFeaturesPerMarker: number = Number.POSITIVE_INFINITY;

constructor(map: MapSDK, options: MarkerLayoutOptions = {}) {
registerTelemetry(map);
map.telemetry.registerModule(packagejson.name, packagejson.version);

this.map = map;
this.layers = options.layers ?? undefined;
Expand Down
1 change: 0 additions & 1 deletion src/telemetry/index.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/telemetry/registerTelemetry.ts

This file was deleted.

0 comments on commit 682dc73

Please sign in to comment.