ts-maps 0.2.7 → 0.3.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/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 +18 -0
- package/dist/core-map/layer/LayerGroup.d.ts +16 -0
- package/dist/core-map/layer/Popup.d.ts +18 -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 +353 -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 +18414 -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,375 @@
|
|
|
1
|
+
// ---------- transition ----------
|
|
2
|
+
export declare interface TransitionSpecification {
|
|
3
|
+
duration?: number
|
|
4
|
+
delay?: number
|
|
5
|
+
}
|
|
6
|
+
// ---------- light ----------
|
|
7
|
+
export declare interface LightSpecification {
|
|
8
|
+
anchor?: PropertyValueSpecification<'map' | 'viewport'>
|
|
9
|
+
position?: PropertyValueSpecification<[number, number, number]>
|
|
10
|
+
color?: PropertyValueSpecification<ColorSpecification>
|
|
11
|
+
intensity?: PropertyValueSpecification<number>
|
|
12
|
+
}
|
|
13
|
+
// ---------- sprite ----------
|
|
14
|
+
export declare interface SpriteSource {
|
|
15
|
+
id: string
|
|
16
|
+
url: string
|
|
17
|
+
}
|
|
18
|
+
export declare interface VectorSourceSpecification {
|
|
19
|
+
type: 'vector'
|
|
20
|
+
url?: string
|
|
21
|
+
tiles?: string[]
|
|
22
|
+
bounds?: [number, number, number, number]
|
|
23
|
+
scheme?: 'xyz' | 'tms'
|
|
24
|
+
minzoom?: number
|
|
25
|
+
maxzoom?: number
|
|
26
|
+
attribution?: string
|
|
27
|
+
promoteId?: PromoteIdSpecification
|
|
28
|
+
volatile?: boolean
|
|
29
|
+
}
|
|
30
|
+
export declare interface RasterSourceSpecification {
|
|
31
|
+
type: 'raster'
|
|
32
|
+
url?: string
|
|
33
|
+
tiles?: string[]
|
|
34
|
+
bounds?: [number, number, number, number]
|
|
35
|
+
minzoom?: number
|
|
36
|
+
maxzoom?: number
|
|
37
|
+
tileSize?: number
|
|
38
|
+
scheme?: 'xyz' | 'tms'
|
|
39
|
+
attribution?: string
|
|
40
|
+
volatile?: boolean
|
|
41
|
+
}
|
|
42
|
+
export declare interface RasterDEMSourceSpecification {
|
|
43
|
+
type: 'raster-dem'
|
|
44
|
+
url?: string
|
|
45
|
+
tiles?: string[]
|
|
46
|
+
bounds?: [number, number, number, number]
|
|
47
|
+
minzoom?: number
|
|
48
|
+
maxzoom?: number
|
|
49
|
+
tileSize?: number
|
|
50
|
+
attribution?: string
|
|
51
|
+
encoding?: 'terrarium' | 'mapbox' | 'custom'
|
|
52
|
+
redFactor?: number
|
|
53
|
+
blueFactor?: number
|
|
54
|
+
greenFactor?: number
|
|
55
|
+
baseShift?: number
|
|
56
|
+
volatile?: boolean
|
|
57
|
+
}
|
|
58
|
+
export declare interface GeoJSONSourceSpecification {
|
|
59
|
+
type: 'geojson'
|
|
60
|
+
data?: unknown
|
|
61
|
+
maxzoom?: number
|
|
62
|
+
attribution?: string
|
|
63
|
+
buffer?: number
|
|
64
|
+
filter?: unknown
|
|
65
|
+
tolerance?: number
|
|
66
|
+
cluster?: boolean
|
|
67
|
+
clusterRadius?: number
|
|
68
|
+
clusterMaxZoom?: number
|
|
69
|
+
clusterMinPoints?: number
|
|
70
|
+
clusterProperties?: Record<string, unknown>
|
|
71
|
+
lineMetrics?: boolean
|
|
72
|
+
generateId?: boolean
|
|
73
|
+
promoteId?: PromoteIdSpecification
|
|
74
|
+
}
|
|
75
|
+
// ---------- background ----------
|
|
76
|
+
export declare interface BackgroundPaintSpecification {
|
|
77
|
+
'background-color'?: PropertyValueSpecification<ColorSpecification>
|
|
78
|
+
'background-opacity'?: PropertyValueSpecification<number>
|
|
79
|
+
'background-pattern'?: PropertyValueSpecification<ResolvedImageSpecification>
|
|
80
|
+
}
|
|
81
|
+
export declare interface BackgroundLayoutSpecification {
|
|
82
|
+
visibility?: 'visible' | 'none'
|
|
83
|
+
}
|
|
84
|
+
export declare interface BackgroundLayerSpecification {
|
|
85
|
+
id: string
|
|
86
|
+
type: 'background'
|
|
87
|
+
metadata?: Record<string, unknown>
|
|
88
|
+
minzoom?: number
|
|
89
|
+
maxzoom?: number
|
|
90
|
+
layout?: BackgroundLayoutSpecification
|
|
91
|
+
paint?: BackgroundPaintSpecification
|
|
92
|
+
}
|
|
93
|
+
// ---------- fill ----------
|
|
94
|
+
export declare interface FillPaintSpecification {
|
|
95
|
+
'fill-antialias'?: PropertyValueSpecification<boolean>
|
|
96
|
+
'fill-color'?: PropertyValueSpecification<ColorSpecification>
|
|
97
|
+
'fill-opacity'?: PropertyValueSpecification<number>
|
|
98
|
+
'fill-outline-color'?: PropertyValueSpecification<ColorSpecification>
|
|
99
|
+
'fill-pattern'?: PropertyValueSpecification<ResolvedImageSpecification>
|
|
100
|
+
'fill-translate'?: PropertyValueSpecification<[number, number]>
|
|
101
|
+
'fill-translate-anchor'?: PropertyValueSpecification<'map' | 'viewport'>
|
|
102
|
+
}
|
|
103
|
+
export declare interface FillLayoutSpecification {
|
|
104
|
+
visibility?: 'visible' | 'none'
|
|
105
|
+
'fill-sort-key'?: PropertyValueSpecification<number>
|
|
106
|
+
}
|
|
107
|
+
export declare interface FillLayerSpecification {
|
|
108
|
+
id: string
|
|
109
|
+
type: 'fill'
|
|
110
|
+
metadata?: Record<string, unknown>
|
|
111
|
+
source: string
|
|
112
|
+
'source-layer'?: string
|
|
113
|
+
minzoom?: number
|
|
114
|
+
maxzoom?: number
|
|
115
|
+
filter?: FilterSpecification
|
|
116
|
+
layout?: FillLayoutSpecification
|
|
117
|
+
paint?: FillPaintSpecification
|
|
118
|
+
}
|
|
119
|
+
// ---------- fill-extrusion ----------
|
|
120
|
+
export declare interface FillExtrusionPaintSpecification {
|
|
121
|
+
'fill-extrusion-opacity'?: PropertyValueSpecification<number>
|
|
122
|
+
'fill-extrusion-color'?: PropertyValueSpecification<ColorSpecification>
|
|
123
|
+
'fill-extrusion-translate'?: PropertyValueSpecification<[number, number]>
|
|
124
|
+
'fill-extrusion-translate-anchor'?: PropertyValueSpecification<'map' | 'viewport'>
|
|
125
|
+
'fill-extrusion-pattern'?: PropertyValueSpecification<ResolvedImageSpecification>
|
|
126
|
+
'fill-extrusion-height'?: PropertyValueSpecification<number>
|
|
127
|
+
'fill-extrusion-base'?: PropertyValueSpecification<number>
|
|
128
|
+
'fill-extrusion-vertical-gradient'?: PropertyValueSpecification<boolean>
|
|
129
|
+
}
|
|
130
|
+
export declare interface FillExtrusionLayoutSpecification {
|
|
131
|
+
visibility?: 'visible' | 'none'
|
|
132
|
+
}
|
|
133
|
+
export declare interface FillExtrusionLayerSpecification {
|
|
134
|
+
id: string
|
|
135
|
+
type: 'fill-extrusion'
|
|
136
|
+
metadata?: Record<string, unknown>
|
|
137
|
+
source: string
|
|
138
|
+
'source-layer'?: string
|
|
139
|
+
minzoom?: number
|
|
140
|
+
maxzoom?: number
|
|
141
|
+
filter?: FilterSpecification
|
|
142
|
+
layout?: FillExtrusionLayoutSpecification
|
|
143
|
+
paint?: FillExtrusionPaintSpecification
|
|
144
|
+
}
|
|
145
|
+
// ---------- line ----------
|
|
146
|
+
export declare interface LinePaintSpecification {
|
|
147
|
+
'line-opacity'?: PropertyValueSpecification<number>
|
|
148
|
+
'line-color'?: PropertyValueSpecification<ColorSpecification>
|
|
149
|
+
'line-translate'?: PropertyValueSpecification<[number, number]>
|
|
150
|
+
'line-translate-anchor'?: PropertyValueSpecification<'map' | 'viewport'>
|
|
151
|
+
'line-width'?: PropertyValueSpecification<number>
|
|
152
|
+
'line-gap-width'?: PropertyValueSpecification<number>
|
|
153
|
+
'line-offset'?: PropertyValueSpecification<number>
|
|
154
|
+
'line-blur'?: PropertyValueSpecification<number>
|
|
155
|
+
'line-dasharray'?: PropertyValueSpecification<number[]>
|
|
156
|
+
'line-pattern'?: PropertyValueSpecification<ResolvedImageSpecification>
|
|
157
|
+
'line-gradient'?: PropertyValueSpecification<ColorSpecification>
|
|
158
|
+
}
|
|
159
|
+
export declare interface LineLayoutSpecification {
|
|
160
|
+
visibility?: 'visible' | 'none'
|
|
161
|
+
'line-cap'?: PropertyValueSpecification<'butt' | 'round' | 'square'>
|
|
162
|
+
'line-join'?: PropertyValueSpecification<'bevel' | 'round' | 'miter'>
|
|
163
|
+
'line-miter-limit'?: PropertyValueSpecification<number>
|
|
164
|
+
'line-round-limit'?: PropertyValueSpecification<number>
|
|
165
|
+
'line-sort-key'?: PropertyValueSpecification<number>
|
|
166
|
+
}
|
|
167
|
+
export declare interface LineLayerSpecification {
|
|
168
|
+
id: string
|
|
169
|
+
type: 'line'
|
|
170
|
+
metadata?: Record<string, unknown>
|
|
171
|
+
source: string
|
|
172
|
+
'source-layer'?: string
|
|
173
|
+
minzoom?: number
|
|
174
|
+
maxzoom?: number
|
|
175
|
+
filter?: FilterSpecification
|
|
176
|
+
layout?: LineLayoutSpecification
|
|
177
|
+
paint?: LinePaintSpecification
|
|
178
|
+
}
|
|
179
|
+
// ---------- circle ----------
|
|
180
|
+
export declare interface CirclePaintSpecification {
|
|
181
|
+
'circle-radius'?: PropertyValueSpecification<number>
|
|
182
|
+
'circle-color'?: PropertyValueSpecification<ColorSpecification>
|
|
183
|
+
'circle-blur'?: PropertyValueSpecification<number>
|
|
184
|
+
'circle-opacity'?: PropertyValueSpecification<number>
|
|
185
|
+
'circle-translate'?: PropertyValueSpecification<[number, number]>
|
|
186
|
+
'circle-translate-anchor'?: PropertyValueSpecification<'map' | 'viewport'>
|
|
187
|
+
'circle-pitch-scale'?: PropertyValueSpecification<'map' | 'viewport'>
|
|
188
|
+
'circle-pitch-alignment'?: PropertyValueSpecification<'map' | 'viewport'>
|
|
189
|
+
'circle-stroke-width'?: PropertyValueSpecification<number>
|
|
190
|
+
'circle-stroke-color'?: PropertyValueSpecification<ColorSpecification>
|
|
191
|
+
'circle-stroke-opacity'?: PropertyValueSpecification<number>
|
|
192
|
+
}
|
|
193
|
+
export declare interface CircleLayoutSpecification {
|
|
194
|
+
visibility?: 'visible' | 'none'
|
|
195
|
+
'circle-sort-key'?: PropertyValueSpecification<number>
|
|
196
|
+
}
|
|
197
|
+
export declare interface CircleLayerSpecification {
|
|
198
|
+
id: string
|
|
199
|
+
type: 'circle'
|
|
200
|
+
metadata?: Record<string, unknown>
|
|
201
|
+
source: string
|
|
202
|
+
'source-layer'?: string
|
|
203
|
+
minzoom?: number
|
|
204
|
+
maxzoom?: number
|
|
205
|
+
filter?: FilterSpecification
|
|
206
|
+
layout?: CircleLayoutSpecification
|
|
207
|
+
paint?: CirclePaintSpecification
|
|
208
|
+
}
|
|
209
|
+
// ---------- symbol ----------
|
|
210
|
+
export declare interface SymbolPaintSpecification {
|
|
211
|
+
'icon-opacity'?: PropertyValueSpecification<number>
|
|
212
|
+
'icon-color'?: PropertyValueSpecification<ColorSpecification>
|
|
213
|
+
'icon-halo-color'?: PropertyValueSpecification<ColorSpecification>
|
|
214
|
+
'icon-halo-width'?: PropertyValueSpecification<number>
|
|
215
|
+
'icon-halo-blur'?: PropertyValueSpecification<number>
|
|
216
|
+
'icon-translate'?: PropertyValueSpecification<[number, number]>
|
|
217
|
+
'icon-translate-anchor'?: PropertyValueSpecification<'map' | 'viewport'>
|
|
218
|
+
'text-opacity'?: PropertyValueSpecification<number>
|
|
219
|
+
'text-color'?: PropertyValueSpecification<ColorSpecification>
|
|
220
|
+
'text-halo-color'?: PropertyValueSpecification<ColorSpecification>
|
|
221
|
+
'text-halo-width'?: PropertyValueSpecification<number>
|
|
222
|
+
'text-halo-blur'?: PropertyValueSpecification<number>
|
|
223
|
+
'text-translate'?: PropertyValueSpecification<[number, number]>
|
|
224
|
+
'text-translate-anchor'?: PropertyValueSpecification<'map' | 'viewport'>
|
|
225
|
+
}
|
|
226
|
+
export declare interface SymbolLayoutSpecification {
|
|
227
|
+
visibility?: 'visible' | 'none'
|
|
228
|
+
'symbol-placement'?: PropertyValueSpecification<'point' | 'line' | 'line-center'>
|
|
229
|
+
'symbol-spacing'?: PropertyValueSpecification<number>
|
|
230
|
+
'symbol-avoid-edges'?: PropertyValueSpecification<boolean>
|
|
231
|
+
'symbol-sort-key'?: PropertyValueSpecification<number>
|
|
232
|
+
'symbol-z-order'?: PropertyValueSpecification<'auto' | 'viewport-y' | 'source'>
|
|
233
|
+
'icon-allow-overlap'?: PropertyValueSpecification<boolean>
|
|
234
|
+
'icon-ignore-placement'?: PropertyValueSpecification<boolean>
|
|
235
|
+
'icon-optional'?: PropertyValueSpecification<boolean>
|
|
236
|
+
'icon-rotation-alignment'?: PropertyValueSpecification<'map' | 'viewport' | 'auto'>
|
|
237
|
+
'icon-size'?: PropertyValueSpecification<number>
|
|
238
|
+
'icon-text-fit'?: PropertyValueSpecification<'none' | 'width' | 'height' | 'both'>
|
|
239
|
+
'icon-text-fit-padding'?: PropertyValueSpecification<[number, number, number, number]>
|
|
240
|
+
'icon-image'?: PropertyValueSpecification<ResolvedImageSpecification>
|
|
241
|
+
'icon-rotate'?: PropertyValueSpecification<number>
|
|
242
|
+
'icon-padding'?: PropertyValueSpecification<PaddingSpecification>
|
|
243
|
+
'icon-keep-upright'?: PropertyValueSpecification<boolean>
|
|
244
|
+
'icon-offset'?: PropertyValueSpecification<[number, number]>
|
|
245
|
+
'icon-anchor'?: PropertyValueSpecification<
|
|
246
|
+
'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
247
|
+
>
|
|
248
|
+
'icon-pitch-alignment'?: PropertyValueSpecification<'map' | 'viewport' | 'auto'>
|
|
249
|
+
'text-pitch-alignment'?: PropertyValueSpecification<'map' | 'viewport' | 'auto'>
|
|
250
|
+
'text-rotation-alignment'?: PropertyValueSpecification<'map' | 'viewport' | 'auto'>
|
|
251
|
+
'text-field'?: PropertyValueSpecification<FormattedSpecification>
|
|
252
|
+
'text-font'?: PropertyValueSpecification<string[]>
|
|
253
|
+
'text-size'?: PropertyValueSpecification<number>
|
|
254
|
+
'text-max-width'?: PropertyValueSpecification<number>
|
|
255
|
+
'text-line-height'?: PropertyValueSpecification<number>
|
|
256
|
+
'text-letter-spacing'?: PropertyValueSpecification<number>
|
|
257
|
+
'text-justify'?: PropertyValueSpecification<'auto' | 'left' | 'center' | 'right'>
|
|
258
|
+
'text-radial-offset'?: PropertyValueSpecification<number>
|
|
259
|
+
'text-variable-anchor'?: PropertyValueSpecification<string[]>
|
|
260
|
+
'text-anchor'?: PropertyValueSpecification<
|
|
261
|
+
'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
262
|
+
>
|
|
263
|
+
'text-max-angle'?: PropertyValueSpecification<number>
|
|
264
|
+
'text-writing-mode'?: PropertyValueSpecification<string[]>
|
|
265
|
+
'text-rotate'?: PropertyValueSpecification<number>
|
|
266
|
+
'text-padding'?: PropertyValueSpecification<number>
|
|
267
|
+
'text-keep-upright'?: PropertyValueSpecification<boolean>
|
|
268
|
+
'text-transform'?: PropertyValueSpecification<'none' | 'uppercase' | 'lowercase'>
|
|
269
|
+
'text-offset'?: PropertyValueSpecification<[number, number]>
|
|
270
|
+
'text-allow-overlap'?: PropertyValueSpecification<boolean>
|
|
271
|
+
'text-ignore-placement'?: PropertyValueSpecification<boolean>
|
|
272
|
+
'text-optional'?: PropertyValueSpecification<boolean>
|
|
273
|
+
}
|
|
274
|
+
export declare interface SymbolLayerSpecification {
|
|
275
|
+
id: string
|
|
276
|
+
type: 'symbol'
|
|
277
|
+
metadata?: Record<string, unknown>
|
|
278
|
+
source: string
|
|
279
|
+
'source-layer'?: string
|
|
280
|
+
minzoom?: number
|
|
281
|
+
maxzoom?: number
|
|
282
|
+
filter?: FilterSpecification
|
|
283
|
+
layout?: SymbolLayoutSpecification
|
|
284
|
+
paint?: SymbolPaintSpecification
|
|
285
|
+
}
|
|
286
|
+
// ---------- raster ----------
|
|
287
|
+
export declare interface RasterPaintSpecification {
|
|
288
|
+
'raster-opacity'?: PropertyValueSpecification<number>
|
|
289
|
+
'raster-hue-rotate'?: PropertyValueSpecification<number>
|
|
290
|
+
'raster-brightness-min'?: PropertyValueSpecification<number>
|
|
291
|
+
'raster-brightness-max'?: PropertyValueSpecification<number>
|
|
292
|
+
'raster-saturation'?: PropertyValueSpecification<number>
|
|
293
|
+
'raster-contrast'?: PropertyValueSpecification<number>
|
|
294
|
+
'raster-resampling'?: PropertyValueSpecification<'linear' | 'nearest'>
|
|
295
|
+
'raster-fade-duration'?: PropertyValueSpecification<number>
|
|
296
|
+
}
|
|
297
|
+
export declare interface RasterLayoutSpecification {
|
|
298
|
+
visibility?: 'visible' | 'none'
|
|
299
|
+
}
|
|
300
|
+
export declare interface RasterLayerSpecification {
|
|
301
|
+
id: string
|
|
302
|
+
type: 'raster'
|
|
303
|
+
metadata?: Record<string, unknown>
|
|
304
|
+
source: string
|
|
305
|
+
'source-layer'?: string
|
|
306
|
+
minzoom?: number
|
|
307
|
+
maxzoom?: number
|
|
308
|
+
layout?: RasterLayoutSpecification
|
|
309
|
+
paint?: RasterPaintSpecification
|
|
310
|
+
}
|
|
311
|
+
// ---------- root style ----------
|
|
312
|
+
export declare interface Style {
|
|
313
|
+
version: 8
|
|
314
|
+
name?: string
|
|
315
|
+
metadata?: Record<string, unknown>
|
|
316
|
+
center?: [number, number]
|
|
317
|
+
zoom?: number
|
|
318
|
+
bearing?: number
|
|
319
|
+
pitch?: number
|
|
320
|
+
light?: LightSpecification
|
|
321
|
+
sources: Record<string, SourceSpecification>
|
|
322
|
+
sprite?: string | SpriteSource[]
|
|
323
|
+
glyphs?: string
|
|
324
|
+
transition?: TransitionSpecification
|
|
325
|
+
layers: LayerSpecification[]
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Style Specification — in-house TypeScript implementation of a subset of the
|
|
329
|
+
* Mapbox GL Style Specification (BSD-3-Clause). Independent rewrite; not a
|
|
330
|
+
* copy. Upstream reference: https://github.com/mapbox/mapbox-gl-style-spec
|
|
331
|
+
*/
|
|
332
|
+
// ---------- expressions ----------
|
|
333
|
+
//
|
|
334
|
+
// Expressions are the lambda-calculus-ish DSL used to make paint/layout
|
|
335
|
+
// properties data-driven. The parser + evaluator live under
|
|
336
|
+
// `./expressions/`; here we just declare the spec shape — an array whose
|
|
337
|
+
// first element is the operator name.
|
|
338
|
+
export type ExpressionSpecification = unknown[];
|
|
339
|
+
// A paint/layout property value is either a literal of the declared type
|
|
340
|
+
// or an expression that produces one.
|
|
341
|
+
export type PropertyValueSpecification<T> = T | ExpressionSpecification;
|
|
342
|
+
// ---------- common scalar shapes ----------
|
|
343
|
+
export type ColorSpecification = string;
|
|
344
|
+
export type FormattedSpecification = string | ExpressionSpecification;
|
|
345
|
+
export type ResolvedImageSpecification = string | ExpressionSpecification;
|
|
346
|
+
export type PaddingSpecification = number | [number, number] | [number, number, number, number];
|
|
347
|
+
// ---------- sources ----------
|
|
348
|
+
export type PromoteIdSpecification = string | Record<string, string>;
|
|
349
|
+
export type SourceSpecification = | VectorSourceSpecification
|
|
350
|
+
| RasterSourceSpecification
|
|
351
|
+
| RasterDEMSourceSpecification
|
|
352
|
+
| GeoJSONSourceSpecification;
|
|
353
|
+
// ---------- filter ----------
|
|
354
|
+
export type FilterSpecification = ExpressionSpecification | unknown[];
|
|
355
|
+
// ---------- layer types ----------
|
|
356
|
+
export type LayerType = | 'background'
|
|
357
|
+
| 'fill'
|
|
358
|
+
| 'fill-extrusion'
|
|
359
|
+
| 'line'
|
|
360
|
+
| 'circle'
|
|
361
|
+
| 'symbol'
|
|
362
|
+
| 'raster';
|
|
363
|
+
// ---------- layer union ----------
|
|
364
|
+
//
|
|
365
|
+
// Note: `hillshade` and `heatmap` Mapbox layer types are NOT part of the
|
|
366
|
+
// style-spec union because the runtime doesn't render them through the
|
|
367
|
+
// style-spec path. Use `HillshadeLayer` (`RasterDEMLayer`) and
|
|
368
|
+
// `HeatmapLayer` as ordinary layer instances via `layer.addTo(map)`.
|
|
369
|
+
export type LayerSpecification = | BackgroundLayerSpecification
|
|
370
|
+
| FillLayerSpecification
|
|
371
|
+
| FillExtrusionLayerSpecification
|
|
372
|
+
| LineLayerSpecification
|
|
373
|
+
| CircleLayerSpecification
|
|
374
|
+
| SymbolLayerSpecification
|
|
375
|
+
| RasterLayerSpecification;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LayerType, SourceSpecification } from './types';
|
|
2
|
+
export declare function validatePaintProperty(layerType: LayerType, name: string, value: unknown): ValidationError[];
|
|
3
|
+
export declare function validateLayoutProperty(layerType: LayerType, name: string, value: unknown): ValidationError[];
|
|
4
|
+
// ---------- source validation ----------
|
|
5
|
+
export declare function validateSource(source: unknown, id?: string): ValidationError[];
|
|
6
|
+
// ---------- layer validation ----------
|
|
7
|
+
export declare function validateLayer(layer: unknown, sources?: Record<string, SourceSpecification>): ValidationError[];
|
|
8
|
+
// ---------- root style validation ----------
|
|
9
|
+
export declare function validateStyle(style: unknown): ValidationError[];
|
|
10
|
+
export declare interface ValidationError {
|
|
11
|
+
message: string
|
|
12
|
+
line?: number
|
|
13
|
+
path?: string[]
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// CollisionIndex — uniform grid collision detector for symbol placement.
|
|
2
|
+
// Each inserted box is bucketed into every cell it overlaps; `tryInsert`
|
|
3
|
+
// rejects when a colliding neighbour has priority >= the new box's.
|
|
4
|
+
export declare interface CollisionBox {
|
|
5
|
+
minX: number
|
|
6
|
+
minY: number
|
|
7
|
+
maxX: number
|
|
8
|
+
maxY: number
|
|
9
|
+
priority?: number
|
|
10
|
+
}
|
|
11
|
+
export declare interface CollisionIndexOptions {
|
|
12
|
+
width: number
|
|
13
|
+
height: number
|
|
14
|
+
cellSize?: number
|
|
15
|
+
}
|
|
16
|
+
export declare class CollisionIndex {
|
|
17
|
+
constructor(opts?: CollisionIndexOptions);
|
|
18
|
+
tryInsert(box: CollisionBox): boolean;
|
|
19
|
+
insert(box: CollisionBox): void;
|
|
20
|
+
clear(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// GlyphAtlas — rasterises font glyphs to a single backing canvas and packs
|
|
2
|
+
// them via a simple shelf-packer. Each glyph gets an approximate signed
|
|
3
|
+
// distance field generated by a cheap 2-pass Chamfer 3-4 scan so callers can
|
|
4
|
+
// resample the atlas at any target size with tolerably smooth edges.
|
|
5
|
+
//
|
|
6
|
+
// Zero runtime deps. Designed to live alongside Canvas2D rendering today and
|
|
7
|
+
// graduate to WebGL sampling later without changing the public API.
|
|
8
|
+
export declare interface GlyphMetrics {
|
|
9
|
+
codePoint: number
|
|
10
|
+
x: number
|
|
11
|
+
y: number
|
|
12
|
+
width: number
|
|
13
|
+
height: number
|
|
14
|
+
advance: number
|
|
15
|
+
bearingX: number
|
|
16
|
+
bearingY: number
|
|
17
|
+
}
|
|
18
|
+
export declare interface GlyphAtlasOptions {
|
|
19
|
+
fontFamily?: string
|
|
20
|
+
fontSize?: number
|
|
21
|
+
padding?: number
|
|
22
|
+
bucketSize?: number
|
|
23
|
+
}
|
|
24
|
+
export declare class GlyphAtlas {
|
|
25
|
+
canvas: HTMLCanvasElement;
|
|
26
|
+
constructor(opts?: GlyphAtlasOptions);
|
|
27
|
+
getOrAddGlyph(codePoint: number, style?: { italic?: boolean, bold?: boolean }): GlyphMetrics;
|
|
28
|
+
measure(text: string, style?: { italic?: boolean, bold?: boolean }): { width: number, height: number };
|
|
29
|
+
drawText(ctx: CanvasRenderingContext2D, text: string, x: number, y: number, options: {
|
|
30
|
+
color: string
|
|
31
|
+
haloColor?: string
|
|
32
|
+
haloWidth?: number
|
|
33
|
+
size: number
|
|
34
|
+
italic?: boolean
|
|
35
|
+
bold?: boolean
|
|
36
|
+
}): void;
|
|
37
|
+
_buildSDF(imageData: ImageData): ImageData;
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// IconAtlas — packs caller-supplied sprite entries into a single canvas.
|
|
2
|
+
// Sprite pixel data may come from an HTMLImageElement, an HTMLCanvasElement,
|
|
3
|
+
// or a raw ImageData buffer; callers keep ownership of the source bitmap.
|
|
4
|
+
export declare interface SpriteEntry {
|
|
5
|
+
id: string
|
|
6
|
+
x: number
|
|
7
|
+
y: number
|
|
8
|
+
width: number
|
|
9
|
+
height: number
|
|
10
|
+
pixelRatio?: number
|
|
11
|
+
}
|
|
12
|
+
export declare class IconAtlas {
|
|
13
|
+
canvas: HTMLCanvasElement;
|
|
14
|
+
constructor();
|
|
15
|
+
addSprite(entry: SpriteEntry, source: HTMLImageElement | HTMLCanvasElement | ImageData): void;
|
|
16
|
+
get(id: string): SpriteEntry | undefined;
|
|
17
|
+
drawIcon(ctx: CanvasRenderingContext2D, id: string, dx: number, dy: number, opts?: { size?: number, rotation?: number }): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { CollisionBox, CollisionIndexOptions } from './CollisionIndex';
|
|
2
|
+
export type { GlyphAtlasOptions, GlyphMetrics } from './GlyphAtlas';
|
|
3
|
+
export type { SpriteEntry } from './IconAtlas';
|
|
4
|
+
export { CollisionIndex } from './CollisionIndex';
|
|
5
|
+
export { GlyphAtlas } from './GlyphAtlas';
|
|
6
|
+
export { IconAtlas } from './IconAtlas';
|