@react-x11/components 0.4.0 → 0.6.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/README.md +143 -8
- package/dist/charts/components.d.ts +3 -1
- package/dist/charts/components.d.ts.map +1 -1
- package/dist/charts/components.js +8 -4
- package/dist/charts/components.js.map +1 -1
- package/dist/charts/node.d.ts +13 -6
- package/dist/charts/node.d.ts.map +1 -1
- package/dist/charts/node.js +75 -24
- package/dist/charts/node.js.map +1 -1
- package/dist/charts/render.d.ts +4 -0
- package/dist/charts/render.d.ts.map +1 -1
- package/dist/charts/render.js +11 -6
- package/dist/charts/render.js.map +1 -1
- package/dist/code-editor/node.d.ts +47 -16
- package/dist/code-editor/node.d.ts.map +1 -1
- package/dist/code-editor/node.js +121 -51
- package/dist/code-editor/node.js.map +1 -1
- package/dist/flow/draw.d.ts +19 -1
- package/dist/flow/draw.d.ts.map +1 -1
- package/dist/flow/draw.js +64 -35
- package/dist/flow/draw.js.map +1 -1
- package/dist/flow/index.d.ts.map +1 -1
- package/dist/flow/index.js +24 -8
- package/dist/flow/index.js.map +1 -1
- package/dist/flow/model.d.ts +4 -2
- package/dist/flow/model.d.ts.map +1 -1
- package/dist/flow/model.js +4 -2
- package/dist/flow/model.js.map +1 -1
- package/dist/flow/node.d.ts +40 -9
- package/dist/flow/node.d.ts.map +1 -1
- package/dist/flow/node.js +142 -53
- package/dist/flow/node.js.map +1 -1
- package/dist/flow/types.d.ts +46 -21
- package/dist/flow/types.d.ts.map +1 -1
- package/dist/formula/index.d.ts +4 -2
- package/dist/formula/index.d.ts.map +1 -1
- package/dist/formula/index.js.map +1 -1
- package/dist/formula/node.d.ts +5 -1
- package/dist/formula/node.d.ts.map +1 -1
- package/dist/formula/node.js +19 -3
- package/dist/formula/node.js.map +1 -1
- package/dist/html/controls.d.ts +4 -1
- package/dist/html/controls.d.ts.map +1 -1
- package/dist/html/controls.js.map +1 -1
- package/dist/html/css/cascade.d.ts +11 -5
- package/dist/html/css/cascade.d.ts.map +1 -1
- package/dist/html/css/cascade.js +18 -8
- package/dist/html/css/cascade.js.map +1 -1
- package/dist/html/css/parse.d.ts +15 -10
- package/dist/html/css/parse.d.ts.map +1 -1
- package/dist/html/css/parse.js +41 -16
- package/dist/html/css/parse.js.map +1 -1
- package/dist/html/css/style.d.ts +3 -0
- package/dist/html/css/style.d.ts.map +1 -1
- package/dist/html/css/style.js +3 -1
- package/dist/html/css/style.js.map +1 -1
- package/dist/html/css/values.d.ts +14 -1
- package/dist/html/css/values.d.ts.map +1 -1
- package/dist/html/css/values.js +11 -8
- package/dist/html/css/values.js.map +1 -1
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +1 -0
- package/dist/html/index.js.map +1 -1
- package/dist/html/layout/boxes.d.ts +12 -5
- package/dist/html/layout/boxes.d.ts.map +1 -1
- package/dist/html/layout/boxes.js +7 -4
- package/dist/html/layout/boxes.js.map +1 -1
- package/dist/html/layout/inline.d.ts.map +1 -1
- package/dist/html/layout/inline.js +22 -1
- package/dist/html/layout/inline.js.map +1 -1
- package/dist/html/node.d.ts +22 -8
- package/dist/html/node.d.ts.map +1 -1
- package/dist/html/node.js +97 -15
- package/dist/html/node.js.map +1 -1
- package/dist/html/paint.d.ts +3 -0
- package/dist/html/paint.d.ts.map +1 -1
- package/dist/html/paint.js +2 -2
- package/dist/html/paint.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/maps/clip.d.ts +43 -0
- package/dist/maps/clip.d.ts.map +1 -0
- package/dist/maps/clip.js +171 -0
- package/dist/maps/clip.js.map +1 -0
- package/dist/maps/gzip.d.ts +15 -0
- package/dist/maps/gzip.d.ts.map +1 -0
- package/dist/maps/gzip.js +56 -0
- package/dist/maps/gzip.js.map +1 -0
- package/dist/maps/index.d.ts +55 -0
- package/dist/maps/index.d.ts.map +1 -0
- package/dist/maps/index.js +141 -0
- package/dist/maps/index.js.map +1 -0
- package/dist/maps/labels.d.ts +123 -0
- package/dist/maps/labels.d.ts.map +1 -0
- package/dist/maps/labels.js +323 -0
- package/dist/maps/labels.js.map +1 -0
- package/dist/maps/mvt.d.ts +244 -0
- package/dist/maps/mvt.d.ts.map +1 -0
- package/dist/maps/mvt.js +820 -0
- package/dist/maps/mvt.js.map +1 -0
- package/dist/maps/node.d.ts +278 -0
- package/dist/maps/node.d.ts.map +1 -0
- package/dist/maps/node.js +1459 -0
- package/dist/maps/node.js.map +1 -0
- package/dist/maps/overlay.d.ts +157 -0
- package/dist/maps/overlay.d.ts.map +1 -0
- package/dist/maps/overlay.js +472 -0
- package/dist/maps/overlay.js.map +1 -0
- package/dist/maps/paint.d.ts +226 -0
- package/dist/maps/paint.d.ts.map +1 -0
- package/dist/maps/paint.js +705 -0
- package/dist/maps/paint.js.map +1 -0
- package/dist/maps/proj.d.ts +281 -0
- package/dist/maps/proj.d.ts.map +1 -0
- package/dist/maps/proj.js +451 -0
- package/dist/maps/proj.js.map +1 -0
- package/dist/maps/sources.d.ts +256 -0
- package/dist/maps/sources.d.ts.map +1 -0
- package/dist/maps/sources.js +210 -0
- package/dist/maps/sources.js.map +1 -0
- package/dist/maps/style.d.ts +141 -0
- package/dist/maps/style.d.ts.map +1 -0
- package/dist/maps/style.js +147 -0
- package/dist/maps/style.js.map +1 -0
- package/dist/maps/styles.d.ts +82 -0
- package/dist/maps/styles.d.ts.map +1 -0
- package/dist/maps/styles.js +898 -0
- package/dist/maps/styles.js.map +1 -0
- package/dist/maps/tiles.d.ts +283 -0
- package/dist/maps/tiles.d.ts.map +1 -0
- package/dist/maps/tiles.js +469 -0
- package/dist/maps/tiles.js.map +1 -0
- package/dist/maps/types.d.ts +244 -0
- package/dist/maps/types.d.ts.map +1 -0
- package/dist/maps/types.js +2 -0
- package/dist/maps/types.js.map +1 -0
- package/dist/markdown/ast.d.ts +80 -6
- package/dist/markdown/ast.d.ts.map +1 -1
- package/dist/markdown/ast.js +13 -4
- package/dist/markdown/ast.js.map +1 -1
- package/dist/markdown/expressions.d.ts +27 -0
- package/dist/markdown/expressions.d.ts.map +1 -0
- package/dist/markdown/expressions.js +203 -0
- package/dist/markdown/expressions.js.map +1 -0
- package/dist/markdown/index.d.ts +61 -2
- package/dist/markdown/index.d.ts.map +1 -1
- package/dist/markdown/index.js +101 -2
- package/dist/markdown/index.js.map +1 -1
- package/dist/markdown/parse.d.ts +1 -1
- package/dist/markdown/parse.d.ts.map +1 -1
- package/dist/markdown/parse.js +163 -15
- package/dist/markdown/parse.js.map +1 -1
- package/dist/markdown/spans.d.ts.map +1 -1
- package/dist/markdown/spans.js +4 -0
- package/dist/markdown/spans.js.map +1 -1
- package/dist/markdown/tags.d.ts +35 -0
- package/dist/markdown/tags.d.ts.map +1 -0
- package/dist/markdown/tags.js +213 -0
- package/dist/markdown/tags.js.map +1 -0
- package/dist/reorder/hx.d.ts +18 -0
- package/dist/reorder/hx.d.ts.map +1 -0
- package/dist/reorder/hx.js +10 -0
- package/dist/reorder/hx.js.map +1 -0
- package/dist/reorder/index.d.ts +314 -0
- package/dist/reorder/index.d.ts.map +1 -0
- package/dist/reorder/index.js +1539 -0
- package/dist/reorder/index.js.map +1 -0
- package/dist/reorder/model.d.ts +107 -0
- package/dist/reorder/model.d.ts.map +1 -0
- package/dist/reorder/model.js +162 -0
- package/dist/reorder/model.js.map +1 -0
- package/dist/richtext/node.d.ts +15 -5
- package/dist/richtext/node.d.ts.map +1 -1
- package/dist/richtext/node.js +40 -11
- package/dist/richtext/node.js.map +1 -1
- package/dist/richtext/runs.d.ts +35 -13
- package/dist/richtext/runs.d.ts.map +1 -1
- package/dist/richtext/runs.js +83 -27
- package/dist/richtext/runs.js.map +1 -1
- package/dist/tabs/index.d.ts +17 -0
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +849 -186
- package/dist/tabs/index.js.map +1 -1
- package/dist/terminal/vt/fonts.d.ts +45 -15
- package/dist/terminal/vt/fonts.d.ts.map +1 -1
- package/dist/terminal/vt/fonts.js +89 -19
- package/dist/terminal/vt/fonts.js.map +1 -1
- package/dist/terminal/vt/node.d.ts +42 -0
- package/dist/terminal/vt/node.d.ts.map +1 -1
- package/dist/terminal/vt/node.js +95 -11
- package/dist/terminal/vt/node.js.map +1 -1
- package/dist/terminal/vt/renderer.d.ts.map +1 -1
- package/dist/terminal/vt/renderer.js +13 -3
- package/dist/terminal/vt/renderer.js.map +1 -1
- package/package.json +14 -3
- package/src/charts/components.ts +14 -7
- package/src/charts/node.ts +81 -26
- package/src/charts/render.ts +16 -6
- package/src/code-editor/node.ts +147 -53
- package/src/flow/draw.ts +104 -35
- package/src/flow/index.ts +33 -13
- package/src/flow/model.ts +4 -2
- package/src/flow/node.ts +158 -59
- package/src/flow/types.ts +46 -21
- package/src/formula/index.ts +4 -2
- package/src/formula/node.ts +24 -5
- package/src/html/controls.ts +4 -1
- package/src/html/css/cascade.ts +18 -7
- package/src/html/css/parse.ts +46 -21
- package/src/html/css/style.ts +6 -1
- package/src/html/css/values.ts +25 -9
- package/src/html/index.ts +1 -0
- package/src/html/layout/boxes.ts +19 -9
- package/src/html/layout/inline.ts +23 -1
- package/src/html/node.ts +110 -17
- package/src/html/paint.ts +17 -2
- package/src/index.ts +102 -0
- package/src/maps/clip.ts +184 -0
- package/src/maps/gzip.ts +66 -0
- package/src/maps/index.ts +316 -0
- package/src/maps/labels.ts +442 -0
- package/src/maps/mvt.ts +857 -0
- package/src/maps/node.ts +1819 -0
- package/src/maps/overlay.ts +639 -0
- package/src/maps/paint.ts +978 -0
- package/src/maps/proj.ts +641 -0
- package/src/maps/sources.ts +425 -0
- package/src/maps/style.ts +309 -0
- package/src/maps/styles.ts +1040 -0
- package/src/maps/tiles.ts +676 -0
- package/src/maps/types.ts +260 -0
- package/src/markdown/ast.ts +85 -9
- package/src/markdown/expressions.ts +223 -0
- package/src/markdown/index.ts +190 -5
- package/src/markdown/parse.ts +230 -15
- package/src/markdown/spans.ts +4 -0
- package/src/markdown/tags.ts +240 -0
- package/src/reorder/hx.ts +31 -0
- package/src/reorder/index.ts +2223 -0
- package/src/reorder/model.ts +232 -0
- package/src/richtext/node.ts +49 -14
- package/src/richtext/runs.ts +115 -30
- package/src/tabs/index.ts +1040 -204
- package/src/terminal/vt/fonts.ts +128 -36
- package/src/terminal/vt/node.ts +105 -12
- package/src/terminal/vt/renderer.ts +13 -3
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
// `<Map>` — a 2D map: vector tiles the application supplies, drawn, panned,
|
|
2
|
+
// zoomed, with markers and overlays on top.
|
|
3
|
+
//
|
|
4
|
+
// The surface is deliberately close to Leaflet's and MapLibre's, because a
|
|
5
|
+
// map's API is a solved problem and an application that has described a
|
|
6
|
+
// camera, a marker and a tile source for one of those should not have to
|
|
7
|
+
// describe them again. What differs is the one thing that could not be
|
|
8
|
+
// carried over: nothing here fetches. A source is a function the
|
|
9
|
+
// application supplies, for the reason `src/html/`'s `onResource` is — see
|
|
10
|
+
// `./sources.ts`.
|
|
11
|
+
//
|
|
12
|
+
// **Registration happens when this module is evaluated**, which is the
|
|
13
|
+
// design and not a shortcut: nothing in the package registers anything
|
|
14
|
+
// until an application imports the component that needs it, so
|
|
15
|
+
// `sideEffects: false` stays honest. Do not move it into `../index.ts`
|
|
16
|
+
// (AGENTS.md, "Tree-shaking is a constraint").
|
|
17
|
+
import React, { useImperativeHandle, useRef } from 'react';
|
|
18
|
+
import type { ReactElement } from 'react';
|
|
19
|
+
import { registerElement, registeredElements } from 'react-x11/host';
|
|
20
|
+
import { createStyles, flattenStyle } from 'react-x11/style';
|
|
21
|
+
// Loads the module the JSX augmentation at the bottom targets: nothing in
|
|
22
|
+
// `src/` writes JSX, so without this the build program never resolves
|
|
23
|
+
// `react-x11/jsx-runtime` and the augmentation is an error rather than an
|
|
24
|
+
// addition. Type-only, so it is erased.
|
|
25
|
+
import type {} from 'react-x11/jsx-runtime';
|
|
26
|
+
|
|
27
|
+
import { ELEMENT, MapViewNode, SELF_DAMAGED_PROPS } from './node.js';
|
|
28
|
+
import type {
|
|
29
|
+
FitBoundsOptions,
|
|
30
|
+
MapCamera,
|
|
31
|
+
MapHandle,
|
|
32
|
+
MapProps,
|
|
33
|
+
MapViewProps,
|
|
34
|
+
} from './types.js';
|
|
35
|
+
import type { LngLat, LngLatBounds } from './proj.js';
|
|
36
|
+
import type { MapMarker } from './overlay.js';
|
|
37
|
+
|
|
38
|
+
if (!registeredElements().includes(ELEMENT)) {
|
|
39
|
+
registerElement(ELEMENT, {
|
|
40
|
+
create: (props, app) => new MapViewNode(props, app),
|
|
41
|
+
// No `semanticNames`: not one of this element's prop names is also a
|
|
42
|
+
// style name — `center`, `zoom`, `sources` and `markers` are all clear,
|
|
43
|
+
// and the map style is `mapStyle` precisely so that `style` stays
|
|
44
|
+
// react-x11's. `test/maps.test.ts` is what keeps that true, because the
|
|
45
|
+
// failure it guards against (throws in development, works in
|
|
46
|
+
// production) is the worst shape a bug can have.
|
|
47
|
+
childrenAllowed: false,
|
|
48
|
+
// The commit claim: changes to these damage nothing by name — the
|
|
49
|
+
// element's own `applyProps` diffs them into the boxes that actually
|
|
50
|
+
// changed (react-x11#301). Without this, every pan step's new `camera`
|
|
51
|
+
// and every moved marker would repaint the whole pane.
|
|
52
|
+
selfDamagedProps: [...SELF_DAMAGED_PROPS],
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* `pane` is the default for the box `<Map>` renders: it fills its parent —
|
|
58
|
+
* unless the application's own style gives it a height or a `flexGrow`, in
|
|
59
|
+
* which case adding one would silently override what it asked for.
|
|
60
|
+
* Checked against the *flattened* style, so an array works too.
|
|
61
|
+
*/
|
|
62
|
+
const styles = createStyles({
|
|
63
|
+
pane: { flexGrow: 1, overflow: 'hidden' },
|
|
64
|
+
clip: { overflow: 'hidden' },
|
|
65
|
+
fill: { flexGrow: 1 },
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const DEFAULT_CAMERA: MapCamera = { center: { lon: 0, lat: 20 }, zoom: 2 };
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A map.
|
|
72
|
+
*
|
|
73
|
+
* ```tsx
|
|
74
|
+
* const source = osmVectorSource({
|
|
75
|
+
* fetch: async (url, signal) => {
|
|
76
|
+
* const response = await fetch(url, { signal });
|
|
77
|
+
* if (response.status === 404) return null;
|
|
78
|
+
* return new Uint8Array(await response.arrayBuffer());
|
|
79
|
+
* },
|
|
80
|
+
* });
|
|
81
|
+
*
|
|
82
|
+
* <Map
|
|
83
|
+
* sources={[source]}
|
|
84
|
+
* defaultCamera={{ center: { lon: -0.1281, lat: 51.508 }, zoom: 13 }}
|
|
85
|
+
* markers={[{ id: 'home', position: { lon: -0.1281, lat: 51.508 } }]}
|
|
86
|
+
* onMarkerClick={(marker) => select(marker.id)}
|
|
87
|
+
* />
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* Pass `camera` and `onCameraChange` instead of `defaultCamera` for the
|
|
91
|
+
* controlled form, where the application owns where the map is looking.
|
|
92
|
+
*/
|
|
93
|
+
export function Map(props: MapProps): ReactElement {
|
|
94
|
+
const {
|
|
95
|
+
camera,
|
|
96
|
+
defaultCamera,
|
|
97
|
+
onCameraChange,
|
|
98
|
+
style,
|
|
99
|
+
children,
|
|
100
|
+
ref,
|
|
101
|
+
...rest
|
|
102
|
+
} = props;
|
|
103
|
+
|
|
104
|
+
const view = useRef<MapViewNode | null>(null);
|
|
105
|
+
const controlled = camera !== undefined;
|
|
106
|
+
|
|
107
|
+
useImperativeHandle(
|
|
108
|
+
ref,
|
|
109
|
+
(): MapHandle => ({
|
|
110
|
+
// Every method reads the node at call time rather than closing over
|
|
111
|
+
// it: the ref attaches after the commit that created the node, and a
|
|
112
|
+
// handle built once must still work for the whole mount.
|
|
113
|
+
getCamera: () => view.current?.getCamera() ?? DEFAULT_CAMERA,
|
|
114
|
+
setCamera: (next: Partial<MapCamera>) => view.current?.setCamera(next),
|
|
115
|
+
panBy: (dx: number, dy: number) => view.current?.panBy(dx, dy),
|
|
116
|
+
zoomIn: (step?: number) => view.current?.zoomIn(step),
|
|
117
|
+
zoomOut: (step?: number) => view.current?.zoomOut(step),
|
|
118
|
+
zoomTo: (zoom: number) => view.current?.zoomTo(zoom),
|
|
119
|
+
fitBounds: (bounds: LngLatBounds, options?: FitBoundsOptions) =>
|
|
120
|
+
view.current?.fitBounds(bounds, options),
|
|
121
|
+
fitMarkers: (ids?: readonly string[], options?: FitBoundsOptions) =>
|
|
122
|
+
view.current?.fitMarkers(ids, options),
|
|
123
|
+
getBounds: () =>
|
|
124
|
+
view.current?.getBounds() ?? {
|
|
125
|
+
west: -180,
|
|
126
|
+
south: -85,
|
|
127
|
+
east: 180,
|
|
128
|
+
north: 85,
|
|
129
|
+
},
|
|
130
|
+
project: (position: LngLat) =>
|
|
131
|
+
view.current?.project(position) ?? { x: 0, y: 0 },
|
|
132
|
+
unproject: (x: number, y: number) =>
|
|
133
|
+
view.current?.unproject(x, y) ?? { lon: 0, lat: 0 },
|
|
134
|
+
markerAt: (x: number, y: number): MapMarker | null =>
|
|
135
|
+
view.current?.markerAt(x, y) ?? null,
|
|
136
|
+
refresh: () => view.current?.refresh(),
|
|
137
|
+
stats: () => view.current?.stats() ?? null,
|
|
138
|
+
}),
|
|
139
|
+
[],
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
const flat = flattenStyle(style ?? null);
|
|
143
|
+
const sized =
|
|
144
|
+
flat.height !== undefined ||
|
|
145
|
+
flat.flexGrow !== undefined ||
|
|
146
|
+
flat.flexBasis !== undefined;
|
|
147
|
+
|
|
148
|
+
// The pane and anything the application puts over it are siblings rather
|
|
149
|
+
// than parent and children: a registered element's own drawing happens
|
|
150
|
+
// *after* `super.paint` has painted its children, so anything mounted
|
|
151
|
+
// inside would be painted over by the map. Beside it, and after it, a
|
|
152
|
+
// legend or a control panel lands on top. `<Flow>` makes the same
|
|
153
|
+
// arrangement for the same reason.
|
|
154
|
+
return React.createElement(
|
|
155
|
+
'box',
|
|
156
|
+
{ style: sized ? [styles.clip, style] : [styles.pane, style] },
|
|
157
|
+
React.createElement(ELEMENT, {
|
|
158
|
+
...(rest as MapViewProps),
|
|
159
|
+
key: 'pane',
|
|
160
|
+
ref: view,
|
|
161
|
+
// The controlled/uncontrolled fork, and the whole of it. Controlled:
|
|
162
|
+
// the application's camera goes down and the element only ever
|
|
163
|
+
// *asks* to move. Uncontrolled: nothing goes down after the seed, the
|
|
164
|
+
// element owns the camera, and a pan never reaches React — which is
|
|
165
|
+
// the difference between a drag that blits a strip and one that
|
|
166
|
+
// re-renders and re-claims the pane on every pointer step.
|
|
167
|
+
camera: controlled ? camera : undefined,
|
|
168
|
+
defaultCamera: controlled ? undefined : (defaultCamera ?? DEFAULT_CAMERA),
|
|
169
|
+
onCameraChange,
|
|
170
|
+
style: styles.fill,
|
|
171
|
+
role: rest.role ?? 'group',
|
|
172
|
+
'aria-label': rest['aria-label'] ?? 'Map',
|
|
173
|
+
}),
|
|
174
|
+
children,
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** The host element name, for an application that would rather write
|
|
179
|
+
* `<mapview>`. The raw element is the whole component minus the
|
|
180
|
+
* controlled/uncontrolled fork and the box around it. */
|
|
181
|
+
export { ELEMENT as MAPVIEW_ELEMENT, MapViewNode };
|
|
182
|
+
|
|
183
|
+
export {
|
|
184
|
+
DEFAULT_TILE_SIZE,
|
|
185
|
+
EARTH_CIRCUMFERENCE,
|
|
186
|
+
EARTH_RADIUS,
|
|
187
|
+
MAX_LATITUDE,
|
|
188
|
+
boundsOf,
|
|
189
|
+
cameraForBounds,
|
|
190
|
+
dataTileFor,
|
|
191
|
+
distanceMetres,
|
|
192
|
+
latFromMercatorY,
|
|
193
|
+
lonFromMercatorX,
|
|
194
|
+
mercatorScale,
|
|
195
|
+
mercatorXFromLon,
|
|
196
|
+
mercatorYFromLat,
|
|
197
|
+
metresPerPixel,
|
|
198
|
+
parentTile,
|
|
199
|
+
project,
|
|
200
|
+
projectLngLat,
|
|
201
|
+
projectPoint,
|
|
202
|
+
rasterFor,
|
|
203
|
+
sourceZoomFor,
|
|
204
|
+
subTileOf,
|
|
205
|
+
tileBounds,
|
|
206
|
+
tileContains,
|
|
207
|
+
tileCountAt,
|
|
208
|
+
tileCover,
|
|
209
|
+
tileKey,
|
|
210
|
+
tileOf,
|
|
211
|
+
tileTransform,
|
|
212
|
+
transformFor,
|
|
213
|
+
unproject,
|
|
214
|
+
unprojectPoint,
|
|
215
|
+
visibleBounds,
|
|
216
|
+
worldSize,
|
|
217
|
+
zoomOffsetFor,
|
|
218
|
+
wrapLon,
|
|
219
|
+
wrapTileX,
|
|
220
|
+
} from './proj.js';
|
|
221
|
+
|
|
222
|
+
export {
|
|
223
|
+
OSM_ATTRIBUTION,
|
|
224
|
+
OSM_RASTER_URL,
|
|
225
|
+
OSM_VECTOR_URL,
|
|
226
|
+
googleTileSource,
|
|
227
|
+
osmRasterSource,
|
|
228
|
+
osmVectorSource,
|
|
229
|
+
parseVectorTile,
|
|
230
|
+
pyramidOf,
|
|
231
|
+
tileUrl,
|
|
232
|
+
} from './sources.js';
|
|
233
|
+
|
|
234
|
+
export { setGunzip } from './gzip.js';
|
|
235
|
+
|
|
236
|
+
export {
|
|
237
|
+
DARK_PALETTE,
|
|
238
|
+
LIGHT_PALETTE,
|
|
239
|
+
openMapTilesStyle,
|
|
240
|
+
shortbreadStyle,
|
|
241
|
+
} from './styles.js';
|
|
242
|
+
|
|
243
|
+
export { compileFilter, resolveZoomed } from './style.js';
|
|
244
|
+
|
|
245
|
+
export {
|
|
246
|
+
decodePolyline,
|
|
247
|
+
geoJsonOverlays,
|
|
248
|
+
markerAt,
|
|
249
|
+
markerRect,
|
|
250
|
+
} from './overlay.js';
|
|
251
|
+
|
|
252
|
+
export { GeomType, GeometryBuffer, MvtError, parseTile } from './mvt.js';
|
|
253
|
+
|
|
254
|
+
export { TileCache } from './tiles.js';
|
|
255
|
+
|
|
256
|
+
export type {
|
|
257
|
+
FitBoundsOptions,
|
|
258
|
+
MapFrameStats,
|
|
259
|
+
MapHandle,
|
|
260
|
+
MapPointerEvent,
|
|
261
|
+
MapProps,
|
|
262
|
+
MapViewProps,
|
|
263
|
+
} from './types.js';
|
|
264
|
+
export type {
|
|
265
|
+
LngLat,
|
|
266
|
+
LngLatBounds,
|
|
267
|
+
MapCamera,
|
|
268
|
+
MercatorPoint,
|
|
269
|
+
TileCoverEntry,
|
|
270
|
+
TileId,
|
|
271
|
+
TilePyramid,
|
|
272
|
+
TileRaster,
|
|
273
|
+
Transform,
|
|
274
|
+
} from './proj.js';
|
|
275
|
+
export type {
|
|
276
|
+
GoogleSession,
|
|
277
|
+
GoogleTileSourceOptions,
|
|
278
|
+
MapSource,
|
|
279
|
+
TileData,
|
|
280
|
+
TileRequest,
|
|
281
|
+
} from './sources.js';
|
|
282
|
+
export type { MapMarker, MapOverlay, GeoJsonLike } from './overlay.js';
|
|
283
|
+
export type {
|
|
284
|
+
CircleLayer,
|
|
285
|
+
FillLayer,
|
|
286
|
+
LineLayer,
|
|
287
|
+
MapFilter,
|
|
288
|
+
MapStyle,
|
|
289
|
+
MapStyleLayer,
|
|
290
|
+
SymbolLayer,
|
|
291
|
+
Zoomed,
|
|
292
|
+
} from './style.js';
|
|
293
|
+
export type {
|
|
294
|
+
MapPalette,
|
|
295
|
+
OpenMapTilesStyleOptions,
|
|
296
|
+
ShortbreadStyleOptions,
|
|
297
|
+
} from './styles.js';
|
|
298
|
+
export type {
|
|
299
|
+
FeatureValue,
|
|
300
|
+
GeometryData,
|
|
301
|
+
VectorTile,
|
|
302
|
+
VectorTileLayer,
|
|
303
|
+
FeatureCursor,
|
|
304
|
+
} from './mvt.js';
|
|
305
|
+
export type { CachedTile, TileStatus } from './tiles.js';
|
|
306
|
+
|
|
307
|
+
// Importing this module teaches JSX the element too, so `<mapview>` is a
|
|
308
|
+
// typed tag rather than an error — the module-augmentation shape
|
|
309
|
+
// react-x11's docs/typescript.md prescribes for a third-party element.
|
|
310
|
+
declare module 'react-x11/jsx-runtime' {
|
|
311
|
+
namespace JSX {
|
|
312
|
+
interface IntrinsicElements {
|
|
313
|
+
mapview: MapViewProps;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|