ts-maps 0.2.7 → 0.3.1
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/LICENSE.md +21 -0
- package/README.md +202 -141
- package/dist/core-map/assets/embedded-icons.d.ts +8 -0
- package/dist/core-map/control/AttributionControl.d.ts +12 -0
- package/dist/core-map/control/Control.d.ts +14 -0
- package/dist/core-map/control/LayersControl.d.ts +38 -0
- package/dist/core-map/control/ScaleControl.d.ts +14 -0
- package/dist/core-map/control/ZoomControl.d.ts +14 -0
- package/dist/core-map/control/index.d.ts +5 -0
- package/dist/core-map/core/Browser.d.ts +24 -0
- package/dist/core-map/core/Class.d.ts +12 -0
- package/dist/core-map/core/Events.d.ts +31 -0
- package/dist/core-map/core/Handler.d.ts +12 -0
- package/dist/core-map/core/Util.d.ts +24 -0
- package/dist/core-map/core/index.d.ts +7 -0
- package/dist/core-map/dom/Animation.d.ts +50 -0
- package/dist/core-map/dom/DomEvent.DoubleTap.d.ts +6 -0
- package/dist/core-map/dom/DomEvent.PointerEvents.d.ts +4 -0
- package/dist/core-map/dom/DomEvent.d.ts +15 -0
- package/dist/core-map/dom/DomUtil.d.ts +22 -0
- package/dist/core-map/dom/Draggable.d.ts +26 -0
- package/dist/core-map/dom/PosAnimation.d.ts +19 -0
- package/dist/core-map/dom/easing.d.ts +41 -0
- package/dist/core-map/dom/index.d.ts +8 -0
- package/dist/core-map/geo/LatLng.d.ts +18 -0
- package/dist/core-map/geo/LatLngBounds.d.ts +27 -0
- package/dist/core-map/geo/TerrainSource.d.ts +35 -0
- package/dist/core-map/geo/crs/CRS.d.ts +23 -0
- package/dist/core-map/geo/crs/EPSG3395.d.ts +7 -0
- package/dist/core-map/geo/crs/EPSG3857.d.ts +10 -0
- package/dist/core-map/geo/crs/EPSG4326.d.ts +7 -0
- package/dist/core-map/geo/crs/EarthCRS.d.ts +7 -0
- package/dist/core-map/geo/crs/SimpleCRS.d.ts +11 -0
- package/dist/core-map/geo/crs/index.d.ts +6 -0
- package/dist/core-map/geo/elevation.d.ts +23 -0
- package/dist/core-map/geo/index.d.ts +13 -0
- package/dist/core-map/geo/index.js +1204 -0
- package/dist/core-map/geo/projection/Projection.Globe.d.ts +30 -0
- package/dist/core-map/geo/projection/Projection.LonLat.d.ts +11 -0
- package/dist/core-map/geo/projection/Projection.Mercator.d.ts +6 -0
- package/dist/core-map/geo/projection/Projection.SphericalMercator.d.ts +6 -0
- package/dist/core-map/geo/projection/index.d.ts +5 -0
- package/dist/core-map/geo/terrainMesh.d.ts +21 -0
- package/dist/core-map/geometry/Bounds.d.ts +23 -0
- package/dist/core-map/geometry/LineUtil.d.ts +13 -0
- package/dist/core-map/geometry/Point.d.ts +35 -0
- package/dist/core-map/geometry/PolyUtil.d.ts +6 -0
- package/dist/core-map/geometry/RTree.d.ts +35 -0
- package/dist/core-map/geometry/Transformation.d.ts +12 -0
- package/dist/core-map/geometry/earcut.d.ts +17 -0
- package/dist/core-map/geometry/index.d.ts +10 -0
- package/dist/core-map/geometry/index.js +1586 -0
- package/dist/core-map/index.d.ts +59 -0
- package/dist/core-map/layer/BlanketOverlay.d.ts +24 -0
- package/dist/core-map/layer/DivOverlay.d.ts +40 -0
- package/dist/core-map/layer/FeatureGroup.d.ts +11 -0
- package/dist/core-map/layer/GeoJSON.d.ts +17 -0
- package/dist/core-map/layer/GeoJSONClusterSource.d.ts +54 -0
- package/dist/core-map/layer/HeatmapLayer.d.ts +40 -0
- package/dist/core-map/layer/ImageOverlay.d.ts +27 -0
- package/dist/core-map/layer/Layer.d.ts +27 -0
- package/dist/core-map/layer/LayerGroup.d.ts +16 -0
- package/dist/core-map/layer/Popup.d.ts +38 -0
- package/dist/core-map/layer/SVGOverlay.d.ts +4 -0
- package/dist/core-map/layer/Tooltip.d.ts +15 -0
- package/dist/core-map/layer/VideoOverlay.d.ts +4 -0
- package/dist/core-map/layer/index.d.ts +18 -0
- package/dist/core-map/layer/marker/DefaultIcon.d.ts +7 -0
- package/dist/core-map/layer/marker/DivIcon.d.ts +5 -0
- package/dist/core-map/layer/marker/Icon.d.ts +10 -0
- package/dist/core-map/layer/marker/Marker.Drag.d.ts +17 -0
- package/dist/core-map/layer/marker/Marker.d.ts +37 -0
- package/dist/core-map/layer/marker/index.d.ts +5 -0
- package/dist/core-map/layer/tile/GridLayer.d.ts +88 -0
- package/dist/core-map/layer/tile/RasterDEMLayer.d.ts +46 -0
- package/dist/core-map/layer/tile/TileLayer.d.ts +22 -0
- package/dist/core-map/layer/tile/VectorTileMapLayer.d.ts +145 -0
- package/dist/core-map/layer/tile/WMSTileLayer.d.ts +12 -0
- package/dist/core-map/layer/tile/index.d.ts +15 -0
- package/dist/core-map/layer/tile/urlTemplate.d.ts +17 -0
- package/dist/core-map/layer/vector/Canvas.d.ts +52 -0
- package/dist/core-map/layer/vector/Circle.d.ts +7 -0
- package/dist/core-map/layer/vector/CircleMarker.d.ts +22 -0
- package/dist/core-map/layer/vector/Path.d.ts +20 -0
- package/dist/core-map/layer/vector/Polygon.d.ts +13 -0
- package/dist/core-map/layer/vector/Polyline.d.ts +30 -0
- package/dist/core-map/layer/vector/Rectangle.d.ts +6 -0
- package/dist/core-map/layer/vector/Renderer.d.ts +12 -0
- package/dist/core-map/layer/vector/Renderer.getRenderer.d.ts +1 -0
- package/dist/core-map/layer/vector/SVG.d.ts +21 -0
- package/dist/core-map/layer/vector/index.d.ts +10 -0
- package/dist/core-map/map/Map.d.ts +352 -0
- package/dist/core-map/map/Style.d.ts +29 -0
- package/dist/core-map/map/handler/BoxZoomHandler.d.ts +23 -0
- package/dist/core-map/map/handler/DoubleClickZoomHandler.d.ts +6 -0
- package/dist/core-map/map/handler/DragHandler.d.ts +27 -0
- package/dist/core-map/map/handler/KeyboardHandler.d.ts +18 -0
- package/dist/core-map/map/handler/PinchZoomHandler.d.ts +20 -0
- package/dist/core-map/map/handler/ScrollWheelZoomHandler.d.ts +12 -0
- package/dist/core-map/map/handler/TapHoldHandler.d.ts +15 -0
- package/dist/core-map/map/handler/TwoFingerPitchHandler.d.ts +21 -0
- package/dist/core-map/map/handler/TwoFingerRotateHandler.d.ts +17 -0
- package/dist/core-map/map/index.d.ts +11 -0
- package/dist/core-map/mvt/VectorTile.d.ts +9 -0
- package/dist/core-map/mvt/VectorTileFeature.d.ts +59 -0
- package/dist/core-map/mvt/VectorTileLayer.d.ts +13 -0
- package/dist/core-map/proto/Pbf.d.ts +84 -0
- package/dist/core-map/renderer/webgl/GLContext.d.ts +22 -0
- package/dist/core-map/renderer/webgl/WebGLTileRenderer.d.ts +86 -0
- package/dist/core-map/renderer/webgl/index.d.ts +9 -0
- package/dist/core-map/renderer/webgl/mat4.d.ts +14 -0
- package/dist/core-map/services/index.d.ts +26 -0
- package/dist/core-map/services/index.js +1230 -0
- package/dist/core-map/services/providers/Google.d.ts +16 -0
- package/dist/core-map/services/providers/Mapbox.d.ts +26 -0
- package/dist/core-map/services/providers/Maptiler.d.ts +11 -0
- package/dist/core-map/services/providers/Nominatim.d.ts +11 -0
- package/dist/core-map/services/providers/OSRM.d.ts +20 -0
- package/dist/core-map/services/providers/Photon.d.ts +10 -0
- package/dist/core-map/services/providers/Valhalla.d.ts +20 -0
- package/dist/core-map/services/types.d.ts +84 -0
- package/dist/core-map/storage/TileCache.d.ts +40 -0
- package/dist/core-map/storage/cachedFetch.d.ts +13 -0
- package/dist/core-map/storage/defaultCache.d.ts +3 -0
- package/dist/core-map/storage/index.d.ts +13 -0
- package/dist/core-map/storage/index.js +283 -0
- package/dist/core-map/storage/offlineRegion.d.ts +26 -0
- package/dist/core-map/style-spec/diff.d.ts +17 -0
- package/dist/core-map/style-spec/expressions/Color.d.ts +16 -0
- package/dist/core-map/style-spec/expressions/compile.d.ts +4 -0
- package/dist/core-map/style-spec/expressions/errors.d.ts +8 -0
- package/dist/core-map/style-spec/expressions/index.d.ts +16 -0
- package/dist/core-map/style-spec/expressions/legacyFilter.d.ts +6 -0
- package/dist/core-map/style-spec/expressions/operators/conversion.d.ts +1 -0
- package/dist/core-map/style-spec/expressions/operators/interpolate.d.ts +14 -0
- package/dist/core-map/style-spec/expressions/operators/logical.d.ts +1 -0
- package/dist/core-map/style-spec/expressions/operators/lookup.d.ts +1 -0
- package/dist/core-map/style-spec/expressions/operators/math.d.ts +1 -0
- package/dist/core-map/style-spec/expressions/operators/string.d.ts +1 -0
- package/dist/core-map/style-spec/expressions/registry.d.ts +29 -0
- package/dist/core-map/style-spec/expressions/types.d.ts +48 -0
- package/dist/core-map/style-spec/expressions/validate.d.ts +13 -0
- package/dist/core-map/style-spec/index.d.ts +68 -0
- package/dist/core-map/style-spec/index.js +2529 -0
- package/dist/core-map/style-spec/schema.d.ts +381 -0
- package/dist/core-map/style-spec/types.d.ts +375 -0
- package/dist/core-map/style-spec/validate.d.ts +14 -0
- package/dist/core-map/symbols/CollisionIndex.d.ts +21 -0
- package/dist/core-map/symbols/GlyphAtlas.d.ts +38 -0
- package/dist/core-map/symbols/IconAtlas.d.ts +18 -0
- package/dist/core-map/symbols/index.d.ts +6 -0
- package/dist/core-map/symbols/index.js +501 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +18413 -1857
- package/package.json +50 -58
- package/src/core-map/ts-maps.css +725 -0
- package/dist/components/base.d.ts +0 -17
- package/dist/components/concerns/interactable.d.ts +0 -1
- package/dist/components/line.d.ts +0 -29
- package/dist/components/marker.d.ts +0 -50
- package/dist/components/region.d.ts +0 -46
- package/dist/components/tooltip.d.ts +0 -22
- package/dist/core/apply-transform.d.ts +0 -7
- package/dist/core/coords-to-point.d.ts +0 -12
- package/dist/core/create-lines.d.ts +0 -2
- package/dist/core/create-markers.d.ts +0 -2
- package/dist/core/create-regions.d.ts +0 -2
- package/dist/core/create-series.d.ts +0 -3
- package/dist/core/get-inset-for-point.d.ts +0 -13
- package/dist/core/get-marker-position.d.ts +0 -6
- package/dist/core/index.d.ts +0 -1
- package/dist/core/reposition-labels.d.ts +0 -2
- package/dist/core/reposition-lines.d.ts +0 -2
- package/dist/core/reposition-markers.d.ts +0 -2
- package/dist/core/resize.d.ts +0 -3
- package/dist/core/set-focus.d.ts +0 -2
- package/dist/core/set-scale.d.ts +0 -2
- package/dist/core/setup-container-events.d.ts +0 -2
- package/dist/core/setup-container-touch-events.d.ts +0 -2
- package/dist/core/setup-element-events.d.ts +0 -2
- package/dist/core/setup-zoom-buttons.d.ts +0 -2
- package/dist/core/update-size.d.ts +0 -2
- package/dist/data-visualization.d.ts +0 -17
- package/dist/defaults/events.d.ts +0 -1
- package/dist/defaults/options.d.ts +0 -1
- package/dist/event-handler.d.ts +0 -1
- package/dist/legend.d.ts +0 -17
- package/dist/map.d.ts +0 -81
- package/dist/maps/brasil.d.ts +0 -2
- package/dist/maps/brasil.js +0 -7
- package/dist/maps/canada.d.ts +0 -2
- package/dist/maps/canada.js +0 -7
- package/dist/maps/iraq.d.ts +0 -2
- package/dist/maps/iraq.js +0 -84
- package/dist/maps/italy.d.ts +0 -2
- package/dist/maps/italy.js +0 -7
- package/dist/maps/russia.d.ts +0 -2
- package/dist/maps/russia.js +0 -366
- package/dist/maps/spain.d.ts +0 -2
- package/dist/maps/spain.js +0 -7
- package/dist/maps/us-aea-en.d.ts +0 -2
- package/dist/maps/us-aea-en.js +0 -7
- package/dist/maps/us-lcc-en.d.ts +0 -2
- package/dist/maps/us-lcc-en.js +0 -7
- package/dist/maps/us-merc-en.d.ts +0 -2
- package/dist/maps/us-merc-en.js +0 -7
- package/dist/maps/us-mill-en.d.ts +0 -2
- package/dist/maps/us-mill-en.js +0 -7
- package/dist/maps/world-merc.d.ts +0 -2
- package/dist/maps/world-merc.js +0 -7
- package/dist/maps/world.d.ts +0 -2
- package/dist/maps/world.js +0 -7
- package/dist/projection.d.ts +0 -1
- package/dist/scales/ordinal-scale.d.ts +0 -12
- package/dist/series.d.ts +0 -14
- package/dist/svg/base-element.d.ts +0 -19
- package/dist/svg/canvas-element.d.ts +0 -21
- package/dist/svg/image-element.d.ts +0 -12
- package/dist/svg/shape-element.d.ts +0 -19
- package/dist/svg/text-element.d.ts +0 -7
- package/dist/types.d.ts +0 -418
- package/dist/util/deep-merge.d.ts +0 -2
- package/dist/util/index.d.ts +0 -18
- package/dist/utils.d.ts +0 -87
- package/dist/vector-map.d.ts +0 -5
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { Animation } from '../dom/Animation';
|
|
2
|
+
import { Bounds } from '../geometry/Bounds';
|
|
3
|
+
import { Evented } from '../core/Events';
|
|
4
|
+
import { LatLng } from '../geo/LatLng';
|
|
5
|
+
import { LatLngBounds } from '../geo/LatLngBounds';
|
|
6
|
+
import { Point } from '../geometry/Point';
|
|
7
|
+
import { PosAnimation } from '../dom/PosAnimation';
|
|
8
|
+
import { Style } from './Style';
|
|
9
|
+
import { TerrainSource } from '../geo/TerrainSource';
|
|
10
|
+
import { WebGLTileRenderer } from '../renderer/webgl/WebGLTileRenderer';
|
|
11
|
+
import type { EasingFunction } from '../dom/Animation';
|
|
12
|
+
import type { LayerSpecification, SourceSpecification, Style as StyleSpec } from '../style-spec/types';
|
|
13
|
+
import type { OfflineRegionOptions, OfflineRegionResult } from '../storage/index';
|
|
14
|
+
export declare function createMap(id: string | HTMLElement, options?: MapOptions): TsMap;
|
|
15
|
+
export declare const Map: typeof TsMap;
|
|
16
|
+
export declare interface MapOptions {
|
|
17
|
+
crs?: any
|
|
18
|
+
center?: any
|
|
19
|
+
zoom?: number
|
|
20
|
+
minZoom?: number
|
|
21
|
+
maxZoom?: number
|
|
22
|
+
layers?: any[]
|
|
23
|
+
maxBounds?: any
|
|
24
|
+
renderer?: any
|
|
25
|
+
zoomAnimation?: boolean
|
|
26
|
+
zoomAnimationThreshold?: number
|
|
27
|
+
fadeAnimation?: boolean
|
|
28
|
+
markerZoomAnimation?: boolean
|
|
29
|
+
transform3DLimit?: number
|
|
30
|
+
bearing?: number
|
|
31
|
+
pitch?: number
|
|
32
|
+
maxPitch?: number
|
|
33
|
+
minPitch?: number
|
|
34
|
+
zoomSnap?: number
|
|
35
|
+
zoomDelta?: number
|
|
36
|
+
trackResize?: boolean
|
|
37
|
+
[key: string]: any
|
|
38
|
+
}
|
|
39
|
+
// Atmospheric fog settings. Applied by the WebGL renderer when present;
|
|
40
|
+
// ignored by the Canvas2D path. Mirrors the property naming used by Mapbox
|
|
41
|
+
// GL JS (`map.setFog(...)`) so existing muscle-memory transfers.
|
|
42
|
+
export declare interface FogOptions {
|
|
43
|
+
color?: string
|
|
44
|
+
'horizon-blend'?: number
|
|
45
|
+
range?: [number, number]
|
|
46
|
+
'high-color'?: string
|
|
47
|
+
'star-intensity'?: number
|
|
48
|
+
}
|
|
49
|
+
// Sky-layer settings. Same WebGL-only caveat as FogOptions.
|
|
50
|
+
export declare interface SkyOptions {
|
|
51
|
+
'sky-color'?: string
|
|
52
|
+
'horizon-color'?: string
|
|
53
|
+
'fog-ground-blend'?: number
|
|
54
|
+
'sun-position'?: [number, number]
|
|
55
|
+
'sun-intensity'?: number
|
|
56
|
+
}
|
|
57
|
+
// Pluggable 3D layer contract. A `CustomLayerInterface` object can be handed
|
|
58
|
+
// to `map.addCustomLayer(...)`; the renderer will call `render()` each frame
|
|
59
|
+
// alongside the tile-layer draw calls with the current GL context and
|
|
60
|
+
// projection matrix. `onAdd` / `onRemove` bracket the layer's lifetime and
|
|
61
|
+
// are invoked only when a GL context is available.
|
|
62
|
+
export declare interface CustomLayerInterface {
|
|
63
|
+
id: string
|
|
64
|
+
type: 'custom'
|
|
65
|
+
renderingMode?: '2d' | '3d'
|
|
66
|
+
onAdd?: (map: TsMap, gl: WebGL2RenderingContext) => void
|
|
67
|
+
onRemove?: (map: TsMap, gl: WebGL2RenderingContext) => void
|
|
68
|
+
render: (gl: WebGL2RenderingContext, projectionMatrix: Float32Array) => void
|
|
69
|
+
}
|
|
70
|
+
// Terrain (3D DEM mesh warping) settings. The map keeps an in-memory
|
|
71
|
+
// `TerrainSource` populated from a raster-dem source; the WebGL renderer
|
|
72
|
+
// consumes it to build per-tile warped ground meshes. The API shape mirrors
|
|
73
|
+
// Mapbox GL JS's `setTerrain()` — `source` names a raster-dem source (added
|
|
74
|
+
// via `addSource()`), `exaggeration` scales vertical relief.
|
|
75
|
+
export declare interface TerrainOptions {
|
|
76
|
+
source: string
|
|
77
|
+
exaggeration?: number
|
|
78
|
+
}
|
|
79
|
+
// The central class of the API — used to create a map on a page and manipulate it.
|
|
80
|
+
export declare class TsMap extends Evented {
|
|
81
|
+
static _pointerEvents: string[];
|
|
82
|
+
options: MapOptions;
|
|
83
|
+
_handlers: any[];
|
|
84
|
+
_layers: Record<number, any>;
|
|
85
|
+
_zoomBoundLayers: Record<number, any>;
|
|
86
|
+
_sizeChanged: boolean;
|
|
87
|
+
_bearing: number;
|
|
88
|
+
_pitch: number;
|
|
89
|
+
_container: HTMLElement & { _tsmap_id?: number };
|
|
90
|
+
_containerId?: number;
|
|
91
|
+
_loaded?: boolean;
|
|
92
|
+
_zoom: number;
|
|
93
|
+
_lastCenter?: LatLng | null;
|
|
94
|
+
_pixelOrigin?: Point;
|
|
95
|
+
_mapPane: HTMLElement;
|
|
96
|
+
_panes: Record<string, HTMLElement>;
|
|
97
|
+
_paneRenderers: Record<string, any>;
|
|
98
|
+
_targets: Record<number, any>;
|
|
99
|
+
_fadeAnimated?: boolean;
|
|
100
|
+
_zoomAnimated?: boolean;
|
|
101
|
+
_animatingZoom?: boolean;
|
|
102
|
+
_animateToCenter?: LatLng;
|
|
103
|
+
_animateToZoom?: number;
|
|
104
|
+
_tempFireZoomEvent?: boolean;
|
|
105
|
+
_panAnim?: PosAnimation;
|
|
106
|
+
_camAnim?: Animation;
|
|
107
|
+
_flyToFrame?: number;
|
|
108
|
+
_resizeRequest?: number | null;
|
|
109
|
+
_sizeTimer?: ReturnType<typeof setTimeout>;
|
|
110
|
+
_transitionEndTimer?: ReturnType<typeof setTimeout>;
|
|
111
|
+
_resizeObserver?: ResizeObserver;
|
|
112
|
+
_proxy?: HTMLElement;
|
|
113
|
+
_size?: Point;
|
|
114
|
+
_locateOptions?: any;
|
|
115
|
+
_locationWatchId?: number;
|
|
116
|
+
_layersMinZoom?: number;
|
|
117
|
+
_layersMaxZoom?: number;
|
|
118
|
+
_enforcingBounds?: boolean;
|
|
119
|
+
_initControlPos?: () => void;
|
|
120
|
+
_clearControlPos?: () => void;
|
|
121
|
+
_addLayers?: (layers?: any | any[]) => void;
|
|
122
|
+
_renderer?: any;
|
|
123
|
+
dragging?: any;
|
|
124
|
+
boxZoom?: any;
|
|
125
|
+
touchZoom?: any;
|
|
126
|
+
pinchZoom?: any;
|
|
127
|
+
doubleClickZoom?: any;
|
|
128
|
+
scrollWheelZoom?: any;
|
|
129
|
+
keyboard?: any;
|
|
130
|
+
tapHold?: any;
|
|
131
|
+
touchRotate?: any;
|
|
132
|
+
touchPitch?: any;
|
|
133
|
+
_popup?: any;
|
|
134
|
+
_style?: Style;
|
|
135
|
+
_featureState?: globalThis.Map<string, Record<string, unknown>>;
|
|
136
|
+
_layerHandlers?: globalThis.Map<string, Array<{
|
|
137
|
+
layerId: string
|
|
138
|
+
listener: (e: any) => void
|
|
139
|
+
wrapped: (e: any) => void
|
|
140
|
+
context?: any
|
|
141
|
+
}>>;
|
|
142
|
+
_fog?: FogOptions | null;
|
|
143
|
+
_sky?: SkyOptions | null;
|
|
144
|
+
_customLayers?: globalThis.Map<string, CustomLayerInterface>;
|
|
145
|
+
_terrain?: TerrainOptions | null;
|
|
146
|
+
_terrainSource?: TerrainSource;
|
|
147
|
+
_atmosphereOverlay?: HTMLElement;
|
|
148
|
+
_terrainFetchInFlight?: Map<string, Promise<void>>;
|
|
149
|
+
_terrainOverlayCanvas?: HTMLCanvasElement;
|
|
150
|
+
_terrainOverlayRenderer?: WebGLTileRenderer;
|
|
151
|
+
_offlineApi?: {
|
|
152
|
+
save: (opts: OfflineRegionOptions) => Promise<OfflineRegionResult>
|
|
153
|
+
size: () => Promise<{ bytes: number, entries: number }>
|
|
154
|
+
clear: () => Promise<void>
|
|
155
|
+
};
|
|
156
|
+
initialize(id: string | HTMLElement, options?: MapOptions): void;
|
|
157
|
+
setView(center: any, zoom?: number, options?: any): this;
|
|
158
|
+
setZoom(zoom: number, options?: any): this;
|
|
159
|
+
zoomIn(delta?: number, options?: any): this;
|
|
160
|
+
zoomOut(delta?: number, options?: any): this;
|
|
161
|
+
setZoomAround(latlng: any, zoom: number, options?: any): this;
|
|
162
|
+
_getBoundsCenterZoom(bounds: any, options?: any): { center: LatLng, zoom: number };
|
|
163
|
+
fitBounds(bounds: any, options?: any): this;
|
|
164
|
+
fitWorld(options?: any): this;
|
|
165
|
+
panTo(center: any, options?: any): this;
|
|
166
|
+
panBy(offset: any, options?: any): this;
|
|
167
|
+
flyTo(targetCenter: any, targetZoom?: number, options?: any): this;
|
|
168
|
+
flyToBounds(bounds: any, options?: any): this;
|
|
169
|
+
setMaxBounds(bounds: any): this;
|
|
170
|
+
setMinZoom(zoom: number): this;
|
|
171
|
+
setMaxZoom(zoom: number): this;
|
|
172
|
+
panInsideBounds(bounds: any, options?: any): this;
|
|
173
|
+
panInside(latlng: any, options?: any): this;
|
|
174
|
+
invalidateSize(options?: any): this;
|
|
175
|
+
stop(): this;
|
|
176
|
+
locate(options?: any): this;
|
|
177
|
+
stopLocate(): this;
|
|
178
|
+
_handleGeolocationError(error: any): void;
|
|
179
|
+
_handleGeolocationResponse(pos: GeolocationPosition): void;
|
|
180
|
+
addHandler(name: string, HandlerClass: any): this;
|
|
181
|
+
remove(): this;
|
|
182
|
+
createPane(name?: string, container?: HTMLElement | null): HTMLElement;
|
|
183
|
+
getCenter(): LatLng;
|
|
184
|
+
getZoom(): number;
|
|
185
|
+
getBearing(): number;
|
|
186
|
+
setBearing(bearing: number): this;
|
|
187
|
+
rotateTo(bearing: number, options?: { animate?: boolean, duration?: number, easing?: EasingFunction }): this;
|
|
188
|
+
getPitch(): number;
|
|
189
|
+
setPitch(pitch: number): this;
|
|
190
|
+
pitchTo(pitch: number, options?: { animate?: boolean, duration?: number, easing?: EasingFunction }): this;
|
|
191
|
+
_clampPitch(pitch: number): number;
|
|
192
|
+
easeTo(options?: {
|
|
193
|
+
center?: any
|
|
194
|
+
zoom?: number
|
|
195
|
+
bearing?: number
|
|
196
|
+
pitch?: number
|
|
197
|
+
duration?: number
|
|
198
|
+
easing?: EasingFunction
|
|
199
|
+
padding?: any
|
|
200
|
+
noMoveStart?: boolean
|
|
201
|
+
}): this;
|
|
202
|
+
isEasing(): boolean;
|
|
203
|
+
getCamera(): { center: LatLng, zoom: number, bearing: number, pitch: number };
|
|
204
|
+
jumpTo(options?: {
|
|
205
|
+
center?: any
|
|
206
|
+
zoom?: number
|
|
207
|
+
bearing?: number
|
|
208
|
+
pitch?: number
|
|
209
|
+
}): this;
|
|
210
|
+
_getCamAnim(): Animation;
|
|
211
|
+
static _lerpBearing(from: number, to: number, t: number): number;
|
|
212
|
+
getBounds(): LatLngBounds;
|
|
213
|
+
getMinZoom(): number;
|
|
214
|
+
getMaxZoom(): number;
|
|
215
|
+
getBoundsZoom(bounds: any, inside?: boolean, padding?: any): number;
|
|
216
|
+
getSize(): Point;
|
|
217
|
+
getPixelBounds(center?: any, zoom?: number): Bounds;
|
|
218
|
+
getPixelOrigin(): Point;
|
|
219
|
+
getPixelWorldBounds(zoom?: number): Bounds;
|
|
220
|
+
getPane(pane: string | HTMLElement): HTMLElement;
|
|
221
|
+
getPanes(): Record<string, HTMLElement>;
|
|
222
|
+
getContainer(): HTMLElement;
|
|
223
|
+
getZoomScale(toZoom: number, fromZoom?: number): number;
|
|
224
|
+
getScaleZoom(scale: number, fromZoom?: number): number;
|
|
225
|
+
project(latlng: any, zoom?: number): Point;
|
|
226
|
+
unproject(point: any, zoom?: number): LatLng;
|
|
227
|
+
layerPointToLatLng(point: any): LatLng;
|
|
228
|
+
latLngToLayerPoint(latlng: any): Point;
|
|
229
|
+
wrapLatLng(latlng: any): LatLng;
|
|
230
|
+
wrapLatLngBounds(bounds: any): LatLngBounds;
|
|
231
|
+
distance(latlng1: any, latlng2: any): number;
|
|
232
|
+
containerPointToLayerPoint(point: any): Point;
|
|
233
|
+
layerPointToContainerPoint(point: any): Point;
|
|
234
|
+
containerPointToLatLng(point: any): LatLng;
|
|
235
|
+
latLngToContainerPoint(latlng: any): Point;
|
|
236
|
+
pointerEventToContainerPoint(e: any): Point;
|
|
237
|
+
pointerEventToLayerPoint(e: any): Point;
|
|
238
|
+
pointerEventToLatLng(e: any): LatLng;
|
|
239
|
+
_initContainer(id: string | HTMLElement): void;
|
|
240
|
+
_initLayout(): void;
|
|
241
|
+
_initPanes(): void;
|
|
242
|
+
_resetView(center: LatLng, zoom: number, noMoveStart?: boolean): void;
|
|
243
|
+
_moveStart(zoomChanged: boolean, noMoveStart?: boolean): this;
|
|
244
|
+
_move(center: LatLng, zoom?: number, data?: any, suppressEvent?: boolean): this;
|
|
245
|
+
_moveEnd(zoomChanged: boolean): this;
|
|
246
|
+
_stop(): this;
|
|
247
|
+
_rawPanBy(offset: Point): void;
|
|
248
|
+
_getZoomSpan(): number;
|
|
249
|
+
_panInsideMaxBounds(): void;
|
|
250
|
+
_checkIfLoaded(): void;
|
|
251
|
+
_initEvents(remove?: boolean): void;
|
|
252
|
+
_onResize(): void;
|
|
253
|
+
_onScroll(): void;
|
|
254
|
+
_onMoveEnd(): void;
|
|
255
|
+
_findEventTargets(e: any, type: string): any[];
|
|
256
|
+
_isClickDisabled(el: any): boolean | undefined;
|
|
257
|
+
_handleDOMEvent(e: any): void;
|
|
258
|
+
_fireDOMEvent(e: any, type: string, canvasTargets?: any[]): void;
|
|
259
|
+
_draggableMoved(obj: any): boolean;
|
|
260
|
+
_clearHandlers(): void;
|
|
261
|
+
whenReady(callback: (e?: any) => void, context?: any): this;
|
|
262
|
+
_getMapPanePos(): Point;
|
|
263
|
+
_rotatePoint(p: Point, angle: number, origin: Point): Point;
|
|
264
|
+
_applyCameraTransform(): void;
|
|
265
|
+
_pitchPoint(p: Point): Point;
|
|
266
|
+
_unpitchPoint(p: Point): Point;
|
|
267
|
+
_moved(): boolean;
|
|
268
|
+
_getTopLeftPoint(center?: any, zoom?: number): Point;
|
|
269
|
+
_getNewPixelOrigin(center: any, zoom?: number): Point;
|
|
270
|
+
_latLngToNewLayerPoint(latlng: any, zoom: number, center: any): Point;
|
|
271
|
+
_latLngBoundsToNewLayerBounds(latLngBounds: LatLngBounds, zoom: number, center: any): Bounds;
|
|
272
|
+
_getCenterLayerPoint(): Point;
|
|
273
|
+
_getCenterOffset(latlng: any): Point;
|
|
274
|
+
_limitCenter(center: LatLng, zoom: number, bounds?: LatLngBounds | null): LatLng;
|
|
275
|
+
_limitOffset(offset: Point, bounds?: LatLngBounds | null): Point;
|
|
276
|
+
_getBoundsOffset(pxBounds: Bounds, maxBounds: LatLngBounds, zoom?: number): Point;
|
|
277
|
+
_rebound(left: number, right: number): number;
|
|
278
|
+
_limitZoom(zoom: number): number;
|
|
279
|
+
_onPanTransitionStep(): void;
|
|
280
|
+
_onPanTransitionEnd(): void;
|
|
281
|
+
_tryAnimatedPan(center: any, options?: any): boolean;
|
|
282
|
+
_createAnimProxy(): void;
|
|
283
|
+
_animateProxyZoom(e: any): void;
|
|
284
|
+
_animMoveEnd(): void;
|
|
285
|
+
_destroyAnimProxy(): void;
|
|
286
|
+
_catchTransitionEnd(e: any): void;
|
|
287
|
+
_nothingToAnimate(): boolean;
|
|
288
|
+
_tryAnimatedZoom(center: any, zoom: number, options?: any): boolean;
|
|
289
|
+
_animateZoom(center: LatLng, zoom: number, startAnim?: boolean, noUpdate?: boolean): void;
|
|
290
|
+
_onZoomTransitionEnd(): void;
|
|
291
|
+
setStyle(style: StyleSpec, opts?: { diff?: boolean, validate?: boolean }): this;
|
|
292
|
+
getStyle(): StyleSpec | undefined;
|
|
293
|
+
isStyleLoaded(): boolean;
|
|
294
|
+
addSource(sourceId: string, source: SourceSpecification): this;
|
|
295
|
+
getSource(sourceId: string): SourceSpecification | undefined;
|
|
296
|
+
removeSource(sourceId: string): this;
|
|
297
|
+
_makeSourceLayer(sourceId: string, source: SourceSpecification): unknown;
|
|
298
|
+
addStyleLayer(layer: LayerSpecification, before?: string): this;
|
|
299
|
+
removeStyleLayer(id: string): this;
|
|
300
|
+
getStyleLayer(id: string): LayerSpecification | undefined;
|
|
301
|
+
setPaintProperty(layerId: string, name: string, value: unknown): this;
|
|
302
|
+
setLayoutProperty(layerId: string, name: string, value: unknown): this;
|
|
303
|
+
setFilter(layerId: string, filter: unknown): this;
|
|
304
|
+
on(type: any, a?: any, b?: any, c?: any): this;
|
|
305
|
+
off(type?: any, a?: any, b?: any, c?: any): this;
|
|
306
|
+
once(type: any, a?: any, b?: any, c?: any): this;
|
|
307
|
+
queryRenderedFeatures(pointOrOpts?: any, maybeOpts?: any): any[];
|
|
308
|
+
querySourceFeatures(sourceId: string, opts?: { sourceLayer?: string, filter?: unknown }): any[];
|
|
309
|
+
_featureStateKey(lookup: { source: string, sourceLayer?: string, id: number | string }): string;
|
|
310
|
+
_ensureFeatureStateMap(): globalThis.Map<string, Record<string, unknown>>;
|
|
311
|
+
_repaintSource(sourceId: string): void;
|
|
312
|
+
setFeatureState(lookup: { source: string, sourceLayer?: string, id: number | string }, state: Record<string, unknown>): this;
|
|
313
|
+
getFeatureState(lookup: { source: string, sourceLayer?: string, id: number | string }): Record<string, unknown>;
|
|
314
|
+
removeFeatureState(lookup: { source: string, sourceLayer?: string, id: number | string }, key?: string): this;
|
|
315
|
+
_installFeatureStateLookup(sourceId: string, host: any): void;
|
|
316
|
+
_applyStyleCommand(cmd: any): void;
|
|
317
|
+
setFog(fog: FogOptions | null): this;
|
|
318
|
+
getFog(): FogOptions | null;
|
|
319
|
+
setSky(sky: SkyOptions | null): this;
|
|
320
|
+
getSky(): SkyOptions | null;
|
|
321
|
+
setTerrain(terrain: TerrainOptions | null): this;
|
|
322
|
+
_ensureTerrainOverlay(): void;
|
|
323
|
+
_destroyTerrainOverlay(): void;
|
|
324
|
+
_renderTerrainOverlay(): void;
|
|
325
|
+
getTerrain(): TerrainOptions | null;
|
|
326
|
+
getTerrainSource(): TerrainSource | undefined;
|
|
327
|
+
setRenderer(name: 'canvas2d' | 'webgl' | 'svg'): this;
|
|
328
|
+
getPreferredRenderer(): 'canvas2d' | 'webgl' | 'svg';
|
|
329
|
+
queryTerrainElevation(lngLat: LatLng | { lng: number, lat: number }): number | null;
|
|
330
|
+
toCanvas(): HTMLCanvasElement;
|
|
331
|
+
toDataURL(type?: string, quality?: number): string;
|
|
332
|
+
toBlob(type?: string, quality?: number): Promise<Blob | null>;
|
|
333
|
+
_requestExportFrame(): void;
|
|
334
|
+
_isGlobeProjection(): boolean;
|
|
335
|
+
_globeAtmosphereMix(): number;
|
|
336
|
+
_updateAtmosphereOverlay(): void;
|
|
337
|
+
_getCustomLayerGL(): WebGL2RenderingContext | null;
|
|
338
|
+
addCustomLayer(layer: CustomLayerInterface): this;
|
|
339
|
+
addTerrainTile(coord: { z: number, x: number, y: number }, pixels: Uint8Array | Uint8ClampedArray): void;
|
|
340
|
+
_drawTerrainForTile(glRenderer: WebGLTileRenderer, coord: { z: number, x: number, y: number }, tileSize: number, projectionMatrix: Float32Array): void;
|
|
341
|
+
_maybeFetchTerrainTile(coord: { z: number, x: number, y: number }): void;
|
|
342
|
+
_wireTerrainCameraHooks(): void;
|
|
343
|
+
_invokeCustomLayerRender(gl: WebGL2RenderingContext, projectionMatrix: Float32Array): void;
|
|
344
|
+
removeCustomLayer(id: string): this;
|
|
345
|
+
getCustomLayer(id: string): CustomLayerInterface | undefined;
|
|
346
|
+
getCustomLayers(): CustomLayerInterface[];
|
|
347
|
+
get offline(): {
|
|
348
|
+
save: (opts: OfflineRegionOptions) => Promise<OfflineRegionResult>
|
|
349
|
+
size: () => Promise<{ bytes: number, entries: number }>
|
|
350
|
+
clear: () => Promise<void>
|
|
351
|
+
};
|
|
352
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { LayerSpecification, Style as StyleSpec } from '../style-spec/types';
|
|
2
|
+
export declare interface StyleOptions {
|
|
3
|
+
validate?: boolean
|
|
4
|
+
}
|
|
5
|
+
// In-memory representation of a live style document. Pure data + mutation
|
|
6
|
+
// helpers; hosting and rendering are the map's job to avoid a circular
|
|
7
|
+
// dependency between Map.ts and the concrete layer classes.
|
|
8
|
+
export declare class Style {
|
|
9
|
+
spec: StyleSpec;
|
|
10
|
+
sourceLayers: Map<string, unknown>;
|
|
11
|
+
layerSpecs: Map<string, LayerSpecification>;
|
|
12
|
+
constructor(spec: StyleSpec, opts?: StyleOptions);
|
|
13
|
+
setPaintProperty(layerId: string, name: string, value: unknown): void;
|
|
14
|
+
setLayoutProperty(layerId: string, name: string, value: unknown): void;
|
|
15
|
+
setFilter(layerId: string, filter: unknown): void;
|
|
16
|
+
setLayerZoomRange(layerId: string, minzoom?: number, maxzoom?: number): void;
|
|
17
|
+
serialize(): StyleSpec;
|
|
18
|
+
toVectorStyleLayer(layer: LayerSpecification): {
|
|
19
|
+
id: string
|
|
20
|
+
type: 'fill' | 'line' | 'circle' | 'symbol'
|
|
21
|
+
sourceLayer: string
|
|
22
|
+
minzoom?: number
|
|
23
|
+
maxzoom?: number
|
|
24
|
+
filter?: unknown
|
|
25
|
+
paint: Record<string, unknown>
|
|
26
|
+
layout: Record<string, unknown>
|
|
27
|
+
};
|
|
28
|
+
_cloneSpec(spec: StyleSpec): StyleSpec;
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Handler } from '../../core/Handler';
|
|
2
|
+
import type { Point } from '../../geometry/Point';
|
|
3
|
+
export declare class BoxZoomHandler extends Handler {
|
|
4
|
+
_container: HTMLElement;
|
|
5
|
+
_pane: HTMLElement;
|
|
6
|
+
_resetStateTimeout: any;
|
|
7
|
+
_moved: boolean;
|
|
8
|
+
_box?: HTMLElement;
|
|
9
|
+
_startPoint?: Point;
|
|
10
|
+
_point?: Point;
|
|
11
|
+
initialize(map: any): void;
|
|
12
|
+
addHooks(): void;
|
|
13
|
+
removeHooks(): void;
|
|
14
|
+
moved(): boolean;
|
|
15
|
+
_destroy(): void;
|
|
16
|
+
_resetState(): void;
|
|
17
|
+
_clearDeferredResetState(): void;
|
|
18
|
+
_onPointerDown(e: PointerEvent): boolean | undefined;
|
|
19
|
+
_onPointerMove(e: PointerEvent): void;
|
|
20
|
+
_finish(): void;
|
|
21
|
+
_onPointerUp(e: PointerEvent): void;
|
|
22
|
+
_onKeyDown(e: KeyboardEvent): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Bounds } from '../../geometry/Bounds';
|
|
2
|
+
import { Draggable } from '../../dom/Draggable';
|
|
3
|
+
import { Handler } from '../../core/Handler';
|
|
4
|
+
import type { Point } from '../../geometry/Point';
|
|
5
|
+
export declare class DragHandler extends Handler {
|
|
6
|
+
_draggable?: Draggable & { _absPos?: Point };
|
|
7
|
+
_positions: Point[];
|
|
8
|
+
_times: number[];
|
|
9
|
+
_lastTime?: number;
|
|
10
|
+
_lastPos?: Point;
|
|
11
|
+
_offsetLimit: Bounds | null;
|
|
12
|
+
_viscosity: number;
|
|
13
|
+
_initialWorldOffset: number;
|
|
14
|
+
_worldWidth: number;
|
|
15
|
+
addHooks(): void;
|
|
16
|
+
removeHooks(): void;
|
|
17
|
+
moved(): boolean | undefined;
|
|
18
|
+
moving(): boolean | undefined;
|
|
19
|
+
_onDragStart(): void;
|
|
20
|
+
_onDrag(e: any): void;
|
|
21
|
+
_prunePositions(time: number): void;
|
|
22
|
+
_onZoomEnd(): void;
|
|
23
|
+
_viscousLimit(value: number, threshold: number): number;
|
|
24
|
+
_onPreDragLimit(): void;
|
|
25
|
+
_onPreDragWrap(): void;
|
|
26
|
+
_onDragEnd(e: any): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Handler } from '../../core/Handler';
|
|
2
|
+
export declare class KeyboardHandler extends Handler {
|
|
3
|
+
static keyCodes: Record<string, string[]>;
|
|
4
|
+
_panKeys: Record<string, [number, number]>;
|
|
5
|
+
_zoomKeys: Record<string, number>;
|
|
6
|
+
_focused: boolean;
|
|
7
|
+
initialize(map: any): void;
|
|
8
|
+
addHooks(): void;
|
|
9
|
+
removeHooks(): void;
|
|
10
|
+
_onPointerDown(): void;
|
|
11
|
+
_onFocus(): void;
|
|
12
|
+
_onBlur(): void;
|
|
13
|
+
_setPanDelta(panDelta: number): void;
|
|
14
|
+
_setZoomDelta(zoomDelta: number): void;
|
|
15
|
+
_addHooks(): void;
|
|
16
|
+
_removeHooks(): void;
|
|
17
|
+
_onKeyDown(e: KeyboardEvent): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Handler } from '../../core/Handler';
|
|
2
|
+
import type { LatLng } from '../../geo/LatLng';
|
|
3
|
+
import type { Point } from '../../geometry/Point';
|
|
4
|
+
export declare class PinchZoomHandler extends Handler {
|
|
5
|
+
_zooming: boolean;
|
|
6
|
+
_moved: boolean;
|
|
7
|
+
_centerPoint?: Point;
|
|
8
|
+
_startLatLng?: LatLng;
|
|
9
|
+
_pinchStartLatLng?: LatLng;
|
|
10
|
+
_startDist?: number;
|
|
11
|
+
_startZoom?: number;
|
|
12
|
+
_zoom?: number;
|
|
13
|
+
_center?: LatLng;
|
|
14
|
+
_animRequest?: number;
|
|
15
|
+
addHooks(): void;
|
|
16
|
+
removeHooks(): void;
|
|
17
|
+
_onPointerStart(e: PointerEvent): void;
|
|
18
|
+
_onPointerMove(e: PointerEvent): void;
|
|
19
|
+
_onPointerEnd(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Handler } from '../../core/Handler';
|
|
2
|
+
import type { Point } from '../../geometry/Point';
|
|
3
|
+
export declare class ScrollWheelZoomHandler extends Handler {
|
|
4
|
+
_delta: number;
|
|
5
|
+
_startTime: number | null;
|
|
6
|
+
_timer?: ReturnType<typeof setTimeout>;
|
|
7
|
+
_lastMousePos?: Point;
|
|
8
|
+
addHooks(): void;
|
|
9
|
+
removeHooks(): void;
|
|
10
|
+
_onWheelScroll(e: any): void;
|
|
11
|
+
_performZoom(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Handler } from '../../core/Handler';
|
|
2
|
+
import { Point } from '../../geometry/Point';
|
|
3
|
+
export declare class TapHoldHandler extends Handler {
|
|
4
|
+
_holdTimeout?: ReturnType<typeof setTimeout>;
|
|
5
|
+
_startPos?: Point;
|
|
6
|
+
_newPos?: Point;
|
|
7
|
+
addHooks(): void;
|
|
8
|
+
removeHooks(): void;
|
|
9
|
+
_onDown(e: PointerEvent): void;
|
|
10
|
+
_cancelClickPrevent(): void;
|
|
11
|
+
_cancel(): void;
|
|
12
|
+
_onMove(e: PointerEvent): void;
|
|
13
|
+
_isTapValid(): boolean;
|
|
14
|
+
_simulateEvent(type: string, e: PointerEvent): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Handler } from '../../core/Handler';
|
|
2
|
+
// Two-finger parallel-vertical drag tilts the map. Disambiguated from
|
|
3
|
+
// rotate + zoom via simple thresholds: large |Δangle| → rotate, large
|
|
4
|
+
// |Δdistance| → zoom, otherwise if both fingers move together vertically
|
|
5
|
+
// we treat it as pitch.
|
|
6
|
+
export declare class TwoFingerPitchHandler extends Handler {
|
|
7
|
+
_pitching: boolean;
|
|
8
|
+
_moved: boolean;
|
|
9
|
+
_startY1: number;
|
|
10
|
+
_startY2: number;
|
|
11
|
+
_startX1: number;
|
|
12
|
+
_startX2: number;
|
|
13
|
+
_startPitch: number;
|
|
14
|
+
_startDist: number;
|
|
15
|
+
_animRequest?: number;
|
|
16
|
+
addHooks(): void;
|
|
17
|
+
removeHooks(): void;
|
|
18
|
+
_onPointerStart(_e: PointerEvent): void;
|
|
19
|
+
_onPointerMove(e: PointerEvent): void;
|
|
20
|
+
_onPointerEnd(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Handler } from '../../core/Handler';
|
|
2
|
+
// Rotates the map's bearing by the angular delta of a two-finger twist gesture.
|
|
3
|
+
// Shares the pointerdown channel with PinchZoomHandler; both apply their
|
|
4
|
+
// respective deltas in the same frame.
|
|
5
|
+
export declare class TwoFingerRotateHandler extends Handler {
|
|
6
|
+
_rotating: boolean;
|
|
7
|
+
_moved: boolean;
|
|
8
|
+
_startAngle: number;
|
|
9
|
+
_startBearing: number;
|
|
10
|
+
_pivot: { x: number, y: number };
|
|
11
|
+
_animRequest?: number;
|
|
12
|
+
addHooks(): void;
|
|
13
|
+
removeHooks(): void;
|
|
14
|
+
_onPointerStart(_e: PointerEvent): void;
|
|
15
|
+
_onPointerMove(e: PointerEvent): void;
|
|
16
|
+
_onPointerEnd(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { MapOptions } from './Map';
|
|
2
|
+
export { createMap, TsMap, Map } from './Map';
|
|
3
|
+
export { BoxZoomHandler } from './handler/BoxZoomHandler';
|
|
4
|
+
export { DoubleClickZoomHandler } from './handler/DoubleClickZoomHandler';
|
|
5
|
+
export { DragHandler } from './handler/DragHandler';
|
|
6
|
+
export { KeyboardHandler } from './handler/KeyboardHandler';
|
|
7
|
+
export { PinchZoomHandler } from './handler/PinchZoomHandler';
|
|
8
|
+
export { ScrollWheelZoomHandler } from './handler/ScrollWheelZoomHandler';
|
|
9
|
+
export { TapHoldHandler } from './handler/TapHoldHandler';
|
|
10
|
+
export { TwoFingerPitchHandler } from './handler/TwoFingerPitchHandler';
|
|
11
|
+
export { TwoFingerRotateHandler } from './handler/TwoFingerRotateHandler';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Pbf } from '../proto/Pbf';
|
|
2
|
+
import { VectorTileLayer } from './VectorTileLayer';
|
|
3
|
+
// Top-level MVT Tile message. Each tile contains one or more named Layers.
|
|
4
|
+
// The constructor walks the outer envelope; layer bodies are parsed eagerly
|
|
5
|
+
// into `VectorTileLayer` instances, but features inside a layer are lazy.
|
|
6
|
+
export declare class VectorTile {
|
|
7
|
+
layers: Record<string, VectorTileLayer>;
|
|
8
|
+
constructor(pbf: Pbf, end?: number);
|
|
9
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Point } from '../geometry/Point';
|
|
2
|
+
import type { Pbf } from '../proto/Pbf';
|
|
3
|
+
// MVT GeomType enum values (tile.proto).
|
|
4
|
+
export declare const MVT_GEOM_UNKNOWN: number;
|
|
5
|
+
export declare const MVT_GEOM_POINT: number;
|
|
6
|
+
export declare const MVT_GEOM_LINESTRING: number;
|
|
7
|
+
export declare const MVT_GEOM_POLYGON: number;
|
|
8
|
+
// Human-readable name table indexed by MVT GeomType enum value.
|
|
9
|
+
export declare const GEOM_TYPE_NAMES: GeomType[];
|
|
10
|
+
// GeoJSON output types (structural; we don't depend on @types/geojson to stay dep-free).
|
|
11
|
+
export declare interface GeoJSONPoint {
|
|
12
|
+
type: 'Point'
|
|
13
|
+
coordinates: [number, number]
|
|
14
|
+
}
|
|
15
|
+
export declare interface GeoJSONMultiPoint {
|
|
16
|
+
type: 'MultiPoint'
|
|
17
|
+
coordinates: [number, number][]
|
|
18
|
+
}
|
|
19
|
+
export declare interface GeoJSONLineString {
|
|
20
|
+
type: 'LineString'
|
|
21
|
+
coordinates: [number, number][]
|
|
22
|
+
}
|
|
23
|
+
export declare interface GeoJSONMultiLineString {
|
|
24
|
+
type: 'MultiLineString'
|
|
25
|
+
coordinates: [number, number][][]
|
|
26
|
+
}
|
|
27
|
+
export declare interface GeoJSONPolygon {
|
|
28
|
+
type: 'Polygon'
|
|
29
|
+
coordinates: [number, number][][]
|
|
30
|
+
}
|
|
31
|
+
export declare interface GeoJSONMultiPolygon {
|
|
32
|
+
type: 'MultiPolygon'
|
|
33
|
+
coordinates: [number, number][][][]
|
|
34
|
+
}
|
|
35
|
+
export declare interface GeoJSONFeature {
|
|
36
|
+
type: 'Feature'
|
|
37
|
+
id?: number
|
|
38
|
+
geometry: GeoJSONGeometry
|
|
39
|
+
properties: VectorTileProperties
|
|
40
|
+
}
|
|
41
|
+
export type GeomType = 'Unknown' | 'Point' | 'LineString' | 'Polygon';
|
|
42
|
+
export type VectorTileValue = string | number | boolean | null;
|
|
43
|
+
export type VectorTileProperties = Record<string, VectorTileValue>;
|
|
44
|
+
export type GeoJSONGeometry = | GeoJSONPoint
|
|
45
|
+
| GeoJSONMultiPoint
|
|
46
|
+
| GeoJSONLineString
|
|
47
|
+
| GeoJSONMultiLineString
|
|
48
|
+
| GeoJSONPolygon
|
|
49
|
+
| GeoJSONMultiPolygon;
|
|
50
|
+
export declare class VectorTileFeature {
|
|
51
|
+
id?: number;
|
|
52
|
+
type: 1 | 2 | 3;
|
|
53
|
+
extent: number;
|
|
54
|
+
properties: VectorTileProperties;
|
|
55
|
+
constructor(pbf: Pbf, end: number, extent: number, keys: string[], values: VectorTileValue[]);
|
|
56
|
+
loadGeometry(): Point[][];
|
|
57
|
+
bbox(): [number, number, number, number];
|
|
58
|
+
toGeoJSON(x: number, y: number, z: number): GeoJSONFeature;
|
|
59
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Pbf } from '../proto/Pbf';
|
|
2
|
+
import { VectorTileFeature } from './VectorTileFeature';
|
|
3
|
+
// Lazy-decoded MVT Layer message. Construction only scans the outer frame
|
|
4
|
+
// and records byte offsets for each Feature (tag 2) — individual features
|
|
5
|
+
// are materialized on demand by `.feature(i)`.
|
|
6
|
+
export declare class VectorTileLayer {
|
|
7
|
+
version: number;
|
|
8
|
+
name: string;
|
|
9
|
+
extent: number;
|
|
10
|
+
length: number;
|
|
11
|
+
constructor(pbf: Pbf, end?: number);
|
|
12
|
+
feature(i: number): VectorTileFeature;
|
|
13
|
+
}
|