@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.
package/dist/map/map.d.ts CHANGED
@@ -33,13 +33,14 @@ import { Control, ControlPosition } from '../ui/control';
33
33
  import type { LayerSpecification } from './layer';
34
34
  import type { MapshaperLayer } from '../types/mapshaper-types';
35
35
  export * from './types';
36
- import { type ExpressionEvaluationPolicy, type MapOptions, type QueryFeaturesOptions, type QueriedFeature, type FeatureRef, type HighlightFeatureRef, type ExportSnapshotOptions, type LoadSnapshotOptions, type HighlightStyle, type EditVertexState, type EditDrawState } from './types';
36
+ import { type ExpressionEvaluationPolicy, type MapOptions, type QueryFeaturesOptions, type QueriedFeature, type FeatureRef, type HighlightFeatureRef, type ExportSnapshotOptions, type LoadSnapshotOptions, type HighlightStyle, type EditVertexState, type EditDrawState, type RenderRequest, type RenderAction, type AffineDelta } from './types';
37
37
  export declare class Emap extends EventDispatcher {
38
38
  private _container;
39
39
  private _canvasContainer;
40
40
  private _canvas;
41
41
  private _painter;
42
42
  private _editOverlay;
43
+ private _scheduler;
43
44
  private _viewport;
44
45
  private _projection;
45
46
  private _camera;
@@ -72,6 +73,11 @@ export declare class Emap extends EventDispatcher {
72
73
  private _transformFeature;
73
74
  private _pendingRender;
74
75
  private _rafId;
76
+ private _pendingAction;
77
+ private _pendingNavDelta;
78
+ private _navSnapshotTransform;
79
+ private _wheelSettleTimer;
80
+ private static readonly _WHEEL_SETTLE_MS;
75
81
  private _controlContainers;
76
82
  private _controls;
77
83
  private _highlightManager;
@@ -176,6 +182,9 @@ export declare class Emap extends EventDispatcher {
176
182
  setEditDrawState(state: EditDrawState): void;
177
183
  clearEditDrawState(): void;
178
184
  private _attachEventListeners;
185
+ private _ensureNavSnapshot;
186
+ private _computeNavDelta;
187
+ private _endNavGesture;
179
188
  private _createCanvasContainer;
180
189
  private _updateSize;
181
190
  addSource(id: string, source: TopologySource): void;
@@ -281,9 +290,14 @@ export declare class Emap extends EventDispatcher {
281
290
  fitBounds(b: import('../geo/bounds').Bounds, o?: FitBoundsOptions): this;
282
291
  /** Cancel any running camera animation (no-op when idle). */
283
292
  stop(): this;
284
- _scheduleRender(): void;
293
+ _scheduleRender(action?: RenderAction, navDelta?: AffineDelta): void;
285
294
  private _doRender;
286
- render(): void;
295
+ render(req?: RenderRequest): void;
296
+ private _renderFull;
297
+ private _renderImpl;
298
+ private _captureRenderSnapshot;
299
+ private _applyFastTransform;
300
+ private _clearFastTransform;
287
301
  private _renderLayers;
288
302
  private _renderLineLayer;
289
303
  private _renderFillLayer;
@@ -4,6 +4,17 @@ import type { DrawOverlayState, DrawOverlaySnapKind } from '../renderer/painter'
4
4
  export type EditDrawState = DrawOverlayState;
5
5
  export type SnapKind = DrawOverlaySnapKind;
6
6
  export type ExpressionEvaluationPolicy = 'trusted' | 'disabled';
7
+ export type RenderAction = 'redraw' | 'nav';
8
+ export interface AffineDelta {
9
+ tx: number;
10
+ ty: number;
11
+ sx: number;
12
+ sy: number;
13
+ }
14
+ export interface RenderRequest {
15
+ action?: RenderAction;
16
+ navDelta?: AffineDelta;
17
+ }
7
18
  export interface MapOptions {
8
19
  container: string | HTMLElement;
9
20
  interactive?: boolean;