anymap-ts 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymap-ts",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "TypeScript frontend for anymap-ts interactive maps",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -214,30 +214,9 @@ export abstract class BaseMapRenderer<TMap> {
214
214
  this.executeMethod('addLayer', [], layerConfig as unknown as Record<string, unknown>);
215
215
  }
216
216
 
217
- // Restore controls
218
- const controls = this.model.get('_controls') || {};
219
-
220
- // Get layer IDs from restored layers for layer control
221
- const layerIds = Object.keys(layers);
222
-
223
- for (const [controlId, controlConfig] of Object.entries(controls)) {
224
- const config = controlConfig as { type: string; position: string; options?: Record<string, unknown> };
225
- // Dispatch to correct method based on control type
226
- if (config.type === 'layer-control') {
227
- // Pass restored layer IDs so they show separately (not grouped in Background)
228
- this.executeMethod('addLayerControl', [], {
229
- position: config.position,
230
- layers: layerIds,
231
- ...config.options
232
- });
233
- } else if (config.type === 'draw-control') {
234
- this.executeMethod('addDrawControl', [], { position: config.position, ...config.options });
235
- } else if (config.type === 'control-grid') {
236
- this.executeMethod('addControlGrid', [], { position: config.position, ...config.options });
237
- } else {
238
- this.executeMethod('addControl', [config.type], { position: config.position, ...config.options });
239
- }
240
- }
217
+ // Controls are NOT restored here because they are already present in
218
+ // _js_calls and will be replayed by processPendingCalls(). Restoring
219
+ // them from _controls AND replaying the calls caused duplicate controls.
241
220
  }
242
221
 
243
222
  /**