@orioro/react-maplibre-util 0.2.0 → 0.3.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 +6 -0
- package/dist/Controls/ControlContainer/index.d.ts +1 -1
- package/dist/Controls/InspectControl/InspectControl.d.ts +3 -0
- package/dist/Controls/InspectControl/index.d.ts +1 -0
- package/dist/Controls/index.d.ts +1 -0
- package/dist/MapboxGeocoderControl/MapboxGeocoderControl.d.ts +16 -0
- package/dist/MapboxGeocoderControl/ResultMarker.d.ts +5 -0
- package/dist/MapboxGeocoderControl/index.d.ts +1 -0
- package/dist/index.mjs +18 -2
- package/dist/util/matchExpFromDict/index.d.ts +1 -0
- package/dist/util/matchExpFromDict/matchExpFromDict.d.ts +8 -0
- package/package.json +4 -1
- package/dist/MapboxGeocoder/MapboxGeocoder.d.ts +0 -2
- package/dist/MapboxGeocoder/MapboxGeocoder.stories_.d.ts +0 -11
- package/dist/MapboxGeocoder/mapboxGeocoderApi.d.ts +0 -9
package/CHANGELOG.md
CHANGED
@@ -10,7 +10,7 @@ export type ControlContainerProps = {
|
|
10
10
|
};
|
11
11
|
export declare function ControlContainer({ style, position, children, }: ControlContainerProps): React.ReactPortal | null;
|
12
12
|
export declare namespace ControlContainer {
|
13
|
-
var
|
13
|
+
var Unstyled: typeof ControlContainerWithStyleReset;
|
14
14
|
}
|
15
15
|
declare function ControlContainerWithStyleReset({ style, ...props }: ControlContainerProps): React.JSX.Element;
|
16
16
|
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './InspectControl';
|
package/dist/Controls/index.d.ts
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { MarkerProps, ControlPosition } from 'react-map-gl/maplibre';
|
3
|
+
import { GeocoderOptions } from '@mapbox/mapbox-gl-geocoder';
|
4
|
+
import '@mapbox/mapbox-gl-geocoder/dist/mapbox-gl-geocoder.css';
|
5
|
+
type MapboxGeocoderControlProps = Omit<GeocoderOptions, 'accessToken' | 'mapboxgl' | 'marker'> & {
|
6
|
+
marker?: boolean | Omit<MarkerProps, 'longitude' | 'latitude'>;
|
7
|
+
position: ControlPosition;
|
8
|
+
onClear?: (e: object) => void;
|
9
|
+
onLoading?: (e: object) => void;
|
10
|
+
onResults?: (e: object) => void;
|
11
|
+
onResult?: (e: object) => void;
|
12
|
+
onError?: (e: object) => void;
|
13
|
+
[key: string]: any;
|
14
|
+
};
|
15
|
+
export declare function MapboxGeocoderControl({ position, types, onClear, onLoading, onResults, onResult, onError, accessToken, ...props }: MapboxGeocoderControlProps): React.ReactNode;
|
16
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './MapboxGeocoderControl';
|
package/dist/index.mjs
CHANGED
@@ -16,6 +16,8 @@ import { Icon } from '@mdi/react';
|
|
16
16
|
import { Tooltip } from '@radix-ui/themes';
|
17
17
|
import maplibregl from 'maplibre-gl';
|
18
18
|
import mlcontour from 'maplibre-contour';
|
19
|
+
import MaplibreInspect from '@maplibre/maplibre-gl-inspect';
|
20
|
+
import '@maplibre/maplibre-gl-inspect/dist/maplibre-gl-inspect.css';
|
19
21
|
|
20
22
|
function sortLayers(layers, _a) {
|
21
23
|
var existingLayers = _a.existingLayers;
|
@@ -1040,7 +1042,7 @@ function ControlContainerWithStyleReset(_a) {
|
|
1040
1042
|
})
|
1041
1043
|
}));
|
1042
1044
|
}
|
1043
|
-
ControlContainer.
|
1045
|
+
ControlContainer.Unstyled = ControlContainerWithStyleReset;
|
1044
1046
|
|
1045
1047
|
var DEFAULT_DEM_SOURCE_ID = 'dem';
|
1046
1048
|
var DEFAULT_DEM_SOURCE_SPEC = {
|
@@ -1345,4 +1347,18 @@ function TerrainControl(_a) {
|
|
1345
1347
|
}))))));
|
1346
1348
|
}
|
1347
1349
|
|
1348
|
-
|
1350
|
+
function InspectControl(props) {
|
1351
|
+
useControl(function () {
|
1352
|
+
return new MaplibreInspect(__assign(__assign({}, props), {
|
1353
|
+
popup: new maplibregl.Popup({
|
1354
|
+
closeButton: false,
|
1355
|
+
closeOnClick: false
|
1356
|
+
})
|
1357
|
+
}));
|
1358
|
+
}, {
|
1359
|
+
// position: props.position,
|
1360
|
+
});
|
1361
|
+
return null;
|
1362
|
+
}
|
1363
|
+
|
1364
|
+
export { $naturalBreaks, ControlContainer, HoverTooltip, InspectControl, LayeredMap, MapWindow, SyncedMaps, TerrainControl, applyReactStyle, augmentFeature, ensureAddLayer, ensureAddSource, ensureRemoveLayer, ensureRemoveSource, fitGeometry, getSrcLayer, getSrcViewByLayerId, hoverParseEvent, makeSyncedMaps, mapSetFeaturesState, naturalBreakBounds, parseMapViews, scaleNaturalBreaks, sortLayers, useClientRect, useHover, withHover };
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './matchExpFromDict';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
type Dict = Record<any, (string | number) | (string | number)[]>;
|
2
|
+
type MatchExpFromDictProps = {
|
3
|
+
valueExp: string | any[];
|
4
|
+
dict: Dict;
|
5
|
+
defaultValue: any;
|
6
|
+
};
|
7
|
+
export declare function matchExpFromDict({ valueExp, dict, defaultValue, }: MatchExpFromDictProps): any[];
|
8
|
+
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orioro/react-maplibre-util",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.3.0",
|
4
4
|
"packageManager": "yarn@4.0.2",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/index.mjs",
|
@@ -29,6 +29,8 @@
|
|
29
29
|
"storybook": "^8.0.0"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
+
"@mapbox/mapbox-gl-geocoder": "^5.0.3",
|
33
|
+
"@maplibre/maplibre-gl-inspect": "^1.7.1",
|
32
34
|
"@mdi/js": "^7.4.47",
|
33
35
|
"@mdi/react": "^1.6.1",
|
34
36
|
"@orioro/react-chart-util": "^0.1.0",
|
@@ -41,6 +43,7 @@
|
|
41
43
|
"@types/d3": "^7.4.3",
|
42
44
|
"@types/d3-scale-chromatic": "^3.1.0",
|
43
45
|
"@types/geojson": "^7946.0.16",
|
46
|
+
"@types/mapbox__mapbox-gl-geocoder": "^5.0.0",
|
44
47
|
"@types/react-dom": "^19.1.3",
|
45
48
|
"d3": "^7.9.0",
|
46
49
|
"d3-scale-chromatic": "^3.1.0",
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import 'maplibre-gl/dist/maplibre-gl.css';
|
3
|
-
import '@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css';
|
4
|
-
declare const _default: {
|
5
|
-
title: string;
|
6
|
-
parameters: {
|
7
|
-
layout: string;
|
8
|
-
};
|
9
|
-
};
|
10
|
-
export default _default;
|
11
|
-
export declare const Basic: () => React.JSX.Element;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
export type MapboxGeocoderApiProps = {
|
2
|
-
accessToken: string;
|
3
|
-
};
|
4
|
-
export declare function mapboxGeocoderApi({ accessToken }: MapboxGeocoderApiProps): {
|
5
|
-
forwardGeocode: (input: any) => Promise<void>;
|
6
|
-
reverseGeocode: (input: any) => Promise<void>;
|
7
|
-
getSuggestions: (config: any) => any;
|
8
|
-
searchByPlaceId: ({ query, language, }: MaplibreGeocoderApiConfig) => Promise<MaplibreGeocoderPlaceResults>;
|
9
|
-
};
|