react-bkoi-gl 1.0.6 → 2.0.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 +163 -18
- package/dist/components/attribution-control.d.ts +4 -6
- package/dist/components/attribution-control.js +6 -5
- package/dist/components/attribution-control.js.map +1 -1
- package/dist/components/fullscreen-control.d.ts +4 -6
- package/dist/components/fullscreen-control.js +4 -4
- package/dist/components/fullscreen-control.js.map +1 -1
- package/dist/components/geolocate-control.d.ts +10 -26
- package/dist/components/geolocate-control.js +11 -11
- package/dist/components/geolocate-control.js.map +1 -1
- package/dist/components/layer.d.ts +7 -6
- package/dist/components/layer.js +8 -9
- package/dist/components/layer.js.map +1 -1
- package/dist/components/logo-control.d.ts +9 -0
- package/dist/components/logo-control.js +28 -0
- package/dist/components/logo-control.js.map +1 -0
- package/dist/components/map.d.ts +20 -16
- package/dist/components/map.js +38 -32
- package/dist/components/map.js.map +1 -1
- package/dist/components/marker.d.ts +10 -33
- package/dist/components/marker.js +22 -15
- package/dist/components/marker.js.map +1 -1
- package/dist/components/navigation-control.d.ts +4 -6
- package/dist/components/navigation-control.js +4 -4
- package/dist/components/navigation-control.js.map +1 -1
- package/dist/components/popup.d.ts +7 -25
- package/dist/components/popup.js +17 -28
- package/dist/components/popup.js.map +1 -1
- package/dist/components/scale-control.d.ts +4 -6
- package/dist/components/scale-control.js +4 -4
- package/dist/components/scale-control.js.map +1 -1
- package/dist/components/source.d.ts +3 -4
- package/dist/components/source.js +20 -22
- package/dist/components/source.js.map +1 -1
- package/dist/components/terrain-control.d.ts +10 -0
- package/dist/components/terrain-control.js +19 -0
- package/dist/components/terrain-control.js.map +1 -0
- package/dist/components/use-control.d.ts +6 -6
- package/dist/components/use-control.js +4 -5
- package/dist/components/use-control.js.map +1 -1
- package/dist/components/use-map.d.ts +8 -9
- package/dist/components/use-map.js +5 -5
- package/dist/components/use-map.js.map +1 -1
- package/dist/exports-maplibre-gl.d.ts +33 -0
- package/dist/exports-maplibre-gl.js +21 -0
- package/dist/exports-maplibre-gl.js.map +1 -0
- package/dist/index.cjs +590 -681
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{mapbox → maplibre}/create-ref.d.ts +6 -6
- package/dist/maplibre/create-ref.js +30 -0
- package/dist/maplibre/create-ref.js.map +1 -0
- package/dist/maplibre/maplibre.d.ts +81 -0
- package/dist/maplibre/maplibre.js +387 -0
- package/dist/maplibre/maplibre.js.map +1 -0
- package/dist/styles/index.d.ts +4 -0
- package/dist/styles/react-bkoi-gl.css +1 -1
- package/dist/styles.d.js +2 -0
- package/dist/styles.d.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types/common.d.ts +2 -60
- package/dist/types/common.js.map +1 -1
- package/dist/types/events.d.ts +64 -23
- package/dist/types/events.js.map +1 -1
- package/dist/types/internal.d.ts +14 -0
- package/dist/types/internal.js +2 -0
- package/dist/types/internal.js.map +1 -0
- package/dist/types/lib.d.ts +16 -200
- package/dist/types/lib.js.map +1 -1
- package/dist/types/style-spec.d.ts +1 -0
- package/dist/types/style-spec.js +2 -0
- package/dist/types/style-spec.js.map +1 -0
- package/dist/utils/apply-react-style.d.ts +1 -1
- package/dist/utils/apply-react-style.js.map +1 -1
- package/dist/utils/compare-class-names.d.ts +2 -0
- package/dist/utils/compare-class-names.js +23 -0
- package/dist/utils/compare-class-names.js.map +1 -0
- package/dist/utils/deep-equal.d.ts +1 -1
- package/dist/utils/deep-equal.js +1 -1
- package/dist/utils/deep-equal.js.map +1 -1
- package/dist/utils/set-globals.d.ts +6 -8
- package/dist/utils/set-globals.js +22 -10
- package/dist/utils/set-globals.js.map +1 -1
- package/dist/utils/style-utils.d.ts +3 -2
- package/dist/utils/style-utils.js +4 -4
- package/dist/utils/style-utils.js.map +1 -1
- package/dist/utils/transform.d.ts +11 -19
- package/dist/utils/transform.js +13 -36
- package/dist/utils/transform.js.map +1 -1
- package/dist/utils/use-isomorphic-layout-effect.d.ts +1 -1
- package/dist/utils/use-isomorphic-layout-effect.js +2 -2
- package/dist/utils/use-isomorphic-layout-effect.js.map +1 -1
- package/package.json +42 -26
- package/src/components/attribution-control.ts +40 -16
- package/src/components/fullscreen-control.ts +40 -0
- package/src/components/geolocate-control.ts +45 -39
- package/src/components/layer.ts +37 -29
- package/src/components/logo-control.ts +44 -0
- package/src/components/map.tsx +86 -75
- package/src/components/marker.ts +141 -123
- package/src/components/navigation-control.ts +11 -12
- package/src/components/popup.ts +94 -97
- package/src/components/scale-control.ts +12 -14
- package/src/components/source.ts +58 -57
- package/src/components/terrain-control.ts +29 -0
- package/src/components/use-control.ts +21 -17
- package/src/components/use-map.tsx +26 -24
- package/src/exports-maplibre-gl.ts +37 -0
- package/src/index.ts +3 -2
- package/src/maplibre/create-ref.ts +70 -0
- package/src/maplibre/maplibre.ts +624 -0
- package/src/styles.d.ts +4 -0
- package/src/types/common.ts +12 -72
- package/src/types/events.ts +102 -42
- package/src/types/internal.ts +26 -0
- package/src/types/lib.ts +65 -260
- package/src/types/style-spec.ts +34 -0
- package/src/utils/apply-react-style.ts +7 -3
- package/src/utils/compare-class-names.ts +29 -0
- package/src/utils/deep-equal.ts +2 -2
- package/src/utils/set-globals.ts +22 -28
- package/src/utils/style-utils.ts +18 -9
- package/src/utils/transform.ts +32 -60
- package/src/utils/use-isomorphic-layout-effect.ts +3 -2
- package/bkoi-gl/package.json +0 -6
- package/dist/exports-bkoi-gl.cjs +0 -1512
- package/dist/exports-bkoi-gl.d.ts +0 -89
- package/dist/exports-bkoi-gl.js +0 -36
- package/dist/exports-bkoi-gl.js.map +0 -1
- package/dist/exports-mapbox.d.ts +0 -139
- package/dist/exports-mapbox.js +0 -36
- package/dist/exports-mapbox.js.map +0 -1
- package/dist/mapbox/create-ref.js +0 -64
- package/dist/mapbox/create-ref.js.map +0 -1
- package/dist/mapbox/mapbox.d.ts +0 -81
- package/dist/mapbox/mapbox.js +0 -476
- package/dist/mapbox/mapbox.js.map +0 -1
- package/dist/types/events-bkoi-gl.d.ts +0 -49
- package/dist/types/events-bkoi-gl.js +0 -2
- package/dist/types/events-bkoi-gl.js.map +0 -1
- package/dist/types/events-mapbox.d.ts +0 -49
- package/dist/types/events-mapbox.js +0 -2
- package/dist/types/events-mapbox.js.map +0 -1
- package/dist/types/index.d.ts +0 -70
- package/dist/types/index.js +0 -5
- package/dist/types/index.js.map +0 -1
- package/dist/types/public.d.ts +0 -2
- package/dist/types/public.js +0 -2
- package/dist/types/public.js.map +0 -1
- package/dist/types/style-spec-bkoi-gl.d.ts +0 -9
- package/dist/types/style-spec-bkoi-gl.js +0 -2
- package/dist/types/style-spec-bkoi-gl.js.map +0 -1
- package/dist/types/style-spec-mapbox.d.ts +0 -7
- package/dist/types/style-spec-mapbox.js +0 -2
- package/dist/types/style-spec-mapbox.js.map +0 -1
- package/src/components/fullscreen-control.tsx +0 -37
- package/src/exports-bkoi-gl.ts +0 -156
- package/src/exports-mapbox.ts +0 -159
- package/src/mapbox/create-ref.ts +0 -118
- package/src/mapbox/mapbox.ts +0 -742
- package/src/types/events-bkoi-gl.ts +0 -78
- package/src/types/events-mapbox.ts +0 -76
- package/src/types/index.ts +0 -93
- package/src/types/public.ts +0 -9
- package/src/types/style-spec-bkoi-gl.ts +0 -81
- package/src/types/style-spec-mapbox.ts +0 -80
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Map, MapboxEvent as MapEvent, MapMouseEvent, MapLayerMouseEvent, MapTouchEvent, MapLayerTouchEvent, MapStyleDataEvent, MapSourceDataEvent, MapWheelEvent, MapBoxZoomEvent } from 'mapbox-gl';
|
|
2
|
-
import { ErrorEvent as _ErrorEvent, ViewStateChangeEvent as _ViewStateChangeEvent } from './events';
|
|
3
|
-
export type { MapEvent, MapMouseEvent, MapLayerMouseEvent, MapTouchEvent, MapLayerTouchEvent, MapStyleDataEvent, MapSourceDataEvent, MapWheelEvent, MapBoxZoomEvent };
|
|
4
|
-
export type ErrorEvent = _ErrorEvent<Map>;
|
|
5
|
-
export type ViewStateChangeEvent = _ViewStateChangeEvent<Map>;
|
|
6
|
-
export type MapCallbacks = {
|
|
7
|
-
onMouseDown?: (e: MapLayerMouseEvent) => void;
|
|
8
|
-
onMouseUp?: (e: MapLayerMouseEvent) => void;
|
|
9
|
-
onMouseOver?: (e: MapLayerMouseEvent) => void;
|
|
10
|
-
onMouseMove?: (e: MapLayerMouseEvent) => void;
|
|
11
|
-
onClick?: (e: MapLayerMouseEvent) => void;
|
|
12
|
-
onDblClick?: (e: MapLayerMouseEvent) => void;
|
|
13
|
-
onMouseEnter?: (e: MapLayerMouseEvent) => void;
|
|
14
|
-
onMouseLeave?: (e: MapLayerMouseEvent) => void;
|
|
15
|
-
onMouseOut?: (e: MapLayerMouseEvent) => void;
|
|
16
|
-
onContextMenu?: (e: MapLayerMouseEvent) => void;
|
|
17
|
-
onTouchStart?: (e: MapLayerTouchEvent) => void;
|
|
18
|
-
onTouchEnd?: (e: MapLayerTouchEvent) => void;
|
|
19
|
-
onTouchMove?: (e: MapLayerTouchEvent) => void;
|
|
20
|
-
onTouchCancel?: (e: MapLayerTouchEvent) => void;
|
|
21
|
-
onMoveStart?: (e: ViewStateChangeEvent) => void;
|
|
22
|
-
onMove?: (e: ViewStateChangeEvent) => void;
|
|
23
|
-
onMoveEnd?: (e: ViewStateChangeEvent) => void;
|
|
24
|
-
onDragStart?: (e: ViewStateChangeEvent) => void;
|
|
25
|
-
onDrag?: (e: ViewStateChangeEvent) => void;
|
|
26
|
-
onDragEnd?: (e: ViewStateChangeEvent) => void;
|
|
27
|
-
onZoomStart?: (e: ViewStateChangeEvent) => void;
|
|
28
|
-
onZoom?: (e: ViewStateChangeEvent) => void;
|
|
29
|
-
onZoomEnd?: (e: ViewStateChangeEvent) => void;
|
|
30
|
-
onRotateStart?: (e: ViewStateChangeEvent) => void;
|
|
31
|
-
onRotate?: (e: ViewStateChangeEvent) => void;
|
|
32
|
-
onRotateEnd?: (e: ViewStateChangeEvent) => void;
|
|
33
|
-
onPitchStart?: (e: ViewStateChangeEvent) => void;
|
|
34
|
-
onPitch?: (e: ViewStateChangeEvent) => void;
|
|
35
|
-
onPitchEnd?: (e: ViewStateChangeEvent) => void;
|
|
36
|
-
onWheel?: (e: MapWheelEvent) => void;
|
|
37
|
-
onBoxZoomStart?: (e: MapBoxZoomEvent) => void;
|
|
38
|
-
onBoxZoomEnd?: (e: MapBoxZoomEvent) => void;
|
|
39
|
-
onBoxZoomCancel?: (e: MapBoxZoomEvent) => void;
|
|
40
|
-
onResize?: (e: MapEvent) => void;
|
|
41
|
-
onLoad?: (e: MapEvent) => void;
|
|
42
|
-
onRender?: (e: MapEvent) => void;
|
|
43
|
-
onIdle?: (e: MapEvent) => void;
|
|
44
|
-
onError?: (e: ErrorEvent) => void;
|
|
45
|
-
onRemove?: (e: MapEvent) => void;
|
|
46
|
-
onData?: (e: MapStyleDataEvent | MapSourceDataEvent) => void;
|
|
47
|
-
onStyleData?: (e: MapStyleDataEvent) => void;
|
|
48
|
-
onSourceData?: (e: MapSourceDataEvent) => void;
|
|
49
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events-mapbox.js","names":[],"sources":["../../src/types/events-mapbox.ts"],"sourcesContent":["import {\n Map,\n MapboxEvent as MapEvent,\n MapMouseEvent,\n MapLayerMouseEvent,\n MapTouchEvent,\n MapLayerTouchEvent,\n MapStyleDataEvent,\n MapSourceDataEvent,\n MapWheelEvent,\n MapBoxZoomEvent\n} from 'mapbox-gl';\nimport {ErrorEvent as _ErrorEvent, ViewStateChangeEvent as _ViewStateChangeEvent} from './events';\n\nexport type {\n MapEvent,\n MapMouseEvent,\n MapLayerMouseEvent,\n MapTouchEvent,\n MapLayerTouchEvent,\n MapStyleDataEvent,\n MapSourceDataEvent,\n MapWheelEvent,\n MapBoxZoomEvent\n};\n\nexport type ErrorEvent = _ErrorEvent<Map>;\nexport type ViewStateChangeEvent = _ViewStateChangeEvent<Map>;\n\nexport type MapCallbacks = {\n onMouseDown?: (e: MapLayerMouseEvent) => void;\n onMouseUp?: (e: MapLayerMouseEvent) => void;\n onMouseOver?: (e: MapLayerMouseEvent) => void;\n onMouseMove?: (e: MapLayerMouseEvent) => void;\n onClick?: (e: MapLayerMouseEvent) => void;\n onDblClick?: (e: MapLayerMouseEvent) => void;\n onMouseEnter?: (e: MapLayerMouseEvent) => void;\n onMouseLeave?: (e: MapLayerMouseEvent) => void;\n onMouseOut?: (e: MapLayerMouseEvent) => void;\n onContextMenu?: (e: MapLayerMouseEvent) => void;\n onTouchStart?: (e: MapLayerTouchEvent) => void;\n onTouchEnd?: (e: MapLayerTouchEvent) => void;\n onTouchMove?: (e: MapLayerTouchEvent) => void;\n onTouchCancel?: (e: MapLayerTouchEvent) => void;\n\n onMoveStart?: (e: ViewStateChangeEvent) => void;\n onMove?: (e: ViewStateChangeEvent) => void;\n onMoveEnd?: (e: ViewStateChangeEvent) => void;\n onDragStart?: (e: ViewStateChangeEvent) => void;\n onDrag?: (e: ViewStateChangeEvent) => void;\n onDragEnd?: (e: ViewStateChangeEvent) => void;\n onZoomStart?: (e: ViewStateChangeEvent) => void;\n onZoom?: (e: ViewStateChangeEvent) => void;\n onZoomEnd?: (e: ViewStateChangeEvent) => void;\n onRotateStart?: (e: ViewStateChangeEvent) => void;\n onRotate?: (e: ViewStateChangeEvent) => void;\n onRotateEnd?: (e: ViewStateChangeEvent) => void;\n onPitchStart?: (e: ViewStateChangeEvent) => void;\n onPitch?: (e: ViewStateChangeEvent) => void;\n onPitchEnd?: (e: ViewStateChangeEvent) => void;\n\n onWheel?: (e: MapWheelEvent) => void;\n onBoxZoomStart?: (e: MapBoxZoomEvent) => void;\n onBoxZoomEnd?: (e: MapBoxZoomEvent) => void;\n onBoxZoomCancel?: (e: MapBoxZoomEvent) => void;\n\n onResize?: (e: MapEvent) => void;\n onLoad?: (e: MapEvent) => void;\n onRender?: (e: MapEvent) => void;\n onIdle?: (e: MapEvent) => void;\n onError?: (e: ErrorEvent) => void;\n onRemove?: (e: MapEvent) => void;\n onData?: (e: MapStyleDataEvent | MapSourceDataEvent) => void;\n onStyleData?: (e: MapStyleDataEvent) => void;\n onSourceData?: (e: MapSourceDataEvent) => void;\n};\n"],"mappings":"","ignoreList":[]}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export * from './common';
|
|
2
|
-
export * from './lib';
|
|
3
|
-
export * from './events';
|
|
4
|
-
import type GeoJSON from 'geojson';
|
|
5
|
-
import type { CustomSourceImplementation } from './lib';
|
|
6
|
-
export interface ISource {
|
|
7
|
-
type: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ILayer {
|
|
10
|
-
id: string;
|
|
11
|
-
type: string;
|
|
12
|
-
metadata?: any;
|
|
13
|
-
source?: unknown;
|
|
14
|
-
minzoom?: number;
|
|
15
|
-
maxzoom?: number;
|
|
16
|
-
filter?: any;
|
|
17
|
-
layout?: {
|
|
18
|
-
[property: string]: any;
|
|
19
|
-
};
|
|
20
|
-
paint?: {
|
|
21
|
-
[property: string]: any;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export interface MapStyle {
|
|
25
|
-
name?: string;
|
|
26
|
-
metadata?: unknown;
|
|
27
|
-
version: number;
|
|
28
|
-
layers: ILayer[];
|
|
29
|
-
sources: {
|
|
30
|
-
[sourceName: string]: object;
|
|
31
|
-
};
|
|
32
|
-
fog?: any;
|
|
33
|
-
terrain?: any;
|
|
34
|
-
light?: any;
|
|
35
|
-
}
|
|
36
|
-
export interface GeoJSONSourceImplementation {
|
|
37
|
-
type: 'geojson';
|
|
38
|
-
setData(data: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry> | String): this;
|
|
39
|
-
}
|
|
40
|
-
export interface ImageSourceImplemtation {
|
|
41
|
-
type: 'image';
|
|
42
|
-
updateImage(options: {
|
|
43
|
-
url?: string;
|
|
44
|
-
coordinates?: number[][];
|
|
45
|
-
}): this;
|
|
46
|
-
setCoordinates(coordinates: number[][]): this;
|
|
47
|
-
}
|
|
48
|
-
export interface CanvasSourceImplemtation {
|
|
49
|
-
type: 'canvas';
|
|
50
|
-
play(): void;
|
|
51
|
-
pause(): void;
|
|
52
|
-
getCanvas(): HTMLCanvasElement;
|
|
53
|
-
setCoordinates(coordinates: number[][]): this;
|
|
54
|
-
}
|
|
55
|
-
export interface VectorSourceImplementation {
|
|
56
|
-
type: 'vector';
|
|
57
|
-
setTiles(tiles: ReadonlyArray<string>): this;
|
|
58
|
-
setUrl(url: string): this;
|
|
59
|
-
}
|
|
60
|
-
export interface RasterSourceImplementation {
|
|
61
|
-
type: 'raster' | 'raster-dem';
|
|
62
|
-
setTiles(tiles: ReadonlyArray<string>): this;
|
|
63
|
-
setUrl(url: string): this;
|
|
64
|
-
}
|
|
65
|
-
export interface VideoSourceImplementation {
|
|
66
|
-
type: 'video';
|
|
67
|
-
getVideo(): HTMLVideoElement;
|
|
68
|
-
setCoordinates(coordinates: number[][]): this;
|
|
69
|
-
}
|
|
70
|
-
export type AnySourceImplementation = GeoJSONSourceImplementation | VideoSourceImplementation | ImageSourceImplemtation | CanvasSourceImplemtation | VectorSourceImplementation | RasterSourceImplementation | CustomSourceImplementation<HTMLImageElement | ImageData | ImageBitmap>;
|
package/dist/types/index.js
DELETED
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './common';\nexport * from './lib';\nexport * from './events';\n\nimport type GeoJSON from 'geojson';\nimport type {CustomSourceImplementation} from './lib';\n\n// Internal: source implementations\n\nexport interface ISource {\n type: string;\n}\n\nexport interface ILayer {\n id: string;\n type: string;\n\n metadata?: any;\n source?: unknown;\n\n minzoom?: number;\n maxzoom?: number;\n\n filter?: any;\n layout?: {\n [property: string]: any;\n };\n paint?: {\n [property: string]: any;\n };\n}\n\nexport interface MapStyle {\n name?: string;\n metadata?: unknown;\n version: number;\n layers: ILayer[];\n sources: {\n [sourceName: string]: object;\n };\n\n fog?: any;\n terrain?: any;\n light?: any;\n}\n\nexport interface GeoJSONSourceImplementation {\n type: 'geojson';\n setData(\n data: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry> | String\n ): this;\n}\n\nexport interface ImageSourceImplemtation {\n type: 'image';\n updateImage(options: {url?: string; coordinates?: number[][]}): this;\n setCoordinates(coordinates: number[][]): this;\n}\n\nexport interface CanvasSourceImplemtation {\n type: 'canvas';\n play(): void;\n pause(): void;\n getCanvas(): HTMLCanvasElement;\n setCoordinates(coordinates: number[][]): this;\n}\n\nexport interface VectorSourceImplementation {\n type: 'vector';\n setTiles(tiles: ReadonlyArray<string>): this;\n setUrl(url: string): this;\n}\n\nexport interface RasterSourceImplementation {\n type: 'raster' | 'raster-dem';\n setTiles(tiles: ReadonlyArray<string>): this;\n setUrl(url: string): this;\n}\n\nexport interface VideoSourceImplementation {\n type: 'video';\n getVideo(): HTMLVideoElement;\n setCoordinates(coordinates: number[][]): this;\n}\n\nexport type AnySourceImplementation =\n | GeoJSONSourceImplementation\n | VideoSourceImplementation\n | ImageSourceImplemtation\n | CanvasSourceImplemtation\n | VectorSourceImplementation\n | RasterSourceImplementation\n | CustomSourceImplementation<HTMLImageElement | ImageData | ImageBitmap>;\n"],"mappings":"","ignoreList":[]}
|
package/dist/types/public.d.ts
DELETED
package/dist/types/public.js
DELETED
package/dist/types/public.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","names":[],"sources":["../../src/types/public.ts"],"sourcesContent":["export type {ViewState, ControlPosition} from './common';\nexport type {\n IControl,\n MapInstance,\n MapLib,\n CustomLayerInterface,\n CustomSource,\n CustomSourceImplementation\n} from './lib';\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BackgroundLayerSpecification as BackgroundLayer, CircleLayerSpecification as CircleLayer, FillLayerSpecification as FillLayer, FillExtrusionLayerSpecification as FillExtrusionLayer, HeatmapLayerSpecification as HeatmapLayer, HillshadeLayerSpecification as HillshadeLayer, LineLayerSpecification as LineLayer, RasterLayerSpecification as RasterLayer, SymbolLayerSpecification as SymbolLayer, GeoJSONSourceSpecification as GeoJSONSourceRaw, VideoSourceSpecification as VideoSourceRaw, ImageSourceSpecification as ImageSourceRaw, VectorSourceSpecification as VectorSourceRaw, RasterSourceSpecification as RasterSource, RasterDEMSourceSpecification as RasterDemSource } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
-
import { CanvasSourceSpecification as CanvasSourceRaw } from 'bkoi-gl';
|
|
3
|
-
export type { BackgroundLayer, CircleLayer, FillLayer, FillExtrusionLayer, HeatmapLayer, HillshadeLayer, LineLayer, RasterLayer, SymbolLayer };
|
|
4
|
-
export type AnyLayer = BackgroundLayer | CircleLayer | FillLayer | FillExtrusionLayer | HeatmapLayer | HillshadeLayer | LineLayer | RasterLayer | SymbolLayer;
|
|
5
|
-
export type { GeoJSONSourceRaw, VideoSourceRaw, ImageSourceRaw, CanvasSourceRaw, VectorSourceRaw, RasterSource, RasterDemSource };
|
|
6
|
-
export type AnySource = GeoJSONSourceRaw | VideoSourceRaw | ImageSourceRaw | CanvasSourceRaw | VectorSourceRaw | RasterSource | RasterDemSource;
|
|
7
|
-
export type { StyleSpecification as MapStyle, LightSpecification as Light, TerrainSpecification as Terrain } from '@maplibre/maplibre-gl-style-spec';
|
|
8
|
-
export type Fog = never;
|
|
9
|
-
export type Projection = never;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-spec-bkoi-gl.js","names":[],"sources":["../../src/types/style-spec-bkoi-gl.ts"],"sourcesContent":["/*\n * Maplibre Style Specification types\n * Type names are aligned with mapbox\n */\nimport type {\n BackgroundLayerSpecification as BackgroundLayer,\n CircleLayerSpecification as CircleLayer,\n FillLayerSpecification as FillLayer,\n FillExtrusionLayerSpecification as FillExtrusionLayer,\n HeatmapLayerSpecification as HeatmapLayer,\n HillshadeLayerSpecification as HillshadeLayer,\n LineLayerSpecification as LineLayer,\n RasterLayerSpecification as RasterLayer,\n SymbolLayerSpecification as SymbolLayer,\n GeoJSONSourceSpecification as GeoJSONSourceRaw,\n VideoSourceSpecification as VideoSourceRaw,\n ImageSourceSpecification as ImageSourceRaw,\n VectorSourceSpecification as VectorSourceRaw,\n RasterSourceSpecification as RasterSource,\n RasterDEMSourceSpecification as RasterDemSource\n} from '@maplibre/maplibre-gl-style-spec';\n\n// @ts-ignore\n// eslint-disable-next-line import/no-unresolved\nimport {CanvasSourceSpecification as CanvasSourceRaw} from 'bkoi-gl';\n\n// Layers\nexport type {\n BackgroundLayer,\n CircleLayer,\n FillLayer,\n FillExtrusionLayer,\n HeatmapLayer,\n HillshadeLayer,\n LineLayer,\n RasterLayer,\n SymbolLayer\n};\n\nexport type AnyLayer =\n | BackgroundLayer\n | CircleLayer\n | FillLayer\n | FillExtrusionLayer\n | HeatmapLayer\n | HillshadeLayer\n | LineLayer\n | RasterLayer\n | SymbolLayer;\n\n// Sources\nexport type {\n GeoJSONSourceRaw,\n VideoSourceRaw,\n ImageSourceRaw,\n CanvasSourceRaw,\n VectorSourceRaw,\n RasterSource,\n RasterDemSource\n};\n\nexport type AnySource =\n | GeoJSONSourceRaw\n | VideoSourceRaw\n | ImageSourceRaw\n | CanvasSourceRaw\n | VectorSourceRaw\n | RasterSource\n | RasterDemSource;\n\n// Other style types\n\nexport type {\n StyleSpecification as MapStyle,\n LightSpecification as Light,\n TerrainSpecification as Terrain\n} from '@maplibre/maplibre-gl-style-spec';\n\n// The following types are not yet supported by maplibre\nexport type Fog = never;\nexport type Projection = never;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BackgroundLayer, SkyLayer, CircleLayer, FillLayer, FillExtrusionLayer, HeatmapLayer, HillshadeLayer, LineLayer, RasterLayer, SymbolLayer } from 'mapbox-gl';
|
|
2
|
-
export type AnyLayer = BackgroundLayer | CircleLayer | FillExtrusionLayer | FillLayer | HeatmapLayer | HillshadeLayer | LineLayer | RasterLayer | SymbolLayer | SkyLayer;
|
|
3
|
-
export type { BackgroundLayer, SkyLayer, CircleLayer, FillLayer, FillExtrusionLayer, HeatmapLayer, HillshadeLayer, LineLayer, RasterLayer, SymbolLayer };
|
|
4
|
-
import type { GeoJSONSourceRaw, VideoSourceRaw, ImageSourceRaw, VectorSource as VectorSourceRaw, RasterSource, CanvasSourceRaw, RasterDemSource } from 'mapbox-gl';
|
|
5
|
-
export type AnySource = GeoJSONSourceRaw | VideoSourceRaw | ImageSourceRaw | CanvasSourceRaw | VectorSourceRaw | RasterSource | RasterDemSource;
|
|
6
|
-
export type { GeoJSONSourceRaw, VideoSourceRaw, ImageSourceRaw, CanvasSourceRaw, VectorSourceRaw, RasterSource, RasterDemSource };
|
|
7
|
-
export type { Style as MapStyle, Light, Fog, TerrainSpecification as Terrain, Projection } from 'mapbox-gl';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-spec-mapbox.js","names":[],"sources":["../../src/types/style-spec-mapbox.ts"],"sourcesContent":["/*\n * Mapbox Style Specification types\n */\n// Layers\nimport type {\n BackgroundLayer,\n SkyLayer,\n CircleLayer,\n FillLayer,\n FillExtrusionLayer,\n HeatmapLayer,\n HillshadeLayer,\n LineLayer,\n RasterLayer,\n SymbolLayer\n} from 'mapbox-gl';\n\nexport type AnyLayer =\n | BackgroundLayer\n | CircleLayer\n | FillExtrusionLayer\n | FillLayer\n | HeatmapLayer\n | HillshadeLayer\n | LineLayer\n | RasterLayer\n | SymbolLayer\n | SkyLayer;\n\nexport type {\n BackgroundLayer,\n SkyLayer,\n CircleLayer,\n FillLayer,\n FillExtrusionLayer,\n HeatmapLayer,\n HillshadeLayer,\n LineLayer,\n RasterLayer,\n SymbolLayer\n};\n\n// Sources\nimport type {\n GeoJSONSourceRaw,\n VideoSourceRaw,\n ImageSourceRaw,\n VectorSource as VectorSourceRaw,\n RasterSource,\n CanvasSourceRaw,\n RasterDemSource\n} from 'mapbox-gl';\n\nexport type AnySource =\n | GeoJSONSourceRaw\n | VideoSourceRaw\n | ImageSourceRaw\n | CanvasSourceRaw\n | VectorSourceRaw\n | RasterSource\n | RasterDemSource;\n\nexport type {\n GeoJSONSourceRaw,\n VideoSourceRaw,\n ImageSourceRaw,\n CanvasSourceRaw,\n VectorSourceRaw,\n RasterSource,\n RasterDemSource\n};\n\n// Other\nexport type {\n Style as MapStyle,\n Light,\n Fog,\n TerrainSpecification as Terrain,\n Projection\n} from 'mapbox-gl';\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* global document */
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import {useEffect, memo} from 'react';
|
|
4
|
-
import {applyReactStyle} from '../utils/apply-react-style';
|
|
5
|
-
import useControl from './use-control';
|
|
6
|
-
|
|
7
|
-
import type {ControlPosition, FullscreenControlInstance} from '../types';
|
|
8
|
-
|
|
9
|
-
export type FullscreenControlProps<OptionsT> = Omit<OptionsT, 'container'> & {
|
|
10
|
-
/** Id of the DOM element which should be made full screen. By default, the map container
|
|
11
|
-
* element will be made full screen. */
|
|
12
|
-
containerId?: string;
|
|
13
|
-
/** Placement of the control relative to the map. */
|
|
14
|
-
position?: ControlPosition;
|
|
15
|
-
/** CSS style override, applied to the control's container */
|
|
16
|
-
style?: React.CSSProperties;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function FullscreenControl<FullscreenControlOptions, ControlT extends FullscreenControlInstance>(
|
|
20
|
-
props: FullscreenControlProps<FullscreenControlOptions>
|
|
21
|
-
): null {
|
|
22
|
-
const ctrl = useControl<ControlT>(
|
|
23
|
-
({mapLib}) =>
|
|
24
|
-
new mapLib.FullscreenControl({
|
|
25
|
-
container: props.containerId && document.getElementById(props.containerId)
|
|
26
|
-
}) as ControlT,
|
|
27
|
-
{position: props.position}
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
applyReactStyle(ctrl._controlContainer, props.style);
|
|
32
|
-
}, [props.style]);
|
|
33
|
-
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default memo(FullscreenControl);
|
package/src/exports-bkoi-gl.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Map as BkoiMap,
|
|
4
|
-
MapOptions,
|
|
5
|
-
Marker as BkoiMarker,
|
|
6
|
-
MarkerOptions,
|
|
7
|
-
Popup as BkoiPopup,
|
|
8
|
-
PopupOptions,
|
|
9
|
-
AttributionControl as BkoiAttributionControl,
|
|
10
|
-
FullscreenControl as BkoiFullscreenControl,
|
|
11
|
-
GeolocateControl as BkoiGeolocateControl,
|
|
12
|
-
NavigationControl as BkoiNavigationControl,
|
|
13
|
-
ScaleControl as BkoiScaleControl
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
// eslint-disable-next-line import/no-unresolved
|
|
16
|
-
} from 'bkoi-gl';
|
|
17
|
-
import { MapStyle, AnyLayer, AnySource } from './types/style-spec-bkoi-gl';
|
|
18
|
-
|
|
19
|
-
import { default as _Map, MapProps as _MapProps } from './components/map';
|
|
20
|
-
import { default as _Marker, MarkerProps as _MarkerProps } from './components/marker';
|
|
21
|
-
import { default as _Popup, PopupProps as _PopupProps } from './components/popup';
|
|
22
|
-
import {
|
|
23
|
-
default as _AttributionControl,
|
|
24
|
-
AttributionControlProps as _AttributionControlProps
|
|
25
|
-
} from './components/attribution-control';
|
|
26
|
-
import {
|
|
27
|
-
default as _FullscreenControl,
|
|
28
|
-
FullscreenControlProps as _FullscreenControlProps
|
|
29
|
-
} from './components/fullscreen-control';
|
|
30
|
-
import {
|
|
31
|
-
default as _GeolocateControl,
|
|
32
|
-
GeolocateControlProps as _GeolocateControlProps
|
|
33
|
-
} from './components/geolocate-control';
|
|
34
|
-
import {
|
|
35
|
-
default as _NavigationControl,
|
|
36
|
-
NavigationControlProps as _NavigationControlProps
|
|
37
|
-
} from './components/navigation-control';
|
|
38
|
-
import {
|
|
39
|
-
default as _ScaleControl,
|
|
40
|
-
ScaleControlProps as _ScaleControlProps
|
|
41
|
-
} from './components/scale-control';
|
|
42
|
-
import { default as _Layer, LayerProps as _LayerProps } from './components/layer';
|
|
43
|
-
import { default as _Source, SourceProps as _SourceProps } from './components/source';
|
|
44
|
-
import { useMap as _useMap } from './components/use-map';
|
|
45
|
-
import type { MapRef as _MapRef } from './mapbox/create-ref';
|
|
46
|
-
import type * as events from './types/events';
|
|
47
|
-
import type { MapCallbacks } from './types/events-bkoi-gl';
|
|
48
|
-
|
|
49
|
-
export function useMap() {
|
|
50
|
-
return _useMap<BkoiMap>();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export type MapProps = _MapProps<MapOptions, MapStyle, MapCallbacks, BkoiMap>;
|
|
54
|
-
export type MapRef = _MapRef<BkoiMap>;
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
// eslint-disable-next-line import/no-unresolved
|
|
57
|
-
const mapLib = import('bkoi-gl');
|
|
58
|
-
export const Map = (() => {
|
|
59
|
-
return React.forwardRef(function Map(props: MapProps, ref: React.Ref<MapRef>) {
|
|
60
|
-
return _Map<MapOptions, MapStyle, MapCallbacks, BkoiMap>(props, ref, mapLib);
|
|
61
|
-
});
|
|
62
|
-
})();
|
|
63
|
-
|
|
64
|
-
export type MarkerProps = _MarkerProps<MarkerOptions, BkoiMarker>;
|
|
65
|
-
export const Marker = _Marker as (
|
|
66
|
-
props: MarkerProps & React.RefAttributes<BkoiMarker>
|
|
67
|
-
) => React.ReactElement | null;
|
|
68
|
-
|
|
69
|
-
export type PopupProps = _PopupProps<PopupOptions, BkoiPopup>;
|
|
70
|
-
export const Popup = _Popup as (
|
|
71
|
-
props: PopupProps & React.RefAttributes<BkoiPopup>
|
|
72
|
-
) => React.ReactElement | null;
|
|
73
|
-
|
|
74
|
-
type AttributionControlOptions = ConstructorParameters<typeof BkoiAttributionControl>[0];
|
|
75
|
-
export type AttributionControlProps = _AttributionControlProps<AttributionControlOptions>;
|
|
76
|
-
export const AttributionControl = _AttributionControl as (
|
|
77
|
-
props: AttributionControlProps
|
|
78
|
-
) => React.ReactElement | null;
|
|
79
|
-
|
|
80
|
-
type FullscreenControlOptions = ConstructorParameters<typeof BkoiFullscreenControl>[0];
|
|
81
|
-
export type FullscreenControlProps = _FullscreenControlProps<FullscreenControlOptions>;
|
|
82
|
-
export const FullscreenControl = _FullscreenControl as (
|
|
83
|
-
props: FullscreenControlProps
|
|
84
|
-
) => React.ReactElement | null;
|
|
85
|
-
|
|
86
|
-
type NavigationControlOptions = ConstructorParameters<typeof BkoiNavigationControl>[0];
|
|
87
|
-
export type NavigationControlProps = _NavigationControlProps<NavigationControlOptions>;
|
|
88
|
-
export const NavigationControl = _NavigationControl as (
|
|
89
|
-
props: NavigationControlProps
|
|
90
|
-
) => React.ReactElement | null;
|
|
91
|
-
|
|
92
|
-
type GeolocateControlOptions = ConstructorParameters<typeof BkoiGeolocateControl>[0];
|
|
93
|
-
export type GeolocateControlProps = _GeolocateControlProps<
|
|
94
|
-
GeolocateControlOptions,
|
|
95
|
-
BkoiGeolocateControl
|
|
96
|
-
>;
|
|
97
|
-
export const GeolocateControl = _GeolocateControl as (
|
|
98
|
-
props: GeolocateControlProps & React.RefAttributes<BkoiGeolocateControl>
|
|
99
|
-
) => React.ReactElement | null;
|
|
100
|
-
|
|
101
|
-
type ScaleControlOptions = ConstructorParameters<typeof BkoiScaleControl>[0];
|
|
102
|
-
export type ScaleControlProps = _ScaleControlProps<ScaleControlOptions>;
|
|
103
|
-
export const ScaleControl = _ScaleControl as (
|
|
104
|
-
props: ScaleControlProps
|
|
105
|
-
) => React.ReactElement | null;
|
|
106
|
-
|
|
107
|
-
export type LayerProps = _LayerProps<AnyLayer>;
|
|
108
|
-
export const Layer = _Layer as (props: LayerProps) => React.ReactElement | null;
|
|
109
|
-
|
|
110
|
-
export type SourceProps = _SourceProps<AnySource>;
|
|
111
|
-
export const Source = _Source as (props: SourceProps) => React.ReactElement | null;
|
|
112
|
-
|
|
113
|
-
export { default as useControl } from './components/use-control';
|
|
114
|
-
export { MapProvider } from './components/use-map';
|
|
115
|
-
|
|
116
|
-
export default Map;
|
|
117
|
-
|
|
118
|
-
// Types
|
|
119
|
-
export * from './types/public';
|
|
120
|
-
export type { default as Point } from '@mapbox/point-geometry';
|
|
121
|
-
// export type {
|
|
122
|
-
// PointLike,
|
|
123
|
-
// LngLat,
|
|
124
|
-
// LngLatLike,
|
|
125
|
-
// LngLatBounds,
|
|
126
|
-
// LngLatBoundsLike,
|
|
127
|
-
// PaddingOptions,
|
|
128
|
-
// MapGeoJSONFeature,
|
|
129
|
-
// GeoJSONSource,
|
|
130
|
-
// VideoSource,
|
|
131
|
-
// ImageSource,
|
|
132
|
-
// CanvasSource,
|
|
133
|
-
// VectorTileSource
|
|
134
|
-
// } from 'maplibre-gl';
|
|
135
|
-
export * from './types/style-spec-bkoi-gl';
|
|
136
|
-
|
|
137
|
-
// Events
|
|
138
|
-
export type {
|
|
139
|
-
MapEvent,
|
|
140
|
-
MapMouseEvent,
|
|
141
|
-
MapLayerMouseEvent,
|
|
142
|
-
MapTouchEvent,
|
|
143
|
-
MapLayerTouchEvent,
|
|
144
|
-
MapStyleDataEvent,
|
|
145
|
-
MapSourceDataEvent,
|
|
146
|
-
MapWheelEvent,
|
|
147
|
-
MapBoxZoomEvent,
|
|
148
|
-
ErrorEvent,
|
|
149
|
-
ViewStateChangeEvent
|
|
150
|
-
} from './types/events-bkoi-gl';
|
|
151
|
-
export type PopupEvent = events.PopupEvent<BkoiPopup>;
|
|
152
|
-
export type MarkerEvent = events.MarkerEvent<BkoiMarker>;
|
|
153
|
-
export type MarkerDragEvent = events.MarkerDragEvent<BkoiMarker>;
|
|
154
|
-
export type GeolocateEvent = events.GeolocateEvent<BkoiGeolocateControl>;
|
|
155
|
-
export type GeolocateResultEvent = events.GeolocateResultEvent<BkoiGeolocateControl>;
|
|
156
|
-
export type GeolocateErrorEvent = events.GeolocateErrorEvent<BkoiGeolocateControl>;
|
package/src/exports-mapbox.ts
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
Map as MapboxMap,
|
|
4
|
-
MapboxOptions,
|
|
5
|
-
Marker as MapboxMarker,
|
|
6
|
-
MarkerOptions,
|
|
7
|
-
Popup as MapboxPopup,
|
|
8
|
-
PopupOptions,
|
|
9
|
-
AttributionControl as MapboxAttributionControl,
|
|
10
|
-
FullscreenControl as MapboxFullscreenControl,
|
|
11
|
-
GeolocateControl as MapboxGeolocateControl,
|
|
12
|
-
NavigationControl as MapboxNavigationControl,
|
|
13
|
-
ScaleControl as MapboxScaleControl
|
|
14
|
-
} from 'mapbox-gl';
|
|
15
|
-
import {MapStyle, AnyLayer, AnySource} from './types/style-spec-mapbox';
|
|
16
|
-
|
|
17
|
-
import {default as _Map, MapProps as _MapProps} from './components/map';
|
|
18
|
-
import {default as _Marker, MarkerProps as _MarkerProps} from './components/marker';
|
|
19
|
-
import {default as _Popup, PopupProps as _PopupProps} from './components/popup';
|
|
20
|
-
import {
|
|
21
|
-
default as _AttributionControl,
|
|
22
|
-
AttributionControlProps as _AttributionControlProps
|
|
23
|
-
} from './components/attribution-control';
|
|
24
|
-
import {
|
|
25
|
-
default as _FullscreenControl,
|
|
26
|
-
FullscreenControlProps as _FullscreenControlProps
|
|
27
|
-
} from './components/fullscreen-control';
|
|
28
|
-
import {
|
|
29
|
-
default as _GeolocateControl,
|
|
30
|
-
GeolocateControlProps as _GeolocateControlProps
|
|
31
|
-
} from './components/geolocate-control';
|
|
32
|
-
import {
|
|
33
|
-
default as _NavigationControl,
|
|
34
|
-
NavigationControlProps as _NavigationControlProps
|
|
35
|
-
} from './components/navigation-control';
|
|
36
|
-
import {
|
|
37
|
-
default as _ScaleControl,
|
|
38
|
-
ScaleControlProps as _ScaleControlProps
|
|
39
|
-
} from './components/scale-control';
|
|
40
|
-
import {default as _Layer, LayerProps as _LayerProps} from './components/layer';
|
|
41
|
-
import {default as _Source, SourceProps as _SourceProps} from './components/source';
|
|
42
|
-
import {useMap as _useMap} from './components/use-map';
|
|
43
|
-
import type {MapRef as _MapRef} from './mapbox/create-ref';
|
|
44
|
-
import type * as events from './types/events';
|
|
45
|
-
import type {MapCallbacks} from './types/events-mapbox';
|
|
46
|
-
|
|
47
|
-
export function useMap() {
|
|
48
|
-
return _useMap<MapboxMap>();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export type MapProps = _MapProps<MapboxOptions, MapStyle, MapCallbacks, MapboxMap>;
|
|
52
|
-
export type MapRef = _MapRef<MapboxMap>;
|
|
53
|
-
const mapLib = import('mapbox-gl');
|
|
54
|
-
export const Map = (() => {
|
|
55
|
-
return React.forwardRef(function Map(props: MapProps, ref: React.Ref<MapRef>) {
|
|
56
|
-
return _Map<MapboxOptions, MapStyle, MapCallbacks, MapboxMap>(props, ref, mapLib);
|
|
57
|
-
});
|
|
58
|
-
})();
|
|
59
|
-
|
|
60
|
-
export type MarkerProps = _MarkerProps<MarkerOptions, MapboxMarker>;
|
|
61
|
-
export const Marker = _Marker as (
|
|
62
|
-
props: MarkerProps & React.RefAttributes<MapboxMarker>
|
|
63
|
-
) => React.ReactElement | null;
|
|
64
|
-
|
|
65
|
-
export type PopupProps = _PopupProps<PopupOptions, MapboxPopup>;
|
|
66
|
-
export const Popup = _Popup as (
|
|
67
|
-
props: PopupProps & React.RefAttributes<MapboxPopup>
|
|
68
|
-
) => React.ReactElement | null;
|
|
69
|
-
|
|
70
|
-
type AttributionControlOptions = ConstructorParameters<typeof MapboxAttributionControl>[0];
|
|
71
|
-
export type AttributionControlProps = _AttributionControlProps<AttributionControlOptions>;
|
|
72
|
-
export const AttributionControl = _AttributionControl as (
|
|
73
|
-
props: AttributionControlProps
|
|
74
|
-
) => React.ReactElement | null;
|
|
75
|
-
|
|
76
|
-
type FullscreenControlOptions = ConstructorParameters<typeof MapboxFullscreenControl>[0];
|
|
77
|
-
export type FullscreenControlProps = _FullscreenControlProps<FullscreenControlOptions>;
|
|
78
|
-
export const FullscreenControl = _FullscreenControl as (
|
|
79
|
-
props: FullscreenControlProps
|
|
80
|
-
) => React.ReactElement | null;
|
|
81
|
-
|
|
82
|
-
type NavigationControlOptions = ConstructorParameters<typeof MapboxNavigationControl>[0];
|
|
83
|
-
export type NavigationControlProps = _NavigationControlProps<NavigationControlOptions>;
|
|
84
|
-
export const NavigationControl = _NavigationControl as (
|
|
85
|
-
props: NavigationControlProps
|
|
86
|
-
) => React.ReactElement | null;
|
|
87
|
-
|
|
88
|
-
type GeolocateControlOptions = ConstructorParameters<typeof MapboxGeolocateControl>[0];
|
|
89
|
-
export type GeolocateControlProps = _GeolocateControlProps<
|
|
90
|
-
GeolocateControlOptions,
|
|
91
|
-
MapboxGeolocateControl
|
|
92
|
-
>;
|
|
93
|
-
export const GeolocateControl = _GeolocateControl as (
|
|
94
|
-
props: GeolocateControlProps & React.RefAttributes<MapboxGeolocateControl>
|
|
95
|
-
) => React.ReactElement | null;
|
|
96
|
-
|
|
97
|
-
type ScaleControlOptions = ConstructorParameters<typeof MapboxScaleControl>[0];
|
|
98
|
-
export type ScaleControlProps = _ScaleControlProps<ScaleControlOptions>;
|
|
99
|
-
export const ScaleControl = _ScaleControl as (
|
|
100
|
-
props: ScaleControlProps
|
|
101
|
-
) => React.ReactElement | null;
|
|
102
|
-
|
|
103
|
-
export type LayerProps = _LayerProps<AnyLayer>;
|
|
104
|
-
export const Layer = _Layer as (props: LayerProps) => React.ReactElement | null;
|
|
105
|
-
|
|
106
|
-
export type SourceProps = _SourceProps<AnySource>;
|
|
107
|
-
export const Source = _Source as (props: SourceProps) => React.ReactElement | null;
|
|
108
|
-
|
|
109
|
-
export {default as useControl} from './components/use-control';
|
|
110
|
-
export {MapProvider} from './components/use-map';
|
|
111
|
-
|
|
112
|
-
export default Map;
|
|
113
|
-
|
|
114
|
-
// Types
|
|
115
|
-
export * from './types/public';
|
|
116
|
-
export type {
|
|
117
|
-
Point,
|
|
118
|
-
PointLike,
|
|
119
|
-
LngLat,
|
|
120
|
-
LngLatLike,
|
|
121
|
-
LngLatBounds,
|
|
122
|
-
LngLatBoundsLike,
|
|
123
|
-
PaddingOptions,
|
|
124
|
-
MapboxGeoJSONFeature as MapGeoJSONFeature,
|
|
125
|
-
GeoJSONSource,
|
|
126
|
-
VideoSource,
|
|
127
|
-
ImageSource,
|
|
128
|
-
CanvasSource,
|
|
129
|
-
VectorSourceImpl as VectorTileSource
|
|
130
|
-
} from 'mapbox-gl';
|
|
131
|
-
export * from './types/style-spec-mapbox';
|
|
132
|
-
|
|
133
|
-
// Events
|
|
134
|
-
export type {
|
|
135
|
-
MapEvent,
|
|
136
|
-
MapMouseEvent,
|
|
137
|
-
MapLayerMouseEvent,
|
|
138
|
-
MapTouchEvent,
|
|
139
|
-
MapLayerTouchEvent,
|
|
140
|
-
MapStyleDataEvent,
|
|
141
|
-
MapSourceDataEvent,
|
|
142
|
-
MapWheelEvent,
|
|
143
|
-
MapBoxZoomEvent,
|
|
144
|
-
ErrorEvent,
|
|
145
|
-
ViewStateChangeEvent
|
|
146
|
-
} from './types/events-mapbox';
|
|
147
|
-
export type PopupEvent = events.PopupEvent<MapboxPopup>;
|
|
148
|
-
export type MarkerEvent = events.MarkerEvent<MapboxMarker>;
|
|
149
|
-
export type MarkerDragEvent = events.MarkerDragEvent<MapboxMarker>;
|
|
150
|
-
export type GeolocateEvent = events.GeolocateEvent<MapboxGeolocateControl>;
|
|
151
|
-
export type GeolocateResultEvent = events.GeolocateResultEvent<MapboxGeolocateControl>;
|
|
152
|
-
export type GeolocateErrorEvent = events.GeolocateErrorEvent<MapboxGeolocateControl>;
|
|
153
|
-
|
|
154
|
-
// v7.0 backward compatibility
|
|
155
|
-
|
|
156
|
-
/** @deprecated use `MapStyle` */
|
|
157
|
-
export type MapboxStyle = MapStyle;
|
|
158
|
-
|
|
159
|
-
export type {Map as MapboxMap, MapboxEvent, MapboxGeoJSONFeature} from 'mapbox-gl';
|