@orioro/react-maplibre-util 0.0.2 → 0.2.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 +17 -0
- package/dist/Controls/ControlContainer/index.d.ts +16 -0
- package/dist/Controls/TerrainControl/TerrainControl.d.ts +21 -0
- package/dist/Controls/TerrainControl/index.d.ts +1 -0
- package/dist/Controls/index.d.ts +2 -0
- package/dist/GeocoderCtrl_MapLibre/mapboxGeocoderApi.d.ts +1 -1
- package/dist/HoverTooltip/HoverTooltip.d.ts +3 -2
- 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 +260 -234
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +741 -218
- package/dist/useHover/useHover.d.ts +5 -4
- package/dist/util/applyReactStyle.d.ts +2 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/misc.d.ts +5 -0
- package/package.json +12 -4
- package/dist/tmpMapView/MapView.d.ts +0 -3
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# @orioro/react-maplibre-util
|
2
2
|
|
3
|
+
## 0.2.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- implement 3D maps
|
8
|
+
|
9
|
+
## 0.1.0
|
10
|
+
|
11
|
+
### Minor Changes
|
12
|
+
|
13
|
+
- move georedus-related packages to isolated repo
|
14
|
+
|
15
|
+
### Patch Changes
|
16
|
+
|
17
|
+
- Updated dependencies
|
18
|
+
- @orioro/react-chart-util@0.1.0
|
19
|
+
|
3
20
|
## 0.0.2
|
4
21
|
|
5
22
|
### Patch Changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import maplibregl from 'maplibre-gl';
|
3
|
+
export type ControlContainerProps = {
|
4
|
+
/** Optional style for the outer container */
|
5
|
+
style?: React.CSSProperties;
|
6
|
+
/** Optional position in MapLibre control bar */
|
7
|
+
position?: maplibregl.ControlPosition;
|
8
|
+
/** Button content and props */
|
9
|
+
children: React.ReactNode;
|
10
|
+
};
|
11
|
+
export declare function ControlContainer({ style, position, children, }: ControlContainerProps): React.ReactPortal | null;
|
12
|
+
export declare namespace ControlContainer {
|
13
|
+
var StyleReset: typeof ControlContainerWithStyleReset;
|
14
|
+
}
|
15
|
+
declare function ControlContainerWithStyleReset({ style, ...props }: ControlContainerProps): React.JSX.Element;
|
16
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ControlContainerProps } from '../ControlContainer';
|
3
|
+
import maplibregl from 'maplibre-gl';
|
4
|
+
import type { GlobalContourTileOptions } from 'maplibre-contour/dist/types';
|
5
|
+
type TerrainSettings = {
|
6
|
+
hillshade?: boolean;
|
7
|
+
enable3d?: boolean;
|
8
|
+
contours?: boolean;
|
9
|
+
};
|
10
|
+
type SourceSpecInput = Omit<maplibregl.RasterDEMSourceSpecification, 'type' | 'tiles' | 'url'> & {
|
11
|
+
url: string;
|
12
|
+
};
|
13
|
+
type TerrainControlProps = Omit<ControlContainerProps, 'children'> & {
|
14
|
+
value?: TerrainSettings | false;
|
15
|
+
onSetValue?: (v: TerrainSettings | false) => any;
|
16
|
+
demSourceId?: string;
|
17
|
+
demSource?: SourceSpecInput;
|
18
|
+
contourTileOptions?: Partial<GlobalContourTileOptions>;
|
19
|
+
};
|
20
|
+
export declare function TerrainControl({ value: externalValue, onSetValue: onSetExternalValue, demSourceId: DEM_SOURCE_ID, demSource: DEM_SOURCE_SPEC, contourTileOptions: contourTileOptionsInput, }: TerrainControlProps): React.JSX.Element;
|
21
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './TerrainControl';
|
@@ -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
|
};
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { FlexProps } from '@orioro/react-ui-core';
|
3
3
|
type DataSectionProps = FlexProps & {
|
4
|
-
title
|
5
|
-
entries
|
4
|
+
title?: string;
|
5
|
+
entries?: [React.ReactNode, React.ReactNode][];
|
6
6
|
};
|
7
7
|
type HoverTooltipProps = {
|
8
8
|
position: [number, number];
|
@@ -10,5 +10,6 @@ type HoverTooltipProps = {
|
|
10
10
|
dataSections?: DataSectionProps[];
|
11
11
|
style?: React.CSSProperties;
|
12
12
|
};
|
13
|
+
export declare function useClientRect<T extends HTMLElement>(): readonly [DOMRect | null, (node: T | null) => void];
|
13
14
|
export declare function HoverTooltip({ position, children, dataSections, style, }: HoverTooltipProps): React.JSX.Element;
|
14
15
|
export {};
|
@@ -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;
|