@zwishing/emap 0.3.1 → 0.3.3

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.
@@ -0,0 +1,32 @@
1
+ import type { AffineDelta, RenderRequest } from '../map/types';
2
+ export declare const SLOW_FRAME_MS = 100;
3
+ export declare const FAST_SETTLE_FALLBACK_MS = 2000;
4
+ export interface RenderSnapshot {
5
+ canvasWidth: number;
6
+ canvasHeight: number;
7
+ pixelRatio: number;
8
+ }
9
+ export interface RenderCallbacks {
10
+ fullRedraw: () => void;
11
+ fastNav: (delta: AffineDelta) => void;
12
+ getSnapshot: () => RenderSnapshot;
13
+ }
14
+ export declare class RenderScheduler {
15
+ private _callbacks;
16
+ private _lastFrameMs;
17
+ private _snapshot;
18
+ private _fastActive;
19
+ private _settleRequested;
20
+ private _settleTimer;
21
+ constructor(_callbacks: RenderCallbacks);
22
+ schedule(req?: RenderRequest): void;
23
+ recordFrame(ms: number, snapshot: RenderSnapshot): void;
24
+ notifyInteractionEnd(hasPendingNav?: boolean): void;
25
+ dispose(): void;
26
+ get lastFrameMs(): number;
27
+ get fastActive(): boolean;
28
+ private _fullRedrawNow;
29
+ private _shouldUseFastNav;
30
+ private _markRedrawPending;
31
+ private _cancelSettle;
32
+ }
@@ -14,4 +14,6 @@ export declare class DrawFeatureControl implements Control {
14
14
  onAdd(map: Emap): HTMLElement;
15
15
  onRemove(): void;
16
16
  private _toggle;
17
+ private _applyOptions;
18
+ private _clearPeerActiveButtons;
17
19
  }
@@ -1,6 +1,8 @@
1
1
  import { Control } from './control';
2
2
  import { Emap } from '../map/map';
3
3
  export interface EditToolbarOptions {
4
+ /** Explicit controls to render. When provided, default edit/draw buttons are not added. */
5
+ controls?: Control[];
4
6
  /** Source ID for draw tools. If not provided, draw buttons are not shown. */
5
7
  drawSource?: string;
6
8
  /** Source layer name for draw tools (optional, defaults to first matching layer). */
@@ -15,11 +17,13 @@ export interface EditToolbarOptions {
15
17
  *
16
18
  * // With draw tools
17
19
  * map.addControl(new EditToolbar({ drawSource: 'my-source' }), 'top-left');
20
+ *
21
+ * // Custom composition
22
+ * map.addControl(new EditToolbar({ controls: [new VertexEditControl()] }), 'top-left');
18
23
  */
19
24
  export declare class EditToolbar implements Control {
20
25
  private _container;
21
- private _vertexEditControl;
22
- private _drawControls;
26
+ private _controls;
23
27
  private _options;
24
28
  constructor(options?: EditToolbarOptions);
25
29
  onAdd(map: Emap): HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwishing/emap",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "A modern, decoupled rendering engine for mapshaper data",
5
5
  "main": "dist/emap.mjs",
6
6
  "module": "dist/emap.mjs",
@@ -98,6 +98,6 @@
98
98
  "kdbush": "^4.0.2",
99
99
  "maplibre-gl": "^5.17.0",
100
100
  "mapshaper": "^0.6.113",
101
- "mproj": "^0.0.40"
101
+ "mproj": "^0.1.2"
102
102
  }
103
103
  }