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 ede8248 commit e1cd246
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 38 deletions.
24 changes: 21 additions & 3 deletions src/Layer3D.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
type CustomLayerInterface,
type Map as MapSDK,
Map as MapSDK,
MercatorCoordinate,
type LngLatLike,
type CustomRenderMethodInput,
Expand All @@ -27,7 +27,25 @@ import {

import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";

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}`);
},
};
/* *** */

/**
* The altitude of a mesh can be relative to the ground surface, or to the mean sea level
Expand Down Expand Up @@ -289,7 +307,7 @@ export class Layer3D implements CustomLayerInterface {
* Automatically called when the layer is added. (should not be called manually)
*/
onAdd?(map: MapSDK, gl: WebGL2RenderingContext): void {
registerTelemetry(map);
map.telemetry.registerModule(packagejson.name, packagejson.version);

this.map = map;
this.renderer = new WebGLRenderer({
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 e1cd246

Please sign in to comment.