@orioro/react-maplibre-util 0.0.1 → 0.1.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/CHANGELOG.md +36 -0
- package/dist/GeocoderCtrl_MapLibre/mapboxGeocoderApi.d.ts +1 -1
- package/dist/LayeredMap/parseMapViews.d.ts +45 -0
- package/dist/MapWindow/MapWindow.d.ts +63 -57
- package/dist/SyncedMaps/GhostCursor.d.ts +1 -2
- package/dist/SyncedMaps/SyncedMaps.d.ts +258 -234
- package/dist/index.mjs +55 -72
- package/dist/useHover/useHover.d.ts +1 -1
- package/package.json +10 -9
- package/dist/tmpMapView/MapView.d.ts +0 -3
package/CHANGELOG.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# @orioro/react-maplibre-util
|
2
|
+
|
3
|
+
## 0.1.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- move georedus-related packages to isolated repo
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- Updated dependencies
|
12
|
+
- @orioro/react-chart-util@0.1.0
|
13
|
+
|
14
|
+
## 0.0.2
|
15
|
+
|
16
|
+
### Patch Changes
|
17
|
+
|
18
|
+
- fix changeset release with yarn
|
19
|
+
- Updated dependencies
|
20
|
+
- @orioro/resolve@0.1.2
|
21
|
+
- @orioro/react-chart-util@0.0.2
|
22
|
+
- @orioro/react-select@3.0.2
|
23
|
+
- @orioro/react-ui-core@0.0.6
|
24
|
+
- @orioro/scale-util@0.0.2
|
25
|
+
|
26
|
+
## 0.0.1
|
27
|
+
|
28
|
+
### Patch Changes
|
29
|
+
|
30
|
+
- f26720d: Initialize package version control using changeset
|
31
|
+
- Updated dependencies [f26720d]
|
32
|
+
- @orioro/react-chart-util@0.0.1
|
33
|
+
- @orioro/react-ui-core@0.0.5
|
34
|
+
- @orioro/resolve@0.1.1
|
35
|
+
- @orioro/react-select@3.0.1
|
36
|
+
- @orioro/scale-util@0.0.1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { MaplibreGeocoderPlaceResults, MaplibreGeocoderSuggestionResults } from '@maplibre/maplibre-gl-geocoder';
|
1
|
+
import { MaplibreGeocoderApiConfig, MaplibreGeocoderPlaceResults, MaplibreGeocoderSuggestionResults } from '@maplibre/maplibre-gl-geocoder';
|
2
2
|
export type MapboxGeocoderApiProps = {
|
3
3
|
accessToken: string;
|
4
4
|
};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { AnyLayer } from 'react-map-gl/dist/esm/exports-maplibre';
|
2
|
+
import { MapView, MapViewLayer, MapViewSource } from '../types';
|
3
|
+
type ParsedSource = MapViewSource & {
|
4
|
+
id: string;
|
5
|
+
viewId: string;
|
6
|
+
};
|
7
|
+
type ParsedLayer = MapViewLayer & {
|
8
|
+
id: string;
|
9
|
+
viewId: string;
|
10
|
+
};
|
11
|
+
export type MapViewsParseResult = {
|
12
|
+
srcMapViews: MapView[];
|
13
|
+
sources: ParsedSource[];
|
14
|
+
layers: ParsedLayer[];
|
15
|
+
interactiveLayerIds: string[];
|
16
|
+
};
|
17
|
+
type ParseMapViewsOptions = {
|
18
|
+
existingLayers?: AnyLayer[];
|
19
|
+
};
|
20
|
+
export declare function sortLayers(layers: MapViewLayer[], { existingLayers }: ParseMapViewsOptions): MapViewLayer[];
|
21
|
+
export declare function getSrcLayer(parsed: MapViewsParseResult, layerId: string): ParsedLayer | null;
|
22
|
+
/**
|
23
|
+
* Given a layerId, attempts to retrieve the source mapView
|
24
|
+
*
|
25
|
+
* @param {MapViewsParseResult} parsed [description]
|
26
|
+
* @param {string} layerId [description]
|
27
|
+
* @param {[type]} [description]
|
28
|
+
* @return {MapView} [description]
|
29
|
+
*/
|
30
|
+
export declare function getSrcViewByLayerId(parsed: MapViewsParseResult, layerId: string): MapView | null;
|
31
|
+
export declare function augmentFeature(parsed: MapViewsParseResult, feature: GeoJSON.Feature & {
|
32
|
+
layer: {
|
33
|
+
id: string;
|
34
|
+
};
|
35
|
+
}): {
|
36
|
+
layer: ParsedLayer | null;
|
37
|
+
mapView: MapView | null;
|
38
|
+
type: "Feature";
|
39
|
+
geometry: import("geojson").Geometry;
|
40
|
+
id?: string | number | undefined;
|
41
|
+
properties: import("geojson").GeoJsonProperties;
|
42
|
+
bbox?: import("geojson").BBox | undefined;
|
43
|
+
};
|
44
|
+
export declare function parseMapViews(orderedViews: MapView[], { existingLayers }?: ParseMapViewsOptions): MapViewsParseResult;
|
45
|
+
export {};
|
@@ -1,72 +1,78 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
export declare const MapWindow: React.ForwardRefExoticComponent<Omit<{
|
3
|
-
|
4
|
-
bearing?: number | undefined;
|
5
|
-
pitch?: number | undefined;
|
6
|
-
maxZoom?: number | undefined;
|
7
|
-
minZoom?: number | undefined;
|
3
|
+
hash?: boolean | string | undefined;
|
8
4
|
interactive?: boolean | undefined;
|
9
|
-
|
10
|
-
|
5
|
+
bearingSnap?: number | undefined;
|
6
|
+
attributionControl?: (false | import("maplibre-gl").AttributionControlOptions) | undefined;
|
7
|
+
maplibreLogo?: boolean | undefined;
|
8
|
+
logoPosition?: import("maplibre-gl").ControlPosition | undefined;
|
9
|
+
canvasContextAttributes?: import("maplibre-gl").WebGLContextAttributesWithType | undefined;
|
10
|
+
refreshExpiredTiles?: boolean | undefined;
|
11
11
|
maxBounds?: import("maplibre-gl").LngLatBoundsLike | undefined;
|
12
|
-
|
13
|
-
|
12
|
+
scrollZoom?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
13
|
+
minZoom?: number | null | undefined;
|
14
|
+
maxZoom?: number | null | undefined;
|
15
|
+
minPitch?: number | null | undefined;
|
16
|
+
maxPitch?: number | null | undefined;
|
14
17
|
boxZoom?: boolean | undefined;
|
15
18
|
dragRotate?: boolean | undefined;
|
16
|
-
dragPan?: boolean | import("maplibre-gl").DragPanOptions | undefined;
|
19
|
+
dragPan?: (boolean | import("maplibre-gl").DragPanOptions) | undefined;
|
17
20
|
keyboard?: boolean | undefined;
|
18
21
|
doubleClickZoom?: boolean | undefined;
|
19
|
-
touchZoomRotate?: boolean | undefined;
|
20
|
-
touchPitch?: boolean | undefined;
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
failIfMajorPerformanceCaveat?: boolean | undefined;
|
22
|
+
touchZoomRotate?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
23
|
+
touchPitch?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
24
|
+
cooperativeGestures?: import("maplibre-gl").GestureOptions | undefined;
|
25
|
+
trackResize?: boolean | undefined;
|
26
|
+
elevation?: number | undefined;
|
27
|
+
zoom?: number | undefined;
|
28
|
+
bearing?: number | undefined;
|
29
|
+
pitch?: number | undefined;
|
30
|
+
roll?: number | undefined;
|
31
|
+
renderWorldCopies?: boolean | undefined;
|
32
|
+
maxTileCacheSize?: number | null | undefined;
|
33
|
+
maxTileCacheZoomLevels?: number | undefined;
|
34
|
+
transformRequest?: (import("maplibre-gl").RequestTransformFunction | null) | undefined;
|
35
|
+
transformCameraUpdate?: (import("maplibre-gl").CameraUpdateTransformFunction | null) | undefined;
|
34
36
|
locale?: any;
|
35
|
-
|
36
|
-
|
37
|
+
fadeDuration?: number | undefined;
|
38
|
+
crossSourceCollisions?: boolean | undefined;
|
39
|
+
collectResourceTiming?: boolean | undefined;
|
40
|
+
clickTolerance?: number | undefined;
|
41
|
+
localIdeographFontFamily?: string | false | undefined;
|
37
42
|
pitchWithRotate?: boolean | undefined;
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
initialViewState?:
|
46
|
-
bounds?: import("
|
43
|
+
rollEnabled?: boolean | undefined;
|
44
|
+
pixelRatio?: number | undefined;
|
45
|
+
validateStyle?: boolean | undefined;
|
46
|
+
maxCanvasSize?: [number, number] | undefined;
|
47
|
+
cancelPendingTileRequestsWhileZooming?: boolean | undefined;
|
48
|
+
centerClampedToGround?: boolean | undefined;
|
49
|
+
} & Partial<import("react-map-gl/maplibre").ViewState> & import("react-map-gl/maplibre").MapCallbacks & {
|
50
|
+
initialViewState?: Partial<import("react-map-gl/maplibre").ViewState> & {
|
51
|
+
bounds?: import("maplibre-gl").LngLatBoundsLike;
|
47
52
|
fitBoundsOptions?: {
|
48
|
-
offset?: import("
|
49
|
-
minZoom?: number
|
50
|
-
maxZoom?: number
|
51
|
-
padding?: number | import("
|
52
|
-
}
|
53
|
-
}
|
54
|
-
gl?: WebGLRenderingContext
|
55
|
-
viewState?:
|
53
|
+
offset?: import("maplibre-gl").PointLike;
|
54
|
+
minZoom?: number;
|
55
|
+
maxZoom?: number;
|
56
|
+
padding?: number | import("maplibre-gl").PaddingOptions;
|
57
|
+
};
|
58
|
+
};
|
59
|
+
gl?: WebGLRenderingContext;
|
60
|
+
viewState?: import("react-map-gl/maplibre").ViewState & {
|
56
61
|
width: number;
|
57
62
|
height: number;
|
58
|
-
}
|
59
|
-
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/
|
60
|
-
styleDiffing?: boolean
|
61
|
-
|
62
|
-
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification
|
63
|
-
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
63
|
+
};
|
64
|
+
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/maplibre").ImmutableLike<import("@maplibre/maplibre-gl-style-spec").StyleSpecification>;
|
65
|
+
styleDiffing?: boolean;
|
66
|
+
projection?: import("@maplibre/maplibre-gl-style-spec").ProjectionSpecification | "mercator" | "globe";
|
67
|
+
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification;
|
68
|
+
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification;
|
69
|
+
sky?: import("@maplibre/maplibre-gl-style-spec").SkySpecification;
|
70
|
+
interactiveLayerIds?: string[];
|
71
|
+
cursor?: string;
|
72
|
+
} & import("@vis.gl/react-maplibre/dist/utils/set-globals").GlobalSettings & {
|
73
|
+
mapLib?: import("react-map-gl/maplibre").MapLib | Promise<import("react-map-gl/maplibre").MapLib>;
|
74
|
+
reuseMaps?: boolean;
|
75
|
+
id?: string;
|
76
|
+
style?: React.CSSProperties;
|
71
77
|
children?: any;
|
72
78
|
} & React.RefAttributes<import("react-map-gl/maplibre").MapRef>, "ref"> & React.RefAttributes<unknown>>;
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
export declare const GhostCursor: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
1
|
+
export declare const GhostCursor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
@@ -11,299 +11,323 @@ export declare function makeSyncedMaps({ components, }: {
|
|
11
11
|
Map: typeof Map;
|
12
12
|
};
|
13
13
|
}): React.ForwardRefExoticComponent<Omit<Omit<{
|
14
|
-
|
15
|
-
bearing?: number | undefined;
|
16
|
-
pitch?: number | undefined;
|
17
|
-
maxZoom?: number | undefined;
|
18
|
-
minZoom?: number | undefined;
|
14
|
+
hash?: boolean | string | undefined;
|
19
15
|
interactive?: boolean | undefined;
|
20
|
-
|
21
|
-
|
16
|
+
bearingSnap?: number | undefined;
|
17
|
+
attributionControl?: (false | import("maplibre-gl").AttributionControlOptions) | undefined;
|
18
|
+
maplibreLogo?: boolean | undefined;
|
19
|
+
logoPosition?: import("maplibre-gl").ControlPosition | undefined;
|
20
|
+
canvasContextAttributes?: import("maplibre-gl").WebGLContextAttributesWithType | undefined;
|
21
|
+
refreshExpiredTiles?: boolean | undefined;
|
22
22
|
maxBounds?: import("maplibre-gl").LngLatBoundsLike | undefined;
|
23
|
-
|
24
|
-
|
23
|
+
scrollZoom?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
24
|
+
minZoom?: number | null | undefined;
|
25
|
+
maxZoom?: number | null | undefined;
|
26
|
+
minPitch?: number | null | undefined;
|
27
|
+
maxPitch?: number | null | undefined;
|
25
28
|
boxZoom?: boolean | undefined;
|
26
29
|
dragRotate?: boolean | undefined;
|
27
|
-
dragPan?: boolean | import("maplibre-gl").DragPanOptions | undefined;
|
30
|
+
dragPan?: (boolean | import("maplibre-gl").DragPanOptions) | undefined;
|
28
31
|
keyboard?: boolean | undefined;
|
29
32
|
doubleClickZoom?: boolean | undefined;
|
30
|
-
touchZoomRotate?: boolean | undefined;
|
31
|
-
touchPitch?: boolean | undefined;
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
failIfMajorPerformanceCaveat?: boolean | undefined;
|
33
|
+
touchZoomRotate?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
34
|
+
touchPitch?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
35
|
+
cooperativeGestures?: import("maplibre-gl").GestureOptions | undefined;
|
36
|
+
trackResize?: boolean | undefined;
|
37
|
+
elevation?: number | undefined;
|
38
|
+
zoom?: number | undefined;
|
39
|
+
bearing?: number | undefined;
|
40
|
+
pitch?: number | undefined;
|
41
|
+
roll?: number | undefined;
|
42
|
+
renderWorldCopies?: boolean | undefined;
|
43
|
+
maxTileCacheSize?: number | null | undefined;
|
44
|
+
maxTileCacheZoomLevels?: number | undefined;
|
45
|
+
transformRequest?: (import("maplibre-gl").RequestTransformFunction | null) | undefined;
|
46
|
+
transformCameraUpdate?: (import("maplibre-gl").CameraUpdateTransformFunction | null) | undefined;
|
45
47
|
locale?: any;
|
46
|
-
|
47
|
-
|
48
|
+
fadeDuration?: number | undefined;
|
49
|
+
crossSourceCollisions?: boolean | undefined;
|
50
|
+
collectResourceTiming?: boolean | undefined;
|
51
|
+
clickTolerance?: number | undefined;
|
52
|
+
localIdeographFontFamily?: string | false | undefined;
|
48
53
|
pitchWithRotate?: boolean | undefined;
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
initialViewState?:
|
57
|
-
bounds?: import("
|
54
|
+
rollEnabled?: boolean | undefined;
|
55
|
+
pixelRatio?: number | undefined;
|
56
|
+
validateStyle?: boolean | undefined;
|
57
|
+
maxCanvasSize?: [number, number] | undefined;
|
58
|
+
cancelPendingTileRequestsWhileZooming?: boolean | undefined;
|
59
|
+
centerClampedToGround?: boolean | undefined;
|
60
|
+
} & Partial<import("react-map-gl/maplibre").ViewState> & import("react-map-gl/maplibre").MapCallbacks & {
|
61
|
+
initialViewState?: Partial<import("react-map-gl/maplibre").ViewState> & {
|
62
|
+
bounds?: import("maplibre-gl").LngLatBoundsLike;
|
58
63
|
fitBoundsOptions?: {
|
59
|
-
offset?: import("
|
60
|
-
minZoom?: number
|
61
|
-
maxZoom?: number
|
62
|
-
padding?: number | import("
|
63
|
-
}
|
64
|
-
}
|
65
|
-
gl?: WebGLRenderingContext
|
66
|
-
viewState?:
|
64
|
+
offset?: import("maplibre-gl").PointLike;
|
65
|
+
minZoom?: number;
|
66
|
+
maxZoom?: number;
|
67
|
+
padding?: number | import("maplibre-gl").PaddingOptions;
|
68
|
+
};
|
69
|
+
};
|
70
|
+
gl?: WebGLRenderingContext;
|
71
|
+
viewState?: import("react-map-gl/maplibre").ViewState & {
|
67
72
|
width: number;
|
68
73
|
height: number;
|
69
|
-
}
|
70
|
-
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/
|
71
|
-
styleDiffing?: boolean
|
72
|
-
|
73
|
-
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification
|
74
|
-
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
74
|
+
};
|
75
|
+
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/maplibre").ImmutableLike<import("@maplibre/maplibre-gl-style-spec").StyleSpecification>;
|
76
|
+
styleDiffing?: boolean;
|
77
|
+
projection?: import("@maplibre/maplibre-gl-style-spec").ProjectionSpecification | "mercator" | "globe";
|
78
|
+
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification;
|
79
|
+
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification;
|
80
|
+
sky?: import("@maplibre/maplibre-gl-style-spec").SkySpecification;
|
81
|
+
interactiveLayerIds?: string[];
|
82
|
+
cursor?: string;
|
83
|
+
} & import("@vis.gl/react-maplibre/dist/utils/set-globals").GlobalSettings & {
|
84
|
+
mapLib?: import("react-map-gl/maplibre").MapLib | Promise<import("react-map-gl/maplibre").MapLib>;
|
85
|
+
reuseMaps?: boolean;
|
86
|
+
id?: string;
|
87
|
+
style?: React.CSSProperties;
|
82
88
|
children?: any;
|
83
89
|
} & React.RefAttributes<import("react-map-gl/maplibre").MapRef> & {
|
84
|
-
tooltip?: boolean
|
90
|
+
tooltip?: boolean;
|
85
91
|
}, "tooltip"> & {
|
86
|
-
tooltip?: (
|
92
|
+
tooltip?: (hoverInfo: HoverInfo, map: MapInstance) => React.ReactNode;
|
87
93
|
maps: ({
|
88
|
-
|
89
|
-
bearing?: number | undefined;
|
90
|
-
pitch?: number | undefined;
|
91
|
-
maxZoom?: number | undefined;
|
92
|
-
minZoom?: number | undefined;
|
94
|
+
hash?: boolean | string | undefined;
|
93
95
|
interactive?: boolean | undefined;
|
94
|
-
|
95
|
-
|
96
|
+
bearingSnap?: number | undefined;
|
97
|
+
attributionControl?: (false | import("maplibre-gl").AttributionControlOptions) | undefined;
|
98
|
+
maplibreLogo?: boolean | undefined;
|
99
|
+
logoPosition?: import("maplibre-gl").ControlPosition | undefined;
|
100
|
+
canvasContextAttributes?: import("maplibre-gl").WebGLContextAttributesWithType | undefined;
|
101
|
+
refreshExpiredTiles?: boolean | undefined;
|
96
102
|
maxBounds?: import("maplibre-gl").LngLatBoundsLike | undefined;
|
97
|
-
|
98
|
-
|
103
|
+
scrollZoom?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
104
|
+
minZoom?: number | null | undefined;
|
105
|
+
maxZoom?: number | null | undefined;
|
106
|
+
minPitch?: number | null | undefined;
|
107
|
+
maxPitch?: number | null | undefined;
|
99
108
|
boxZoom?: boolean | undefined;
|
100
109
|
dragRotate?: boolean | undefined;
|
101
|
-
dragPan?: boolean | import("maplibre-gl").DragPanOptions | undefined;
|
110
|
+
dragPan?: (boolean | import("maplibre-gl").DragPanOptions) | undefined;
|
102
111
|
keyboard?: boolean | undefined;
|
103
112
|
doubleClickZoom?: boolean | undefined;
|
104
|
-
touchZoomRotate?: boolean | undefined;
|
105
|
-
touchPitch?: boolean | undefined;
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
failIfMajorPerformanceCaveat?: boolean | undefined;
|
113
|
+
touchZoomRotate?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
114
|
+
touchPitch?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
115
|
+
cooperativeGestures?: import("maplibre-gl").GestureOptions | undefined;
|
116
|
+
trackResize?: boolean | undefined;
|
117
|
+
elevation?: number | undefined;
|
118
|
+
zoom?: number | undefined;
|
119
|
+
bearing?: number | undefined;
|
120
|
+
pitch?: number | undefined;
|
121
|
+
roll?: number | undefined;
|
122
|
+
renderWorldCopies?: boolean | undefined;
|
123
|
+
maxTileCacheSize?: number | null | undefined;
|
124
|
+
maxTileCacheZoomLevels?: number | undefined;
|
125
|
+
transformRequest?: (import("maplibre-gl").RequestTransformFunction | null) | undefined;
|
126
|
+
transformCameraUpdate?: (import("maplibre-gl").CameraUpdateTransformFunction | null) | undefined;
|
119
127
|
locale?: any;
|
120
|
-
|
121
|
-
|
128
|
+
fadeDuration?: number | undefined;
|
129
|
+
crossSourceCollisions?: boolean | undefined;
|
130
|
+
collectResourceTiming?: boolean | undefined;
|
131
|
+
clickTolerance?: number | undefined;
|
132
|
+
localIdeographFontFamily?: string | false | undefined;
|
122
133
|
pitchWithRotate?: boolean | undefined;
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
initialViewState?:
|
131
|
-
bounds?: import("
|
134
|
+
rollEnabled?: boolean | undefined;
|
135
|
+
pixelRatio?: number | undefined;
|
136
|
+
validateStyle?: boolean | undefined;
|
137
|
+
maxCanvasSize?: [number, number] | undefined;
|
138
|
+
cancelPendingTileRequestsWhileZooming?: boolean | undefined;
|
139
|
+
centerClampedToGround?: boolean | undefined;
|
140
|
+
} & Partial<import("react-map-gl/maplibre").ViewState> & import("react-map-gl/maplibre").MapCallbacks & {
|
141
|
+
initialViewState?: Partial<import("react-map-gl/maplibre").ViewState> & {
|
142
|
+
bounds?: import("maplibre-gl").LngLatBoundsLike;
|
132
143
|
fitBoundsOptions?: {
|
133
|
-
offset?: import("
|
134
|
-
minZoom?: number
|
135
|
-
maxZoom?: number
|
136
|
-
padding?: number | import("
|
137
|
-
}
|
138
|
-
}
|
139
|
-
gl?: WebGLRenderingContext
|
140
|
-
viewState?:
|
144
|
+
offset?: import("maplibre-gl").PointLike;
|
145
|
+
minZoom?: number;
|
146
|
+
maxZoom?: number;
|
147
|
+
padding?: number | import("maplibre-gl").PaddingOptions;
|
148
|
+
};
|
149
|
+
};
|
150
|
+
gl?: WebGLRenderingContext;
|
151
|
+
viewState?: import("react-map-gl/maplibre").ViewState & {
|
141
152
|
width: number;
|
142
153
|
height: number;
|
143
|
-
}
|
144
|
-
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/
|
145
|
-
styleDiffing?: boolean
|
146
|
-
|
147
|
-
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification
|
148
|
-
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
154
|
+
};
|
155
|
+
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/maplibre").ImmutableLike<import("@maplibre/maplibre-gl-style-spec").StyleSpecification>;
|
156
|
+
styleDiffing?: boolean;
|
157
|
+
projection?: import("@maplibre/maplibre-gl-style-spec").ProjectionSpecification | "mercator" | "globe";
|
158
|
+
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification;
|
159
|
+
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification;
|
160
|
+
sky?: import("@maplibre/maplibre-gl-style-spec").SkySpecification;
|
161
|
+
interactiveLayerIds?: string[];
|
162
|
+
cursor?: string;
|
163
|
+
} & import("@vis.gl/react-maplibre/dist/utils/set-globals").GlobalSettings & {
|
164
|
+
mapLib?: import("react-map-gl/maplibre").MapLib | Promise<import("react-map-gl/maplibre").MapLib>;
|
165
|
+
reuseMaps?: boolean;
|
166
|
+
id?: string;
|
167
|
+
style?: React.CSSProperties;
|
156
168
|
children?: any;
|
157
169
|
} & React.RefAttributes<import("react-map-gl/maplibre").MapRef> & {
|
158
|
-
tooltip?: boolean
|
170
|
+
tooltip?: boolean;
|
159
171
|
})[];
|
160
172
|
}, "ref"> & React.RefAttributes<unknown>>;
|
161
173
|
export declare const SyncedMaps: React.ForwardRefExoticComponent<Omit<Omit<{
|
162
|
-
|
163
|
-
bearing?: number | undefined;
|
164
|
-
pitch?: number | undefined;
|
165
|
-
maxZoom?: number | undefined;
|
166
|
-
minZoom?: number | undefined;
|
174
|
+
hash?: boolean | string | undefined;
|
167
175
|
interactive?: boolean | undefined;
|
168
|
-
|
169
|
-
|
176
|
+
bearingSnap?: number | undefined;
|
177
|
+
attributionControl?: (false | import("maplibre-gl").AttributionControlOptions) | undefined;
|
178
|
+
maplibreLogo?: boolean | undefined;
|
179
|
+
logoPosition?: import("maplibre-gl").ControlPosition | undefined;
|
180
|
+
canvasContextAttributes?: import("maplibre-gl").WebGLContextAttributesWithType | undefined;
|
181
|
+
refreshExpiredTiles?: boolean | undefined;
|
170
182
|
maxBounds?: import("maplibre-gl").LngLatBoundsLike | undefined;
|
171
|
-
|
172
|
-
|
183
|
+
scrollZoom?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
184
|
+
minZoom?: number | null | undefined;
|
185
|
+
maxZoom?: number | null | undefined;
|
186
|
+
minPitch?: number | null | undefined;
|
187
|
+
maxPitch?: number | null | undefined;
|
173
188
|
boxZoom?: boolean | undefined;
|
174
189
|
dragRotate?: boolean | undefined;
|
175
|
-
dragPan?: boolean | import("maplibre-gl").DragPanOptions | undefined;
|
190
|
+
dragPan?: (boolean | import("maplibre-gl").DragPanOptions) | undefined;
|
176
191
|
keyboard?: boolean | undefined;
|
177
192
|
doubleClickZoom?: boolean | undefined;
|
178
|
-
touchZoomRotate?: boolean | undefined;
|
179
|
-
touchPitch?: boolean | undefined;
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
failIfMajorPerformanceCaveat?: boolean | undefined;
|
193
|
+
touchZoomRotate?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
194
|
+
touchPitch?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
195
|
+
cooperativeGestures?: import("maplibre-gl").GestureOptions | undefined;
|
196
|
+
trackResize?: boolean | undefined;
|
197
|
+
elevation?: number | undefined;
|
198
|
+
zoom?: number | undefined;
|
199
|
+
bearing?: number | undefined;
|
200
|
+
pitch?: number | undefined;
|
201
|
+
roll?: number | undefined;
|
202
|
+
renderWorldCopies?: boolean | undefined;
|
203
|
+
maxTileCacheSize?: number | null | undefined;
|
204
|
+
maxTileCacheZoomLevels?: number | undefined;
|
205
|
+
transformRequest?: (import("maplibre-gl").RequestTransformFunction | null) | undefined;
|
206
|
+
transformCameraUpdate?: (import("maplibre-gl").CameraUpdateTransformFunction | null) | undefined;
|
193
207
|
locale?: any;
|
194
|
-
|
195
|
-
|
208
|
+
fadeDuration?: number | undefined;
|
209
|
+
crossSourceCollisions?: boolean | undefined;
|
210
|
+
collectResourceTiming?: boolean | undefined;
|
211
|
+
clickTolerance?: number | undefined;
|
212
|
+
localIdeographFontFamily?: string | false | undefined;
|
196
213
|
pitchWithRotate?: boolean | undefined;
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
initialViewState?:
|
205
|
-
bounds?: import("
|
214
|
+
rollEnabled?: boolean | undefined;
|
215
|
+
pixelRatio?: number | undefined;
|
216
|
+
validateStyle?: boolean | undefined;
|
217
|
+
maxCanvasSize?: [number, number] | undefined;
|
218
|
+
cancelPendingTileRequestsWhileZooming?: boolean | undefined;
|
219
|
+
centerClampedToGround?: boolean | undefined;
|
220
|
+
} & Partial<import("react-map-gl/maplibre").ViewState> & import("react-map-gl/maplibre").MapCallbacks & {
|
221
|
+
initialViewState?: Partial<import("react-map-gl/maplibre").ViewState> & {
|
222
|
+
bounds?: import("maplibre-gl").LngLatBoundsLike;
|
206
223
|
fitBoundsOptions?: {
|
207
|
-
offset?: import("
|
208
|
-
minZoom?: number
|
209
|
-
maxZoom?: number
|
210
|
-
padding?: number | import("
|
211
|
-
}
|
212
|
-
}
|
213
|
-
gl?: WebGLRenderingContext
|
214
|
-
viewState?:
|
224
|
+
offset?: import("maplibre-gl").PointLike;
|
225
|
+
minZoom?: number;
|
226
|
+
maxZoom?: number;
|
227
|
+
padding?: number | import("maplibre-gl").PaddingOptions;
|
228
|
+
};
|
229
|
+
};
|
230
|
+
gl?: WebGLRenderingContext;
|
231
|
+
viewState?: import("react-map-gl/maplibre").ViewState & {
|
215
232
|
width: number;
|
216
233
|
height: number;
|
217
|
-
}
|
218
|
-
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/
|
219
|
-
styleDiffing?: boolean
|
220
|
-
|
221
|
-
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification
|
222
|
-
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
234
|
+
};
|
235
|
+
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/maplibre").ImmutableLike<import("@maplibre/maplibre-gl-style-spec").StyleSpecification>;
|
236
|
+
styleDiffing?: boolean;
|
237
|
+
projection?: import("@maplibre/maplibre-gl-style-spec").ProjectionSpecification | "mercator" | "globe";
|
238
|
+
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification;
|
239
|
+
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification;
|
240
|
+
sky?: import("@maplibre/maplibre-gl-style-spec").SkySpecification;
|
241
|
+
interactiveLayerIds?: string[];
|
242
|
+
cursor?: string;
|
243
|
+
} & import("@vis.gl/react-maplibre/dist/utils/set-globals").GlobalSettings & {
|
244
|
+
mapLib?: import("react-map-gl/maplibre").MapLib | Promise<import("react-map-gl/maplibre").MapLib>;
|
245
|
+
reuseMaps?: boolean;
|
246
|
+
id?: string;
|
247
|
+
style?: React.CSSProperties;
|
230
248
|
children?: any;
|
231
249
|
} & React.RefAttributes<import("react-map-gl/maplibre").MapRef> & {
|
232
|
-
tooltip?: boolean
|
250
|
+
tooltip?: boolean;
|
233
251
|
}, "tooltip"> & {
|
234
|
-
tooltip?: (
|
252
|
+
tooltip?: (hoverInfo: HoverInfo, map: MapInstance) => React.ReactNode;
|
235
253
|
maps: ({
|
236
|
-
|
237
|
-
bearing?: number | undefined;
|
238
|
-
pitch?: number | undefined;
|
239
|
-
maxZoom?: number | undefined;
|
240
|
-
minZoom?: number | undefined;
|
254
|
+
hash?: boolean | string | undefined;
|
241
255
|
interactive?: boolean | undefined;
|
242
|
-
|
243
|
-
|
256
|
+
bearingSnap?: number | undefined;
|
257
|
+
attributionControl?: (false | import("maplibre-gl").AttributionControlOptions) | undefined;
|
258
|
+
maplibreLogo?: boolean | undefined;
|
259
|
+
logoPosition?: import("maplibre-gl").ControlPosition | undefined;
|
260
|
+
canvasContextAttributes?: import("maplibre-gl").WebGLContextAttributesWithType | undefined;
|
261
|
+
refreshExpiredTiles?: boolean | undefined;
|
244
262
|
maxBounds?: import("maplibre-gl").LngLatBoundsLike | undefined;
|
245
|
-
|
246
|
-
|
263
|
+
scrollZoom?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
264
|
+
minZoom?: number | null | undefined;
|
265
|
+
maxZoom?: number | null | undefined;
|
266
|
+
minPitch?: number | null | undefined;
|
267
|
+
maxPitch?: number | null | undefined;
|
247
268
|
boxZoom?: boolean | undefined;
|
248
269
|
dragRotate?: boolean | undefined;
|
249
|
-
dragPan?: boolean | import("maplibre-gl").DragPanOptions | undefined;
|
270
|
+
dragPan?: (boolean | import("maplibre-gl").DragPanOptions) | undefined;
|
250
271
|
keyboard?: boolean | undefined;
|
251
272
|
doubleClickZoom?: boolean | undefined;
|
252
|
-
touchZoomRotate?: boolean | undefined;
|
253
|
-
touchPitch?: boolean | undefined;
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
failIfMajorPerformanceCaveat?: boolean | undefined;
|
273
|
+
touchZoomRotate?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
274
|
+
touchPitch?: (boolean | import("maplibre-gl").AroundCenterOptions) | undefined;
|
275
|
+
cooperativeGestures?: import("maplibre-gl").GestureOptions | undefined;
|
276
|
+
trackResize?: boolean | undefined;
|
277
|
+
elevation?: number | undefined;
|
278
|
+
zoom?: number | undefined;
|
279
|
+
bearing?: number | undefined;
|
280
|
+
pitch?: number | undefined;
|
281
|
+
roll?: number | undefined;
|
282
|
+
renderWorldCopies?: boolean | undefined;
|
283
|
+
maxTileCacheSize?: number | null | undefined;
|
284
|
+
maxTileCacheZoomLevels?: number | undefined;
|
285
|
+
transformRequest?: (import("maplibre-gl").RequestTransformFunction | null) | undefined;
|
286
|
+
transformCameraUpdate?: (import("maplibre-gl").CameraUpdateTransformFunction | null) | undefined;
|
267
287
|
locale?: any;
|
268
|
-
|
269
|
-
|
288
|
+
fadeDuration?: number | undefined;
|
289
|
+
crossSourceCollisions?: boolean | undefined;
|
290
|
+
collectResourceTiming?: boolean | undefined;
|
291
|
+
clickTolerance?: number | undefined;
|
292
|
+
localIdeographFontFamily?: string | false | undefined;
|
270
293
|
pitchWithRotate?: boolean | undefined;
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
initialViewState?:
|
279
|
-
bounds?: import("
|
294
|
+
rollEnabled?: boolean | undefined;
|
295
|
+
pixelRatio?: number | undefined;
|
296
|
+
validateStyle?: boolean | undefined;
|
297
|
+
maxCanvasSize?: [number, number] | undefined;
|
298
|
+
cancelPendingTileRequestsWhileZooming?: boolean | undefined;
|
299
|
+
centerClampedToGround?: boolean | undefined;
|
300
|
+
} & Partial<import("react-map-gl/maplibre").ViewState> & import("react-map-gl/maplibre").MapCallbacks & {
|
301
|
+
initialViewState?: Partial<import("react-map-gl/maplibre").ViewState> & {
|
302
|
+
bounds?: import("maplibre-gl").LngLatBoundsLike;
|
280
303
|
fitBoundsOptions?: {
|
281
|
-
offset?: import("
|
282
|
-
minZoom?: number
|
283
|
-
maxZoom?: number
|
284
|
-
padding?: number | import("
|
285
|
-
}
|
286
|
-
}
|
287
|
-
gl?: WebGLRenderingContext
|
288
|
-
viewState?:
|
304
|
+
offset?: import("maplibre-gl").PointLike;
|
305
|
+
minZoom?: number;
|
306
|
+
maxZoom?: number;
|
307
|
+
padding?: number | import("maplibre-gl").PaddingOptions;
|
308
|
+
};
|
309
|
+
};
|
310
|
+
gl?: WebGLRenderingContext;
|
311
|
+
viewState?: import("react-map-gl/maplibre").ViewState & {
|
289
312
|
width: number;
|
290
313
|
height: number;
|
291
|
-
}
|
292
|
-
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/
|
293
|
-
styleDiffing?: boolean
|
294
|
-
|
295
|
-
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification
|
296
|
-
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
314
|
+
};
|
315
|
+
mapStyle?: string | import("@maplibre/maplibre-gl-style-spec").StyleSpecification | import("react-map-gl/maplibre").ImmutableLike<import("@maplibre/maplibre-gl-style-spec").StyleSpecification>;
|
316
|
+
styleDiffing?: boolean;
|
317
|
+
projection?: import("@maplibre/maplibre-gl-style-spec").ProjectionSpecification | "mercator" | "globe";
|
318
|
+
light?: import("@maplibre/maplibre-gl-style-spec").LightSpecification;
|
319
|
+
terrain?: import("@maplibre/maplibre-gl-style-spec").TerrainSpecification;
|
320
|
+
sky?: import("@maplibre/maplibre-gl-style-spec").SkySpecification;
|
321
|
+
interactiveLayerIds?: string[];
|
322
|
+
cursor?: string;
|
323
|
+
} & import("@vis.gl/react-maplibre/dist/utils/set-globals").GlobalSettings & {
|
324
|
+
mapLib?: import("react-map-gl/maplibre").MapLib | Promise<import("react-map-gl/maplibre").MapLib>;
|
325
|
+
reuseMaps?: boolean;
|
326
|
+
id?: string;
|
327
|
+
style?: React.CSSProperties;
|
304
328
|
children?: any;
|
305
329
|
} & React.RefAttributes<import("react-map-gl/maplibre").MapRef> & {
|
306
|
-
tooltip?: boolean
|
330
|
+
tooltip?: boolean;
|
307
331
|
})[];
|
308
332
|
}, "ref"> & React.RefAttributes<unknown>>;
|
309
333
|
export {};
|
package/dist/index.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { __assign, __spreadArray, __rest, __makeTemplateObject } from 'tslib';
|
2
|
-
import React, { forwardRef, useRef, useMemo, useImperativeHandle, useEffect, useState, useCallback
|
2
|
+
import React, { forwardRef, useRef, useMemo, useImperativeHandle, useEffect, createRef, useState, useCallback } from 'react';
|
3
3
|
import { Map, Source, Layer, useMap } from 'react-map-gl/maplibre';
|
4
|
-
import { isPlainObject,
|
4
|
+
import { isPlainObject, uniq, uniqBy, pick } from 'lodash-es';
|
5
5
|
import { Flex, useRefByKey } from '@orioro/react-ui-core';
|
6
6
|
import styled from 'styled-components';
|
7
7
|
import { mergeRefs } from 'react-merge-refs';
|
@@ -238,7 +238,7 @@ function DataSection(_a) {
|
|
238
238
|
var title = _a.title,
|
239
239
|
entries = _a.entries,
|
240
240
|
props = __rest(_a, ["title", "entries"]);
|
241
|
-
return entries.length > 0 && (
|
241
|
+
return entries.length > 0 && (/*#__PURE__*/React.createElement(DataSectionContainer, __assign({
|
242
242
|
direction: "column",
|
243
243
|
gap: "10px"
|
244
244
|
}, props), title && /*#__PURE__*/React.createElement(DataSectionHeading, null, title), /*#__PURE__*/React.createElement(EntriesList, null, entries.map(function (_a, index) {
|
@@ -246,7 +246,7 @@ function DataSection(_a) {
|
|
246
246
|
value = _a[1];
|
247
247
|
return /*#__PURE__*/React.createElement("li", {
|
248
248
|
key: index
|
249
|
-
}, typeof label === 'string' ? /*#__PURE__*/React.createElement("span", null, label, ": ") : label, typeof value === 'string' ? (
|
249
|
+
}, typeof label === 'string' ? /*#__PURE__*/React.createElement("span", null, label, ": ") : label, typeof value === 'string' ? (/*#__PURE__*/React.createElement("span", {
|
250
250
|
style: {
|
251
251
|
fontWeight: 'bold'
|
252
252
|
}
|
@@ -264,12 +264,12 @@ function HoverTooltip(_a) {
|
|
264
264
|
left: position[0] + 15,
|
265
265
|
top: position[1] - 20
|
266
266
|
}, style)
|
267
|
-
}, Array.isArray(dataSections) && dataSections.length > 0 && (
|
267
|
+
}, Array.isArray(dataSections) && dataSections.length > 0 && (/*#__PURE__*/React.createElement(Flex, {
|
268
268
|
direction: "column"
|
269
269
|
}, dataSections.map(function (section, index) {
|
270
270
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
271
271
|
key: index
|
272
|
-
}, /*#__PURE__*/React.createElement(DataSection, __assign({}, section)), index === dataSections.length - 1 ? null : (
|
272
|
+
}, /*#__PURE__*/React.createElement(DataSection, __assign({}, section)), index === dataSections.length - 1 ? null : (/*#__PURE__*/React.createElement("div", {
|
273
273
|
style: {
|
274
274
|
width: '100%',
|
275
275
|
margin: 0,
|
@@ -481,7 +481,7 @@ function makeSyncedMaps(_a) {
|
|
481
481
|
left: "calc(".concat(index, " * (100% / ").concat(maps.length, "))"),
|
482
482
|
width: "calc(100% / ".concat(maps.length, ")")
|
483
483
|
}
|
484
|
-
}, !isDragging && hoverInfo && hoverInfo.index !== index ? (
|
484
|
+
}, !isDragging && hoverInfo && hoverInfo.index !== index ? (/*#__PURE__*/React.createElement(GhostCursor, {
|
485
485
|
style: {
|
486
486
|
position: 'absolute',
|
487
487
|
left: hoverInfo.point[0],
|
@@ -588,6 +588,23 @@ function useHover(props, deps) {
|
|
588
588
|
}, hoverInfo, isDragging];
|
589
589
|
}
|
590
590
|
|
591
|
+
function _arrayLikeToArray(r, a) {
|
592
|
+
(null == a || a > r.length) && (a = r.length);
|
593
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
594
|
+
return n;
|
595
|
+
}
|
596
|
+
function _arrayWithHoles(r) {
|
597
|
+
if (Array.isArray(r)) return r;
|
598
|
+
}
|
599
|
+
function _extends() {
|
600
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
601
|
+
for (var e = 1; e < arguments.length; e++) {
|
602
|
+
var t = arguments[e];
|
603
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
604
|
+
}
|
605
|
+
return n;
|
606
|
+
}, _extends.apply(null, arguments);
|
607
|
+
}
|
591
608
|
function _iterableToArrayLimit(r, l) {
|
592
609
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
593
610
|
if (null != t) {
|
@@ -596,15 +613,12 @@ function _iterableToArrayLimit(r, l) {
|
|
596
613
|
i,
|
597
614
|
u,
|
598
615
|
a = [],
|
599
|
-
f =
|
600
|
-
o =
|
616
|
+
f = true,
|
617
|
+
o = false;
|
601
618
|
try {
|
602
|
-
if (i = (t = t.call(r)).next, 0 === l)
|
603
|
-
if (Object(t) !== t) return;
|
604
|
-
f = !1;
|
605
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
619
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
606
620
|
} catch (r) {
|
607
|
-
o =
|
621
|
+
o = true, n = r;
|
608
622
|
} finally {
|
609
623
|
try {
|
610
624
|
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
@@ -615,68 +629,38 @@ function _iterableToArrayLimit(r, l) {
|
|
615
629
|
return a;
|
616
630
|
}
|
617
631
|
}
|
618
|
-
function
|
619
|
-
|
620
|
-
for (var i = 1; i < arguments.length; i++) {
|
621
|
-
var source = arguments[i];
|
622
|
-
for (var key in source) {
|
623
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
624
|
-
target[key] = source[key];
|
625
|
-
}
|
626
|
-
}
|
627
|
-
}
|
628
|
-
return target;
|
629
|
-
};
|
630
|
-
return _extends.apply(this, arguments);
|
631
|
-
}
|
632
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
633
|
-
if (source == null) return {};
|
634
|
-
var target = {};
|
635
|
-
var sourceKeys = Object.keys(source);
|
636
|
-
var key, i;
|
637
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
638
|
-
key = sourceKeys[i];
|
639
|
-
if (excluded.indexOf(key) >= 0) continue;
|
640
|
-
target[key] = source[key];
|
641
|
-
}
|
642
|
-
return target;
|
632
|
+
function _nonIterableRest() {
|
633
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
643
634
|
}
|
644
|
-
function _objectWithoutProperties(
|
645
|
-
if (
|
646
|
-
var
|
647
|
-
|
635
|
+
function _objectWithoutProperties(e, t) {
|
636
|
+
if (null == e) return {};
|
637
|
+
var o,
|
638
|
+
r,
|
639
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
648
640
|
if (Object.getOwnPropertySymbols) {
|
649
|
-
var
|
650
|
-
for (
|
651
|
-
key = sourceSymbolKeys[i];
|
652
|
-
if (excluded.indexOf(key) >= 0) continue;
|
653
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
654
|
-
target[key] = source[key];
|
655
|
-
}
|
641
|
+
var n = Object.getOwnPropertySymbols(e);
|
642
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
656
643
|
}
|
657
|
-
return
|
658
|
-
}
|
659
|
-
function _slicedToArray(arr, i) {
|
660
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
644
|
+
return i;
|
661
645
|
}
|
662
|
-
function
|
663
|
-
if (
|
664
|
-
}
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
671
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
646
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
647
|
+
if (null == r) return {};
|
648
|
+
var t = {};
|
649
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
650
|
+
if (-1 !== e.indexOf(n)) continue;
|
651
|
+
t[n] = r[n];
|
652
|
+
}
|
653
|
+
return t;
|
672
654
|
}
|
673
|
-
function
|
674
|
-
|
675
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
676
|
-
return arr2;
|
655
|
+
function _slicedToArray(r, e) {
|
656
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
677
657
|
}
|
678
|
-
function
|
679
|
-
|
658
|
+
function _unsupportedIterableToArray(r, a) {
|
659
|
+
if (r) {
|
660
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
661
|
+
var t = {}.toString.call(r).slice(8, -1);
|
662
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
663
|
+
}
|
680
664
|
}
|
681
665
|
|
682
666
|
var _excluded = ["cursor", "onMouseMove", "onDragStart", "onDragEnd", "children"];
|
@@ -720,8 +704,7 @@ var DEFAULT_MAX_K = 9;
|
|
720
704
|
// https://observablehq.com/@visionscarto/natural-breaks
|
721
705
|
//
|
722
706
|
var elbowiness = function elbowiness(numbers, _a) {
|
723
|
-
_a[
|
724
|
-
var maxK = _a[1];
|
707
|
+
var maxK = _a[1];
|
725
708
|
var intrass = __spreadArray([null], range(1, maxK + 1).map(function (k) {
|
726
709
|
return k === 1 ? variance(numbers) : sum(ckmeans(numbers, k), function (v) {
|
727
710
|
return variance(v);
|
@@ -10,7 +10,7 @@ export type UseHoverProps<DataT = DefaultHoverInfo> = {
|
|
10
10
|
parseEvent?: (event: MapMouseEvent) => DataT;
|
11
11
|
tooltip?: (data: DataT) => React.ReactNode;
|
12
12
|
};
|
13
|
-
export declare function useHover<InfoT = any>(props: UseHoverProps
|
13
|
+
export declare function useHover<InfoT = any>(props: UseHoverProps | undefined, deps: any[]): (boolean | InfoT | {
|
14
14
|
onMouseMove: (event: MapMouseEvent) => void;
|
15
15
|
onMouseOut: () => void;
|
16
16
|
onDragStart: () => void;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orioro/react-maplibre-util",
|
3
|
-
"version": "0.0
|
3
|
+
"version": "0.1.0",
|
4
4
|
"packageManager": "yarn@4.0.2",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/index.mjs",
|
@@ -18,21 +18,22 @@
|
|
18
18
|
"license": "ISC",
|
19
19
|
"scripts": {
|
20
20
|
"build": "rm -rf dist && rollup --config ./rollup.config.mjs",
|
21
|
-
"
|
21
|
+
"dev": "storybook dev -p 6006",
|
22
22
|
"build-storybook": "storybook build"
|
23
23
|
},
|
24
24
|
"devDependencies": {
|
25
|
-
"@orioro/dev": "
|
25
|
+
"@orioro/dev": "^0.0.5",
|
26
26
|
"@tanstack/react-query": "^5.66.0",
|
27
|
+
"next": "14.1.0",
|
27
28
|
"rollup": "^4.13.0",
|
28
29
|
"storybook": "^8.0.0"
|
29
30
|
},
|
30
31
|
"dependencies": {
|
31
|
-
"@orioro/react-chart-util": "
|
32
|
-
"@orioro/react-select": "
|
33
|
-
"@orioro/react-ui-core": "
|
34
|
-
"@orioro/resolve": "
|
35
|
-
"@orioro/scale-util": "
|
32
|
+
"@orioro/react-chart-util": "^0.1.0",
|
33
|
+
"@orioro/react-select": "^3.0.2",
|
34
|
+
"@orioro/react-ui-core": "^0.0.6",
|
35
|
+
"@orioro/resolve": "^0.1.2",
|
36
|
+
"@orioro/scale-util": "^0.0.2",
|
36
37
|
"@turf/turf": "^7.2.0",
|
37
38
|
"@types/d3": "^7.4.3",
|
38
39
|
"@types/d3-scale-chromatic": "^3.1.0",
|
@@ -51,4 +52,4 @@
|
|
51
52
|
"styled-components": "^6.1.8",
|
52
53
|
"tslib": "^2.8.1"
|
53
54
|
}
|
54
|
-
}
|
55
|
+
}
|