react-bkoi-gl 1.0.7 → 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,89 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Map as BkoiMap, MapOptions, Marker as BkoiMarker, MarkerOptions, Popup as BkoiPopup, PopupOptions, AttributionControl as BkoiAttributionControl, FullscreenControl as BkoiFullscreenControl, GeolocateControl as BkoiGeolocateControl, NavigationControl as BkoiNavigationControl, ScaleControl as BkoiScaleControl } from 'bkoi-gl';
|
|
3
|
-
import { MapStyle, AnyLayer, AnySource } from './types/style-spec-bkoi-gl';
|
|
4
|
-
import { MapProps as _MapProps } from './components/map';
|
|
5
|
-
import { MarkerProps as _MarkerProps } from './components/marker';
|
|
6
|
-
import { PopupProps as _PopupProps } from './components/popup';
|
|
7
|
-
import { AttributionControlProps as _AttributionControlProps } from './components/attribution-control';
|
|
8
|
-
import { FullscreenControlProps as _FullscreenControlProps } from './components/fullscreen-control';
|
|
9
|
-
import { GeolocateControlProps as _GeolocateControlProps } from './components/geolocate-control';
|
|
10
|
-
import { NavigationControlProps as _NavigationControlProps } from './components/navigation-control';
|
|
11
|
-
import { ScaleControlProps as _ScaleControlProps } from './components/scale-control';
|
|
12
|
-
import { LayerProps as _LayerProps } from './components/layer';
|
|
13
|
-
import { SourceProps as _SourceProps } from './components/source';
|
|
14
|
-
import type { MapRef as _MapRef } from './mapbox/create-ref';
|
|
15
|
-
import type * as events from './types/events';
|
|
16
|
-
import type { MapCallbacks } from './types/events-bkoi-gl';
|
|
17
|
-
export declare function useMap(): import("./components/use-map").MapCollection<BkoiMap>;
|
|
18
|
-
export type MapProps = _MapProps<MapOptions, MapStyle, MapCallbacks, BkoiMap>;
|
|
19
|
-
export type MapRef = _MapRef<BkoiMap>;
|
|
20
|
-
export declare const Map: React.ForwardRefExoticComponent<Pick<{
|
|
21
|
-
[x: string]: MapOptions;
|
|
22
|
-
[x: number]: MapOptions;
|
|
23
|
-
[x: symbol]: MapOptions;
|
|
24
|
-
} & Partial<import("./types/common").ViewState> & MapCallbacks & {
|
|
25
|
-
mapboxAccessToken?: string;
|
|
26
|
-
initialViewState?: Partial<import("./types/common").ViewState> & {
|
|
27
|
-
bounds?: import("./types").LngLatBoundsLike;
|
|
28
|
-
fitBoundsOptions?: {
|
|
29
|
-
offset?: import("./types").PointLike;
|
|
30
|
-
minZoom?: number;
|
|
31
|
-
maxZoom?: number;
|
|
32
|
-
padding?: number | import("./types").PaddingOptions;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
gl?: WebGLRenderingContext;
|
|
36
|
-
viewState?: import("./types/common").ViewState & {
|
|
37
|
-
width: number;
|
|
38
|
-
height: number;
|
|
39
|
-
};
|
|
40
|
-
mapStyle?: string | MapStyle | import("./types").ImmutableLike<MapStyle>;
|
|
41
|
-
styleDiffing?: boolean;
|
|
42
|
-
fog?: unknown;
|
|
43
|
-
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification;
|
|
44
|
-
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification;
|
|
45
|
-
interactiveLayerIds?: string[];
|
|
46
|
-
cursor?: string;
|
|
47
|
-
} & import("./utils/set-globals").GlobalSettings & {
|
|
48
|
-
mapLib?: import("./types/lib").MapLib<BkoiMap> | Promise<import("./types/lib").MapLib<BkoiMap>>;
|
|
49
|
-
reuseMaps?: boolean;
|
|
50
|
-
id?: string;
|
|
51
|
-
style?: React.CSSProperties;
|
|
52
|
-
children?: any;
|
|
53
|
-
}, string | number | symbol> & React.RefAttributes<MapRef>>;
|
|
54
|
-
export type MarkerProps = _MarkerProps<MarkerOptions, BkoiMarker>;
|
|
55
|
-
export declare const Marker: (props: MarkerProps & React.RefAttributes<BkoiMarker>) => React.ReactElement | null;
|
|
56
|
-
export type PopupProps = _PopupProps<PopupOptions, BkoiPopup>;
|
|
57
|
-
export declare const Popup: (props: PopupProps & React.RefAttributes<BkoiPopup>) => React.ReactElement | null;
|
|
58
|
-
type AttributionControlOptions = ConstructorParameters<typeof BkoiAttributionControl>[0];
|
|
59
|
-
export type AttributionControlProps = _AttributionControlProps<AttributionControlOptions>;
|
|
60
|
-
export declare const AttributionControl: (props: AttributionControlProps) => React.ReactElement | null;
|
|
61
|
-
type FullscreenControlOptions = ConstructorParameters<typeof BkoiFullscreenControl>[0];
|
|
62
|
-
export type FullscreenControlProps = _FullscreenControlProps<FullscreenControlOptions>;
|
|
63
|
-
export declare const FullscreenControl: (props: FullscreenControlProps) => React.ReactElement | null;
|
|
64
|
-
type NavigationControlOptions = ConstructorParameters<typeof BkoiNavigationControl>[0];
|
|
65
|
-
export type NavigationControlProps = _NavigationControlProps<NavigationControlOptions>;
|
|
66
|
-
export declare const NavigationControl: (props: NavigationControlProps) => React.ReactElement | null;
|
|
67
|
-
type GeolocateControlOptions = ConstructorParameters<typeof BkoiGeolocateControl>[0];
|
|
68
|
-
export type GeolocateControlProps = _GeolocateControlProps<GeolocateControlOptions, BkoiGeolocateControl>;
|
|
69
|
-
export declare const GeolocateControl: (props: GeolocateControlProps & React.RefAttributes<BkoiGeolocateControl>) => React.ReactElement | null;
|
|
70
|
-
type ScaleControlOptions = ConstructorParameters<typeof BkoiScaleControl>[0];
|
|
71
|
-
export type ScaleControlProps = _ScaleControlProps<ScaleControlOptions>;
|
|
72
|
-
export declare const ScaleControl: (props: ScaleControlProps) => React.ReactElement | null;
|
|
73
|
-
export type LayerProps = _LayerProps<AnyLayer>;
|
|
74
|
-
export declare const Layer: (props: LayerProps) => React.ReactElement | null;
|
|
75
|
-
export type SourceProps = _SourceProps<AnySource>;
|
|
76
|
-
export declare const Source: (props: SourceProps) => React.ReactElement | null;
|
|
77
|
-
export { default as useControl } from './components/use-control';
|
|
78
|
-
export { MapProvider } from './components/use-map';
|
|
79
|
-
export default Map;
|
|
80
|
-
export * from './types/public';
|
|
81
|
-
export type { default as Point } from '@mapbox/point-geometry';
|
|
82
|
-
export * from './types/style-spec-bkoi-gl';
|
|
83
|
-
export type { MapEvent, MapMouseEvent, MapLayerMouseEvent, MapTouchEvent, MapLayerTouchEvent, MapStyleDataEvent, MapSourceDataEvent, MapWheelEvent, MapBoxZoomEvent, ErrorEvent, ViewStateChangeEvent } from './types/events-bkoi-gl';
|
|
84
|
-
export type PopupEvent = events.PopupEvent<BkoiPopup>;
|
|
85
|
-
export type MarkerEvent = events.MarkerEvent<BkoiMarker>;
|
|
86
|
-
export type MarkerDragEvent = events.MarkerDragEvent<BkoiMarker>;
|
|
87
|
-
export type GeolocateEvent = events.GeolocateEvent<BkoiGeolocateControl>;
|
|
88
|
-
export type GeolocateResultEvent = events.GeolocateResultEvent<BkoiGeolocateControl>;
|
|
89
|
-
export type GeolocateErrorEvent = events.GeolocateErrorEvent<BkoiGeolocateControl>;
|
package/dist/exports-bkoi-gl.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { default as _Map } from "./components/map.js";
|
|
3
|
-
import { default as _Marker } from "./components/marker.js";
|
|
4
|
-
import { default as _Popup } from "./components/popup.js";
|
|
5
|
-
import { default as _AttributionControl } from "./components/attribution-control.js";
|
|
6
|
-
import { default as _FullscreenControl } from "./components/fullscreen-control.js";
|
|
7
|
-
import { default as _GeolocateControl } from "./components/geolocate-control.js";
|
|
8
|
-
import { default as _NavigationControl } from "./components/navigation-control.js";
|
|
9
|
-
import { default as _ScaleControl } from "./components/scale-control.js";
|
|
10
|
-
import { default as _Layer } from "./components/layer.js";
|
|
11
|
-
import { default as _Source } from "./components/source.js";
|
|
12
|
-
import { useMap as _useMap } from "./components/use-map.js";
|
|
13
|
-
export function useMap() {
|
|
14
|
-
return _useMap();
|
|
15
|
-
}
|
|
16
|
-
const mapLib = import('bkoi-gl');
|
|
17
|
-
export const Map = (() => {
|
|
18
|
-
return React.forwardRef(function Map(props, ref) {
|
|
19
|
-
return _Map(props, ref, mapLib);
|
|
20
|
-
});
|
|
21
|
-
})();
|
|
22
|
-
export const Marker = _Marker;
|
|
23
|
-
export const Popup = _Popup;
|
|
24
|
-
export const AttributionControl = _AttributionControl;
|
|
25
|
-
export const FullscreenControl = _FullscreenControl;
|
|
26
|
-
export const NavigationControl = _NavigationControl;
|
|
27
|
-
export const GeolocateControl = _GeolocateControl;
|
|
28
|
-
export const ScaleControl = _ScaleControl;
|
|
29
|
-
export const Layer = _Layer;
|
|
30
|
-
export const Source = _Source;
|
|
31
|
-
export { default as useControl } from "./components/use-control.js";
|
|
32
|
-
export { MapProvider } from "./components/use-map.js";
|
|
33
|
-
export default Map;
|
|
34
|
-
export * from "./types/public.js";
|
|
35
|
-
export * from "./types/style-spec-bkoi-gl.js";
|
|
36
|
-
//# sourceMappingURL=exports-bkoi-gl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exports-bkoi-gl.js","names":["React","default","_Map","_Marker","_Popup","_AttributionControl","_FullscreenControl","_GeolocateControl","_NavigationControl","_ScaleControl","_Layer","_Source","useMap","_useMap","mapLib","Map","forwardRef","props","ref","Marker","Popup","AttributionControl","FullscreenControl","NavigationControl","GeolocateControl","ScaleControl","Layer","Source","useControl","MapProvider"],"sources":["../src/exports-bkoi-gl.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n Map as BkoiMap,\n MapOptions,\n Marker as BkoiMarker,\n MarkerOptions,\n Popup as BkoiPopup,\n PopupOptions,\n AttributionControl as BkoiAttributionControl,\n FullscreenControl as BkoiFullscreenControl,\n GeolocateControl as BkoiGeolocateControl,\n NavigationControl as BkoiNavigationControl,\n ScaleControl as BkoiScaleControl\n // @ts-ignore\n// eslint-disable-next-line import/no-unresolved\n} from 'bkoi-gl';\nimport { MapStyle, AnyLayer, AnySource } from './types/style-spec-bkoi-gl';\n\nimport { default as _Map, MapProps as _MapProps } from './components/map';\nimport { default as _Marker, MarkerProps as _MarkerProps } from './components/marker';\nimport { default as _Popup, PopupProps as _PopupProps } from './components/popup';\nimport {\n default as _AttributionControl,\n AttributionControlProps as _AttributionControlProps\n} from './components/attribution-control';\nimport {\n default as _FullscreenControl,\n FullscreenControlProps as _FullscreenControlProps\n} from './components/fullscreen-control';\nimport {\n default as _GeolocateControl,\n GeolocateControlProps as _GeolocateControlProps\n} from './components/geolocate-control';\nimport {\n default as _NavigationControl,\n NavigationControlProps as _NavigationControlProps\n} from './components/navigation-control';\nimport {\n default as _ScaleControl,\n ScaleControlProps as _ScaleControlProps\n} from './components/scale-control';\nimport { default as _Layer, LayerProps as _LayerProps } from './components/layer';\nimport { default as _Source, SourceProps as _SourceProps } from './components/source';\nimport { useMap as _useMap } from './components/use-map';\nimport type { MapRef as _MapRef } from './mapbox/create-ref';\nimport type * as events from './types/events';\nimport type { MapCallbacks } from './types/events-bkoi-gl';\n\nexport function useMap() {\n return _useMap<BkoiMap>();\n}\n\nexport type MapProps = _MapProps<MapOptions, MapStyle, MapCallbacks, BkoiMap>;\nexport type MapRef = _MapRef<BkoiMap>;\n// @ts-ignore\n// eslint-disable-next-line import/no-unresolved\nconst mapLib = import('bkoi-gl');\nexport const Map = (() => {\n return React.forwardRef(function Map(props: MapProps, ref: React.Ref<MapRef>) {\n return _Map<MapOptions, MapStyle, MapCallbacks, BkoiMap>(props, ref, mapLib);\n });\n})();\n\nexport type MarkerProps = _MarkerProps<MarkerOptions, BkoiMarker>;\nexport const Marker = _Marker as (\n props: MarkerProps & React.RefAttributes<BkoiMarker>\n) => React.ReactElement | null;\n\nexport type PopupProps = _PopupProps<PopupOptions, BkoiPopup>;\nexport const Popup = _Popup as (\n props: PopupProps & React.RefAttributes<BkoiPopup>\n) => React.ReactElement | null;\n\ntype AttributionControlOptions = ConstructorParameters<typeof BkoiAttributionControl>[0];\nexport type AttributionControlProps = _AttributionControlProps<AttributionControlOptions>;\nexport const AttributionControl = _AttributionControl as (\n props: AttributionControlProps\n) => React.ReactElement | null;\n\ntype FullscreenControlOptions = ConstructorParameters<typeof BkoiFullscreenControl>[0];\nexport type FullscreenControlProps = _FullscreenControlProps<FullscreenControlOptions>;\nexport const FullscreenControl = _FullscreenControl as (\n props: FullscreenControlProps\n) => React.ReactElement | null;\n\ntype NavigationControlOptions = ConstructorParameters<typeof BkoiNavigationControl>[0];\nexport type NavigationControlProps = _NavigationControlProps<NavigationControlOptions>;\nexport const NavigationControl = _NavigationControl as (\n props: NavigationControlProps\n) => React.ReactElement | null;\n\ntype GeolocateControlOptions = ConstructorParameters<typeof BkoiGeolocateControl>[0];\nexport type GeolocateControlProps = _GeolocateControlProps<\n GeolocateControlOptions,\n BkoiGeolocateControl\n>;\nexport const GeolocateControl = _GeolocateControl as (\n props: GeolocateControlProps & React.RefAttributes<BkoiGeolocateControl>\n) => React.ReactElement | null;\n\ntype ScaleControlOptions = ConstructorParameters<typeof BkoiScaleControl>[0];\nexport type ScaleControlProps = _ScaleControlProps<ScaleControlOptions>;\nexport const ScaleControl = _ScaleControl as (\n props: ScaleControlProps\n) => React.ReactElement | null;\n\nexport type LayerProps = _LayerProps<AnyLayer>;\nexport const Layer = _Layer as (props: LayerProps) => React.ReactElement | null;\n\nexport type SourceProps = _SourceProps<AnySource>;\nexport const Source = _Source as (props: SourceProps) => React.ReactElement | null;\n\nexport { default as useControl } from './components/use-control';\nexport { MapProvider } from './components/use-map';\n\nexport default Map;\n\n// Types\nexport * from './types/public';\nexport type { default as Point } from '@mapbox/point-geometry';\n// export type {\n// PointLike,\n// LngLat,\n// LngLatLike,\n// LngLatBounds,\n// LngLatBoundsLike,\n// PaddingOptions,\n// MapGeoJSONFeature,\n// GeoJSONSource,\n// VideoSource,\n// ImageSource,\n// CanvasSource,\n// VectorTileSource\n// } from 'maplibre-gl';\nexport * from './types/style-spec-bkoi-gl';\n\n// Events\nexport type {\n MapEvent,\n MapMouseEvent,\n MapLayerMouseEvent,\n MapTouchEvent,\n MapLayerTouchEvent,\n MapStyleDataEvent,\n MapSourceDataEvent,\n MapWheelEvent,\n MapBoxZoomEvent,\n ErrorEvent,\n ViewStateChangeEvent\n} from './types/events-bkoi-gl';\nexport type PopupEvent = events.PopupEvent<BkoiPopup>;\nexport type MarkerEvent = events.MarkerEvent<BkoiMarker>;\nexport type MarkerDragEvent = events.MarkerDragEvent<BkoiMarker>;\nexport type GeolocateEvent = events.GeolocateEvent<BkoiGeolocateControl>;\nexport type GeolocateResultEvent = events.GeolocateResultEvent<BkoiGeolocateControl>;\nexport type GeolocateErrorEvent = events.GeolocateErrorEvent<BkoiGeolocateControl>;\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC,SAkBtBC,OAAO,IAAIC,IAAI;AAAA,SACfD,OAAO,IAAIE,OAAO;AAAA,SAClBF,OAAO,IAAIG,MAAM;AAAA,SAExBH,OAAO,IAAII,mBAAmB;AAAA,SAI9BJ,OAAO,IAAIK,kBAAkB;AAAA,SAI7BL,OAAO,IAAIM,iBAAiB;AAAA,SAI5BN,OAAO,IAAIO,kBAAkB;AAAA,SAI7BP,OAAO,IAAIQ,aAAa;AAAA,SAGjBR,OAAO,IAAIS,MAAM;AAAA,SACjBT,OAAO,IAAIU,OAAO;AAAA,SAClBC,MAAM,IAAIC,OAAO;AAK1B,OAAO,SAASD,MAAMA,CAAA,EAAG;EACvB,OAAOC,OAAO,CAAU,CAAC;AAC3B;AAMA,MAAMC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAChC,OAAO,MAAMC,GAAG,GAAG,CAAC,MAAM;EACxB,OAAOf,KAAK,CAACgB,UAAU,CAAC,SAASD,GAAGA,CAACE,KAAe,EAAEC,GAAsB,EAAE;IAC5E,OAAOhB,IAAI,CAA8Ce,KAAK,EAAEC,GAAG,EAAEJ,MAAM,CAAC;EAC9E,CAAC,CAAC;AACJ,CAAC,EAAE,CAAC;AAGJ,OAAO,MAAMK,MAAM,GAAGhB,OAEQ;AAG9B,OAAO,MAAMiB,KAAK,GAAGhB,MAES;AAI9B,OAAO,MAAMiB,kBAAkB,GAAGhB,mBAEJ;AAI9B,OAAO,MAAMiB,iBAAiB,GAAGhB,kBAEH;AAI9B,OAAO,MAAMiB,iBAAiB,GAAGf,kBAEH;AAO9B,OAAO,MAAMgB,gBAAgB,GAAGjB,iBAEF;AAI9B,OAAO,MAAMkB,YAAY,GAAGhB,aAEE;AAG9B,OAAO,MAAMiB,KAAK,GAAGhB,MAA0D;AAG/E,OAAO,MAAMiB,MAAM,GAAGhB,OAA4D;AAAC,SAE1EV,OAAO,IAAI2B,UAAU;AAAA,SACrBC,WAAW;AAEpB,eAAed,GAAG;AAAC;AAAA","ignoreList":[]}
|
package/dist/exports-mapbox.d.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Map as MapboxMap, MapboxOptions, Marker as MapboxMarker, MarkerOptions, Popup as MapboxPopup, PopupOptions, AttributionControl as MapboxAttributionControl, FullscreenControl as MapboxFullscreenControl, GeolocateControl as MapboxGeolocateControl, NavigationControl as MapboxNavigationControl, ScaleControl as MapboxScaleControl } from 'mapbox-gl';
|
|
3
|
-
import { MapStyle, AnyLayer, AnySource } from './types/style-spec-mapbox';
|
|
4
|
-
import { MapProps as _MapProps } from './components/map';
|
|
5
|
-
import { MarkerProps as _MarkerProps } from './components/marker';
|
|
6
|
-
import { PopupProps as _PopupProps } from './components/popup';
|
|
7
|
-
import { AttributionControlProps as _AttributionControlProps } from './components/attribution-control';
|
|
8
|
-
import { FullscreenControlProps as _FullscreenControlProps } from './components/fullscreen-control';
|
|
9
|
-
import { GeolocateControlProps as _GeolocateControlProps } from './components/geolocate-control';
|
|
10
|
-
import { NavigationControlProps as _NavigationControlProps } from './components/navigation-control';
|
|
11
|
-
import { ScaleControlProps as _ScaleControlProps } from './components/scale-control';
|
|
12
|
-
import { LayerProps as _LayerProps } from './components/layer';
|
|
13
|
-
import { SourceProps as _SourceProps } from './components/source';
|
|
14
|
-
import type { MapRef as _MapRef } from './mapbox/create-ref';
|
|
15
|
-
import type * as events from './types/events';
|
|
16
|
-
import type { MapCallbacks } from './types/events-mapbox';
|
|
17
|
-
export declare function useMap(): import("./components/use-map").MapCollection<MapboxMap>;
|
|
18
|
-
export type MapProps = _MapProps<MapboxOptions, MapStyle, MapCallbacks, MapboxMap>;
|
|
19
|
-
export type MapRef = _MapRef<MapboxMap>;
|
|
20
|
-
export declare const Map: React.ForwardRefExoticComponent<{
|
|
21
|
-
zoom?: number;
|
|
22
|
-
pitch?: number;
|
|
23
|
-
bearing?: number;
|
|
24
|
-
interactive?: boolean;
|
|
25
|
-
minZoom?: number;
|
|
26
|
-
maxZoom?: number;
|
|
27
|
-
minPitch?: number;
|
|
28
|
-
maxPitch?: number;
|
|
29
|
-
maxBounds?: import("mapbox-gl").LngLatBoundsLike;
|
|
30
|
-
projection?: import("mapbox-gl").Projection | "albers" | "equalEarth" | "equirectangular" | "lambertConformalConic" | "mercator" | "naturalEarth" | "winkelTripel" | "globe";
|
|
31
|
-
renderWorldCopies?: boolean;
|
|
32
|
-
scrollZoom?: boolean | import("mapbox-gl").InteractiveOptions;
|
|
33
|
-
boxZoom?: boolean;
|
|
34
|
-
dragRotate?: boolean;
|
|
35
|
-
dragPan?: boolean | import("mapbox-gl").DragPanOptions;
|
|
36
|
-
keyboard?: boolean;
|
|
37
|
-
doubleClickZoom?: boolean;
|
|
38
|
-
touchZoomRotate?: boolean | import("mapbox-gl").InteractiveOptions;
|
|
39
|
-
touchPitch?: boolean | import("mapbox-gl").InteractiveOptions;
|
|
40
|
-
accessToken?: string;
|
|
41
|
-
localIdeographFontFamily?: string;
|
|
42
|
-
config?: Record<string, unknown>;
|
|
43
|
-
antialias?: boolean;
|
|
44
|
-
attributionControl?: boolean;
|
|
45
|
-
bearingSnap?: number;
|
|
46
|
-
clickTolerance?: number;
|
|
47
|
-
collectResourceTiming?: boolean;
|
|
48
|
-
crossSourceCollisions?: boolean;
|
|
49
|
-
cooperativeGestures?: boolean;
|
|
50
|
-
customAttribution?: string | string[];
|
|
51
|
-
hash?: string | boolean;
|
|
52
|
-
fadeDuration?: number;
|
|
53
|
-
failIfMajorPerformanceCaveat?: boolean;
|
|
54
|
-
language?: string | string[];
|
|
55
|
-
locale?: {
|
|
56
|
-
[key: string]: string;
|
|
57
|
-
};
|
|
58
|
-
localFontFamily?: string;
|
|
59
|
-
logoPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
60
|
-
maxTileCacheSize?: number;
|
|
61
|
-
minTileCacheSize?: number;
|
|
62
|
-
performanceMetricsCollection?: boolean;
|
|
63
|
-
preserveDrawingBuffer?: boolean;
|
|
64
|
-
pitchWithRotate?: boolean;
|
|
65
|
-
refreshExpiredTiles?: boolean;
|
|
66
|
-
respectPrefersReducedMotion?: boolean;
|
|
67
|
-
testMode?: boolean;
|
|
68
|
-
trackResize?: boolean;
|
|
69
|
-
transformRequest?: import("mapbox-gl").TransformRequestFunction;
|
|
70
|
-
worldview?: string;
|
|
71
|
-
} & Partial<import("./types/common").ViewState> & MapCallbacks & {
|
|
72
|
-
mapboxAccessToken?: string;
|
|
73
|
-
initialViewState?: Partial<import("./types/common").ViewState> & {
|
|
74
|
-
bounds?: import("./types").LngLatBoundsLike;
|
|
75
|
-
fitBoundsOptions?: {
|
|
76
|
-
offset?: import("./types").PointLike;
|
|
77
|
-
minZoom?: number;
|
|
78
|
-
maxZoom?: number;
|
|
79
|
-
padding?: number | import("./types").PaddingOptions;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
gl?: WebGLRenderingContext;
|
|
83
|
-
viewState?: import("./types/common").ViewState & {
|
|
84
|
-
width: number;
|
|
85
|
-
height: number;
|
|
86
|
-
};
|
|
87
|
-
mapStyle?: string | MapStyle | import("./types").ImmutableLike<MapStyle>;
|
|
88
|
-
styleDiffing?: boolean;
|
|
89
|
-
fog?: import("mapbox-gl").Fog;
|
|
90
|
-
light?: import("mapbox-gl").Light;
|
|
91
|
-
terrain?: import("mapbox-gl").TerrainSpecification;
|
|
92
|
-
interactiveLayerIds?: string[];
|
|
93
|
-
cursor?: string;
|
|
94
|
-
} & import("./utils/set-globals").GlobalSettings & {
|
|
95
|
-
mapLib?: import("./types/lib").MapLib<MapboxMap> | Promise<import("./types/lib").MapLib<MapboxMap>>;
|
|
96
|
-
reuseMaps?: boolean;
|
|
97
|
-
id?: string;
|
|
98
|
-
style?: React.CSSProperties;
|
|
99
|
-
children?: any;
|
|
100
|
-
} & React.RefAttributes<MapRef>>;
|
|
101
|
-
export type MarkerProps = _MarkerProps<MarkerOptions, MapboxMarker>;
|
|
102
|
-
export declare const Marker: (props: MarkerProps & React.RefAttributes<MapboxMarker>) => React.ReactElement | null;
|
|
103
|
-
export type PopupProps = _PopupProps<PopupOptions, MapboxPopup>;
|
|
104
|
-
export declare const Popup: (props: PopupProps & React.RefAttributes<MapboxPopup>) => React.ReactElement | null;
|
|
105
|
-
type AttributionControlOptions = ConstructorParameters<typeof MapboxAttributionControl>[0];
|
|
106
|
-
export type AttributionControlProps = _AttributionControlProps<AttributionControlOptions>;
|
|
107
|
-
export declare const AttributionControl: (props: AttributionControlProps) => React.ReactElement | null;
|
|
108
|
-
type FullscreenControlOptions = ConstructorParameters<typeof MapboxFullscreenControl>[0];
|
|
109
|
-
export type FullscreenControlProps = _FullscreenControlProps<FullscreenControlOptions>;
|
|
110
|
-
export declare const FullscreenControl: (props: FullscreenControlProps) => React.ReactElement | null;
|
|
111
|
-
type NavigationControlOptions = ConstructorParameters<typeof MapboxNavigationControl>[0];
|
|
112
|
-
export type NavigationControlProps = _NavigationControlProps<NavigationControlOptions>;
|
|
113
|
-
export declare const NavigationControl: (props: NavigationControlProps) => React.ReactElement | null;
|
|
114
|
-
type GeolocateControlOptions = ConstructorParameters<typeof MapboxGeolocateControl>[0];
|
|
115
|
-
export type GeolocateControlProps = _GeolocateControlProps<GeolocateControlOptions, MapboxGeolocateControl>;
|
|
116
|
-
export declare const GeolocateControl: (props: GeolocateControlProps & React.RefAttributes<MapboxGeolocateControl>) => React.ReactElement | null;
|
|
117
|
-
type ScaleControlOptions = ConstructorParameters<typeof MapboxScaleControl>[0];
|
|
118
|
-
export type ScaleControlProps = _ScaleControlProps<ScaleControlOptions>;
|
|
119
|
-
export declare const ScaleControl: (props: ScaleControlProps) => React.ReactElement | null;
|
|
120
|
-
export type LayerProps = _LayerProps<AnyLayer>;
|
|
121
|
-
export declare const Layer: (props: LayerProps) => React.ReactElement | null;
|
|
122
|
-
export type SourceProps = _SourceProps<AnySource>;
|
|
123
|
-
export declare const Source: (props: SourceProps) => React.ReactElement | null;
|
|
124
|
-
export { default as useControl } from './components/use-control';
|
|
125
|
-
export { MapProvider } from './components/use-map';
|
|
126
|
-
export default Map;
|
|
127
|
-
export * from './types/public';
|
|
128
|
-
export type { Point, PointLike, LngLat, LngLatLike, LngLatBounds, LngLatBoundsLike, PaddingOptions, MapboxGeoJSONFeature as MapGeoJSONFeature, GeoJSONSource, VideoSource, ImageSource, CanvasSource, VectorSourceImpl as VectorTileSource } from 'mapbox-gl';
|
|
129
|
-
export * from './types/style-spec-mapbox';
|
|
130
|
-
export type { MapEvent, MapMouseEvent, MapLayerMouseEvent, MapTouchEvent, MapLayerTouchEvent, MapStyleDataEvent, MapSourceDataEvent, MapWheelEvent, MapBoxZoomEvent, ErrorEvent, ViewStateChangeEvent } from './types/events-mapbox';
|
|
131
|
-
export type PopupEvent = events.PopupEvent<MapboxPopup>;
|
|
132
|
-
export type MarkerEvent = events.MarkerEvent<MapboxMarker>;
|
|
133
|
-
export type MarkerDragEvent = events.MarkerDragEvent<MapboxMarker>;
|
|
134
|
-
export type GeolocateEvent = events.GeolocateEvent<MapboxGeolocateControl>;
|
|
135
|
-
export type GeolocateResultEvent = events.GeolocateResultEvent<MapboxGeolocateControl>;
|
|
136
|
-
export type GeolocateErrorEvent = events.GeolocateErrorEvent<MapboxGeolocateControl>;
|
|
137
|
-
/** @deprecated use `MapStyle` */
|
|
138
|
-
export type MapboxStyle = MapStyle;
|
|
139
|
-
export type { Map as MapboxMap, MapboxEvent, MapboxGeoJSONFeature } from 'mapbox-gl';
|
package/dist/exports-mapbox.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { default as _Map } from "./components/map.js";
|
|
3
|
-
import { default as _Marker } from "./components/marker.js";
|
|
4
|
-
import { default as _Popup } from "./components/popup.js";
|
|
5
|
-
import { default as _AttributionControl } from "./components/attribution-control.js";
|
|
6
|
-
import { default as _FullscreenControl } from "./components/fullscreen-control.js";
|
|
7
|
-
import { default as _GeolocateControl } from "./components/geolocate-control.js";
|
|
8
|
-
import { default as _NavigationControl } from "./components/navigation-control.js";
|
|
9
|
-
import { default as _ScaleControl } from "./components/scale-control.js";
|
|
10
|
-
import { default as _Layer } from "./components/layer.js";
|
|
11
|
-
import { default as _Source } from "./components/source.js";
|
|
12
|
-
import { useMap as _useMap } from "./components/use-map.js";
|
|
13
|
-
export function useMap() {
|
|
14
|
-
return _useMap();
|
|
15
|
-
}
|
|
16
|
-
const mapLib = import('mapbox-gl');
|
|
17
|
-
export const Map = (() => {
|
|
18
|
-
return React.forwardRef(function Map(props, ref) {
|
|
19
|
-
return _Map(props, ref, mapLib);
|
|
20
|
-
});
|
|
21
|
-
})();
|
|
22
|
-
export const Marker = _Marker;
|
|
23
|
-
export const Popup = _Popup;
|
|
24
|
-
export const AttributionControl = _AttributionControl;
|
|
25
|
-
export const FullscreenControl = _FullscreenControl;
|
|
26
|
-
export const NavigationControl = _NavigationControl;
|
|
27
|
-
export const GeolocateControl = _GeolocateControl;
|
|
28
|
-
export const ScaleControl = _ScaleControl;
|
|
29
|
-
export const Layer = _Layer;
|
|
30
|
-
export const Source = _Source;
|
|
31
|
-
export { default as useControl } from "./components/use-control.js";
|
|
32
|
-
export { MapProvider } from "./components/use-map.js";
|
|
33
|
-
export default Map;
|
|
34
|
-
export * from "./types/public.js";
|
|
35
|
-
export * from "./types/style-spec-mapbox.js";
|
|
36
|
-
//# sourceMappingURL=exports-mapbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exports-mapbox.js","names":["React","default","_Map","_Marker","_Popup","_AttributionControl","_FullscreenControl","_GeolocateControl","_NavigationControl","_ScaleControl","_Layer","_Source","useMap","_useMap","mapLib","Map","forwardRef","props","ref","Marker","Popup","AttributionControl","FullscreenControl","NavigationControl","GeolocateControl","ScaleControl","Layer","Source","useControl","MapProvider"],"sources":["../src/exports-mapbox.ts"],"sourcesContent":["import * as React from 'react';\nimport type {\n Map as MapboxMap,\n MapboxOptions,\n Marker as MapboxMarker,\n MarkerOptions,\n Popup as MapboxPopup,\n PopupOptions,\n AttributionControl as MapboxAttributionControl,\n FullscreenControl as MapboxFullscreenControl,\n GeolocateControl as MapboxGeolocateControl,\n NavigationControl as MapboxNavigationControl,\n ScaleControl as MapboxScaleControl\n} from 'mapbox-gl';\nimport {MapStyle, AnyLayer, AnySource} from './types/style-spec-mapbox';\n\nimport {default as _Map, MapProps as _MapProps} from './components/map';\nimport {default as _Marker, MarkerProps as _MarkerProps} from './components/marker';\nimport {default as _Popup, PopupProps as _PopupProps} from './components/popup';\nimport {\n default as _AttributionControl,\n AttributionControlProps as _AttributionControlProps\n} from './components/attribution-control';\nimport {\n default as _FullscreenControl,\n FullscreenControlProps as _FullscreenControlProps\n} from './components/fullscreen-control';\nimport {\n default as _GeolocateControl,\n GeolocateControlProps as _GeolocateControlProps\n} from './components/geolocate-control';\nimport {\n default as _NavigationControl,\n NavigationControlProps as _NavigationControlProps\n} from './components/navigation-control';\nimport {\n default as _ScaleControl,\n ScaleControlProps as _ScaleControlProps\n} from './components/scale-control';\nimport {default as _Layer, LayerProps as _LayerProps} from './components/layer';\nimport {default as _Source, SourceProps as _SourceProps} from './components/source';\nimport {useMap as _useMap} from './components/use-map';\nimport type {MapRef as _MapRef} from './mapbox/create-ref';\nimport type * as events from './types/events';\nimport type {MapCallbacks} from './types/events-mapbox';\n\nexport function useMap() {\n return _useMap<MapboxMap>();\n}\n\nexport type MapProps = _MapProps<MapboxOptions, MapStyle, MapCallbacks, MapboxMap>;\nexport type MapRef = _MapRef<MapboxMap>;\nconst mapLib = import('mapbox-gl');\nexport const Map = (() => {\n return React.forwardRef(function Map(props: MapProps, ref: React.Ref<MapRef>) {\n return _Map<MapboxOptions, MapStyle, MapCallbacks, MapboxMap>(props, ref, mapLib);\n });\n})();\n\nexport type MarkerProps = _MarkerProps<MarkerOptions, MapboxMarker>;\nexport const Marker = _Marker as (\n props: MarkerProps & React.RefAttributes<MapboxMarker>\n) => React.ReactElement | null;\n\nexport type PopupProps = _PopupProps<PopupOptions, MapboxPopup>;\nexport const Popup = _Popup as (\n props: PopupProps & React.RefAttributes<MapboxPopup>\n) => React.ReactElement | null;\n\ntype AttributionControlOptions = ConstructorParameters<typeof MapboxAttributionControl>[0];\nexport type AttributionControlProps = _AttributionControlProps<AttributionControlOptions>;\nexport const AttributionControl = _AttributionControl as (\n props: AttributionControlProps\n) => React.ReactElement | null;\n\ntype FullscreenControlOptions = ConstructorParameters<typeof MapboxFullscreenControl>[0];\nexport type FullscreenControlProps = _FullscreenControlProps<FullscreenControlOptions>;\nexport const FullscreenControl = _FullscreenControl as (\n props: FullscreenControlProps\n) => React.ReactElement | null;\n\ntype NavigationControlOptions = ConstructorParameters<typeof MapboxNavigationControl>[0];\nexport type NavigationControlProps = _NavigationControlProps<NavigationControlOptions>;\nexport const NavigationControl = _NavigationControl as (\n props: NavigationControlProps\n) => React.ReactElement | null;\n\ntype GeolocateControlOptions = ConstructorParameters<typeof MapboxGeolocateControl>[0];\nexport type GeolocateControlProps = _GeolocateControlProps<\n GeolocateControlOptions,\n MapboxGeolocateControl\n>;\nexport const GeolocateControl = _GeolocateControl as (\n props: GeolocateControlProps & React.RefAttributes<MapboxGeolocateControl>\n) => React.ReactElement | null;\n\ntype ScaleControlOptions = ConstructorParameters<typeof MapboxScaleControl>[0];\nexport type ScaleControlProps = _ScaleControlProps<ScaleControlOptions>;\nexport const ScaleControl = _ScaleControl as (\n props: ScaleControlProps\n) => React.ReactElement | null;\n\nexport type LayerProps = _LayerProps<AnyLayer>;\nexport const Layer = _Layer as (props: LayerProps) => React.ReactElement | null;\n\nexport type SourceProps = _SourceProps<AnySource>;\nexport const Source = _Source as (props: SourceProps) => React.ReactElement | null;\n\nexport {default as useControl} from './components/use-control';\nexport {MapProvider} from './components/use-map';\n\nexport default Map;\n\n// Types\nexport * from './types/public';\nexport type {\n Point,\n PointLike,\n LngLat,\n LngLatLike,\n LngLatBounds,\n LngLatBoundsLike,\n PaddingOptions,\n MapboxGeoJSONFeature as MapGeoJSONFeature,\n GeoJSONSource,\n VideoSource,\n ImageSource,\n CanvasSource,\n VectorSourceImpl as VectorTileSource\n} from 'mapbox-gl';\nexport * from './types/style-spec-mapbox';\n\n// Events\nexport type {\n MapEvent,\n MapMouseEvent,\n MapLayerMouseEvent,\n MapTouchEvent,\n MapLayerTouchEvent,\n MapStyleDataEvent,\n MapSourceDataEvent,\n MapWheelEvent,\n MapBoxZoomEvent,\n ErrorEvent,\n ViewStateChangeEvent\n} from './types/events-mapbox';\nexport type PopupEvent = events.PopupEvent<MapboxPopup>;\nexport type MarkerEvent = events.MarkerEvent<MapboxMarker>;\nexport type MarkerDragEvent = events.MarkerDragEvent<MapboxMarker>;\nexport type GeolocateEvent = events.GeolocateEvent<MapboxGeolocateControl>;\nexport type GeolocateResultEvent = events.GeolocateResultEvent<MapboxGeolocateControl>;\nexport type GeolocateErrorEvent = events.GeolocateErrorEvent<MapboxGeolocateControl>;\n\n// v7.0 backward compatibility\n\n/** @deprecated use `MapStyle` */\nexport type MapboxStyle = MapStyle;\n\nexport type {Map as MapboxMap, MapboxEvent, MapboxGeoJSONFeature} from 'mapbox-gl';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC,SAgBvBC,OAAO,IAAIC,IAAI;AAAA,SACfD,OAAO,IAAIE,OAAO;AAAA,SAClBF,OAAO,IAAIG,MAAM;AAAA,SAEvBH,OAAO,IAAII,mBAAmB;AAAA,SAI9BJ,OAAO,IAAIK,kBAAkB;AAAA,SAI7BL,OAAO,IAAIM,iBAAiB;AAAA,SAI5BN,OAAO,IAAIO,kBAAkB;AAAA,SAI7BP,OAAO,IAAIQ,aAAa;AAAA,SAGlBR,OAAO,IAAIS,MAAM;AAAA,SACjBT,OAAO,IAAIU,OAAO;AAAA,SAClBC,MAAM,IAAIC,OAAO;AAKzB,OAAO,SAASD,MAAMA,CAAA,EAAG;EACvB,OAAOC,OAAO,CAAY,CAAC;AAC7B;AAIA,MAAMC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC;AAClC,OAAO,MAAMC,GAAG,GAAG,CAAC,MAAM;EACxB,OAAOf,KAAK,CAACgB,UAAU,CAAC,SAASD,GAAGA,CAACE,KAAe,EAAEC,GAAsB,EAAE;IAC5E,OAAOhB,IAAI,CAAmDe,KAAK,EAAEC,GAAG,EAAEJ,MAAM,CAAC;EACnF,CAAC,CAAC;AACJ,CAAC,EAAE,CAAC;AAGJ,OAAO,MAAMK,MAAM,GAAGhB,OAEQ;AAG9B,OAAO,MAAMiB,KAAK,GAAGhB,MAES;AAI9B,OAAO,MAAMiB,kBAAkB,GAAGhB,mBAEJ;AAI9B,OAAO,MAAMiB,iBAAiB,GAAGhB,kBAEH;AAI9B,OAAO,MAAMiB,iBAAiB,GAAGf,kBAEH;AAO9B,OAAO,MAAMgB,gBAAgB,GAAGjB,iBAEF;AAI9B,OAAO,MAAMkB,YAAY,GAAGhB,aAEE;AAG9B,OAAO,MAAMiB,KAAK,GAAGhB,MAA0D;AAG/E,OAAO,MAAMiB,MAAM,GAAGhB,OAA4D;AAAC,SAE3EV,OAAO,IAAI2B,UAAU;AAAA,SACrBC,WAAW;AAEnB,eAAed,GAAG;AAAC;AAAA","ignoreList":[]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const skipMethods = ['setMaxBounds', 'setMinZoom', 'setMaxZoom', 'setMinPitch', 'setMaxPitch', 'setRenderWorldCopies', 'setProjection', 'setStyle', 'addSource', 'removeSource', 'addLayer', 'removeLayer', 'setLayerZoomRange', 'setFilter', 'setPaintProperty', 'setLayoutProperty', 'setLight', 'setTerrain', 'setFog', 'remove'];
|
|
2
|
-
export default function createRef(mapInstance) {
|
|
3
|
-
if (!mapInstance) {
|
|
4
|
-
return null;
|
|
5
|
-
}
|
|
6
|
-
const map = mapInstance.map;
|
|
7
|
-
const result = {
|
|
8
|
-
getMap: () => map,
|
|
9
|
-
getCenter: () => mapInstance.transform.center,
|
|
10
|
-
getZoom: () => mapInstance.transform.zoom,
|
|
11
|
-
getBearing: () => mapInstance.transform.bearing,
|
|
12
|
-
getPitch: () => mapInstance.transform.pitch,
|
|
13
|
-
getPadding: () => mapInstance.transform.padding,
|
|
14
|
-
getBounds: () => mapInstance.transform.getBounds(),
|
|
15
|
-
project: lnglat => {
|
|
16
|
-
const tr = map.transform;
|
|
17
|
-
map.transform = mapInstance.transform;
|
|
18
|
-
const result = map.project(lnglat);
|
|
19
|
-
map.transform = tr;
|
|
20
|
-
return result;
|
|
21
|
-
},
|
|
22
|
-
unproject: point => {
|
|
23
|
-
const tr = map.transform;
|
|
24
|
-
map.transform = mapInstance.transform;
|
|
25
|
-
const result = map.unproject(point);
|
|
26
|
-
map.transform = tr;
|
|
27
|
-
return result;
|
|
28
|
-
},
|
|
29
|
-
queryTerrainElevation: (lnglat, options) => {
|
|
30
|
-
const tr = map.transform;
|
|
31
|
-
map.transform = mapInstance.transform;
|
|
32
|
-
const result = map.queryTerrainElevation(lnglat, options);
|
|
33
|
-
map.transform = tr;
|
|
34
|
-
return result;
|
|
35
|
-
},
|
|
36
|
-
queryRenderedFeatures: (geometry, options) => {
|
|
37
|
-
const tr = map.transform;
|
|
38
|
-
map.transform = mapInstance.transform;
|
|
39
|
-
const result = map.queryRenderedFeatures(geometry, options);
|
|
40
|
-
map.transform = tr;
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
for (const key of getMethodNames(map)) {
|
|
45
|
-
if (!(key in result) && !skipMethods.includes(key)) {
|
|
46
|
-
result[key] = map[key].bind(map);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
function getMethodNames(obj) {
|
|
52
|
-
const result = new Set();
|
|
53
|
-
let proto = obj;
|
|
54
|
-
while (proto) {
|
|
55
|
-
for (const key of Object.getOwnPropertyNames(proto)) {
|
|
56
|
-
if (key[0] !== '_' && typeof obj[key] === 'function' && key !== 'fire' && key !== 'setEventedParent') {
|
|
57
|
-
result.add(key);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
proto = Object.getPrototypeOf(proto);
|
|
61
|
-
}
|
|
62
|
-
return Array.from(result);
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=create-ref.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-ref.js","names":["skipMethods","createRef","mapInstance","map","result","getMap","getCenter","transform","center","getZoom","zoom","getBearing","bearing","getPitch","pitch","getPadding","padding","getBounds","project","lnglat","tr","unproject","point","queryTerrainElevation","options","queryRenderedFeatures","geometry","key","getMethodNames","includes","bind","obj","Set","proto","Object","getOwnPropertyNames","add","getPrototypeOf","Array","from"],"sources":["../../src/mapbox/create-ref.ts"],"sourcesContent":["import type {\n MapInstance,\n MapInstanceInternal,\n MapStyle,\n Callbacks,\n LngLatLike,\n PointLike\n} from '../types';\nimport type Mapbox from './mapbox';\n\n/** These methods may break the react binding if called directly */\nconst skipMethods = [\n 'setMaxBounds',\n 'setMinZoom',\n 'setMaxZoom',\n 'setMinPitch',\n 'setMaxPitch',\n 'setRenderWorldCopies',\n 'setProjection',\n 'setStyle',\n 'addSource',\n 'removeSource',\n 'addLayer',\n 'removeLayer',\n 'setLayerZoomRange',\n 'setFilter',\n 'setPaintProperty',\n 'setLayoutProperty',\n 'setLight',\n 'setTerrain',\n 'setFog',\n 'remove'\n] as const;\n\nexport type MapRef<MapT extends MapInstance> = {\n getMap(): MapT;\n} & Omit<MapT, typeof skipMethods[number]>;\n\nexport default function createRef<\n StyleT extends MapStyle,\n CallbacksT extends Callbacks,\n MapT extends MapInstance\n>(mapInstance: Mapbox<StyleT, CallbacksT, MapT>): MapRef<MapT> | null {\n if (!mapInstance) {\n return null;\n }\n\n const map = mapInstance.map as MapInstanceInternal<MapT>;\n const result: any = {\n getMap: () => map,\n\n // Overwrite getters to use our shadow transform\n getCenter: () => mapInstance.transform.center,\n getZoom: () => mapInstance.transform.zoom,\n getBearing: () => mapInstance.transform.bearing,\n getPitch: () => mapInstance.transform.pitch,\n getPadding: () => mapInstance.transform.padding,\n getBounds: () => mapInstance.transform.getBounds(),\n project: (lnglat: LngLatLike) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.project(lnglat);\n map.transform = tr;\n return result;\n },\n unproject: (point: PointLike) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.unproject(point);\n map.transform = tr;\n return result;\n },\n // options diverge between mapbox and maplibre\n queryTerrainElevation: (lnglat: LngLatLike, options?: any) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.queryTerrainElevation(lnglat, options);\n map.transform = tr;\n return result;\n },\n queryRenderedFeatures: (geometry?: any, options?: any) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.queryRenderedFeatures(geometry, options);\n map.transform = tr;\n return result;\n }\n };\n\n for (const key of getMethodNames(map)) {\n // @ts-expect-error\n if (!(key in result) && !skipMethods.includes(key)) {\n result[key] = map[key].bind(map);\n }\n }\n\n return result;\n}\n\nfunction getMethodNames(obj: Object) {\n const result = new Set<string>();\n\n let proto = obj;\n while (proto) {\n for (const key of Object.getOwnPropertyNames(proto)) {\n if (\n key[0] !== '_' &&\n typeof obj[key] === 'function' &&\n key !== 'fire' &&\n key !== 'setEventedParent'\n ) {\n result.add(key);\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return Array.from(result);\n}\n"],"mappings":"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","ignoreList":[]}
|
package/dist/mapbox/mapbox.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { Transform, ViewState, ViewStateChangeEvent, PointLike, PaddingOptions, MapStyle, ImmutableLike, LngLatBoundsLike, Callbacks, MapEvent, MapMouseEvent, MapInstance, MapInstanceInternal } from '../types';
|
|
2
|
-
export type MapboxProps<StyleT extends MapStyle = MapStyle, CallbacksT extends Callbacks = {}> = Partial<ViewState> & CallbacksT & {
|
|
3
|
-
mapboxAccessToken?: string;
|
|
4
|
-
/** Camera options used when constructing the Map instance */
|
|
5
|
-
initialViewState?: Partial<ViewState> & {
|
|
6
|
-
/** The initial bounds of the map. If bounds is specified, it overrides longitude, latitude and zoom options. */
|
|
7
|
-
bounds?: LngLatBoundsLike;
|
|
8
|
-
/** A fitBounds options object to use only when setting the bounds option. */
|
|
9
|
-
fitBoundsOptions?: {
|
|
10
|
-
offset?: PointLike;
|
|
11
|
-
minZoom?: number;
|
|
12
|
-
maxZoom?: number;
|
|
13
|
-
padding?: number | PaddingOptions;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
/** If provided, render into an external WebGL context */
|
|
17
|
-
gl?: WebGLRenderingContext;
|
|
18
|
-
/** For external controller to override the camera state */
|
|
19
|
-
viewState?: ViewState & {
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
};
|
|
23
|
-
/** Mapbox style */
|
|
24
|
-
mapStyle?: string | StyleT | ImmutableLike<StyleT>;
|
|
25
|
-
/** Enable diffing when the map style changes
|
|
26
|
-
* @default true
|
|
27
|
-
*/
|
|
28
|
-
styleDiffing?: boolean;
|
|
29
|
-
/** The fog property of the style. Must conform to the Fog Style Specification .
|
|
30
|
-
* If `undefined` is provided, removes the fog from the map. */
|
|
31
|
-
fog?: StyleT['fog'];
|
|
32
|
-
/** Light properties of the map. */
|
|
33
|
-
light?: StyleT['light'];
|
|
34
|
-
/** Terrain property of the style. Must conform to the Terrain Style Specification .
|
|
35
|
-
* If `undefined` is provided, removes terrain from the map. */
|
|
36
|
-
terrain?: StyleT['terrain'];
|
|
37
|
-
/** Default layers to query on pointer events */
|
|
38
|
-
interactiveLayerIds?: string[];
|
|
39
|
-
/** CSS cursor */
|
|
40
|
-
cursor?: string;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* A wrapper for mapbox-gl's Map class
|
|
44
|
-
*/
|
|
45
|
-
export default class Mapbox<StyleT extends MapStyle = MapStyle, CallbacksT extends Callbacks = {}, MapT extends MapInstance = MapInstance> {
|
|
46
|
-
private _MapClass;
|
|
47
|
-
private _map;
|
|
48
|
-
props: MapboxProps<StyleT, CallbacksT>;
|
|
49
|
-
private _renderTransform;
|
|
50
|
-
private _internalUpdate;
|
|
51
|
-
private _inRender;
|
|
52
|
-
private _hoveredFeatures;
|
|
53
|
-
private _deferredEvents;
|
|
54
|
-
static savedMaps: Mapbox[];
|
|
55
|
-
constructor(MapClass: {
|
|
56
|
-
new (options: any): MapInstance;
|
|
57
|
-
}, props: MapboxProps<StyleT, CallbacksT>, container: HTMLDivElement);
|
|
58
|
-
get map(): MapT;
|
|
59
|
-
get transform(): Transform;
|
|
60
|
-
setProps(props: MapboxProps<StyleT, CallbacksT>): void;
|
|
61
|
-
static reuse<StyleT extends MapStyle, CallbacksT extends Callbacks, MapT extends MapInstance>(props: MapboxProps<StyleT, CallbacksT>, container: HTMLDivElement): Mapbox<StyleT, CallbacksT, MapT>;
|
|
62
|
-
_initialize(container: HTMLDivElement): void;
|
|
63
|
-
recycle(): void;
|
|
64
|
-
destroy(): void;
|
|
65
|
-
redraw(): void;
|
|
66
|
-
_createShadowTransform(map: any): void;
|
|
67
|
-
_updateSize(nextProps: MapboxProps<StyleT>): boolean;
|
|
68
|
-
_updateViewState(nextProps: MapboxProps<StyleT>, triggerEvents: boolean): boolean;
|
|
69
|
-
_updateSettings(nextProps: MapboxProps<StyleT>, currProps: MapboxProps<StyleT>): boolean;
|
|
70
|
-
_updateStyle(nextProps: MapboxProps<StyleT>, currProps: MapboxProps<StyleT>): boolean;
|
|
71
|
-
_updateStyleComponents(nextProps: MapboxProps<StyleT>, currProps: MapboxProps<StyleT>): boolean;
|
|
72
|
-
_updateHandlers(nextProps: MapboxProps<StyleT>, currProps: MapboxProps<StyleT>): boolean;
|
|
73
|
-
_onEvent: (e: MapEvent<MapT>) => void;
|
|
74
|
-
private _queryRenderedFeatures;
|
|
75
|
-
_updateHover(e: MapMouseEvent<MapT>): void;
|
|
76
|
-
_onPointerEvent: (e: MapMouseEvent<MapT> | MapMouseEvent<MapT>) => void;
|
|
77
|
-
_onCameraEvent: (e: ViewStateChangeEvent<MapT>) => void;
|
|
78
|
-
_fireEvent(baseFire: Function, event: string | MapEvent<MapT>, properties?: object): MapInstanceInternal<MapT>;
|
|
79
|
-
_onBeforeRepaint(): void;
|
|
80
|
-
_onAfterRepaint: () => void;
|
|
81
|
-
}
|