diff --git a/src/telemetry/registerTelemetry.ts b/src/telemetry/registerTelemetry.ts index 57b0645..5854826 100644 --- a/src/telemetry/registerTelemetry.ts +++ b/src/telemetry/registerTelemetry.ts @@ -19,16 +19,16 @@ maptilersdk.Map.prototype.telemetry = { }; /* *** */ -let isRegistered = false; +const registeredMaps: Array = []; function registerTelemetry(map: maptilersdk.Map) { - if (isRegistered === true) { + if (registeredMaps.includes(map._mapId)) { return; } map.telemetry.registerModule(packagejson.name, packagejson.version); - isRegistered = true; + registeredMaps.push(map._mapId); } export { registerTelemetry };