@mapcomponents/react-maplibre 0.1.85 → 0.1.87

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/MlCenterPosition/MlCenterPosition.d.ts +0 -2
  3. package/dist/components/MlCenterPosition/MlCenterPosition.stories.d.ts +0 -2
  4. package/dist/components/MlFeatureEditor/MlFeatureEditor.stories.d.ts +1 -0
  5. package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +1 -1
  6. package/dist/components/MlFillExtrusionLayer/MlFillExtrusionLayer.stories.d.ts +26 -9
  7. package/dist/components/MlFollowGps/MlFollowGps.d.ts +0 -1
  8. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +1 -1
  9. package/dist/components/MlGeoJsonLayer/MlGeoJsonLayer.stories.d.ts +1 -0
  10. package/dist/components/MlMeasureTool/MlMeasureTool.d.ts +12 -2
  11. package/dist/components/MlMeasureTool/MlMeasureTool.stories.d.ts +1 -0
  12. package/dist/components/MlNavigationCompass/MlNavigationCompass.stories.d.ts +1 -1
  13. package/dist/components/MlNavigationTools/MlNavigationTools.stories.d.ts +2 -1
  14. package/dist/components/MlScaleReference/MlScaleReference.stories.d.ts +1 -1
  15. package/dist/components/MlTemporalController/MlTemporalController.stories.d.ts +1 -0
  16. package/dist/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +1 -1
  17. package/dist/components/MlWmsLoader/MlWmsLoader.d.ts +2 -0
  18. package/dist/contexts/LayerContext.d.ts +1 -0
  19. package/dist/hooks/useAddImage/useAddImage.d.ts +20 -0
  20. package/dist/hooks/useAddImage/useAddImage.stories.d.ts +14 -0
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.esm.js +922 -681
  23. package/dist/index.esm.js.map +1 -1
  24. package/dist/ui_components/LayerList/LayerListItem.d.ts +2 -0
  25. package/dist/ui_components/LayerList/LayerListItemFactory.d.ts +1 -0
  26. package/dist/ui_components/LayerList/util/SortableContainer.d.ts +7 -0
  27. package/dist/ui_components/MapcomponentsTheme.d.ts +8 -0
  28. package/package.json +7 -5
package/CHANGELOG.md CHANGED
@@ -1,4 +1,26 @@
1
1
  # Change Log
2
+ ## [v0.1.87] - 2023-10-25
3
+
4
+ ### Changed
5
+ - 27f1cb2: show measured value in m and in units if measured value is < 0.1km or 0.1mi
6
+ - e606c7c: add catalogue specific demo storybook stories to be able to also provide more useful stories for developers not shown in the catalogue
7
+
8
+ ### Added
9
+ - cb3057f: make layerlist items in layerlistitemfactory sortable via drag & drop
10
+
11
+ ## [v0.1.86] - 2023-09-13
12
+
13
+ ### Fixed
14
+ - 6882b80: fix: LayerList deleteIcon layout
15
+ - e5ab361: demo bugfixes
16
+
17
+ ### Changed
18
+ - 7eb6dda: update xmldom ^0.6.0 to @xmldom/xmldom ^0.8.10 (#130) …
19
+
20
+ ### Added
21
+ - 1a221e3: add compNorth, compSouth, compStroke compass styling options to theme
22
+ - 75de07d: add useAddImage hook + story
23
+
2
24
  ## [v0.1.85] - 2023-07-14
3
25
 
4
26
  ### Fixed
@@ -31,8 +31,6 @@ declare const MlCenterPosition: {
31
31
  (props: MlCenterPositionProps): JSX.Element;
32
32
  defaultProps: {
33
33
  mapId: undefined;
34
- onColor: string;
35
- offColor: string;
36
34
  };
37
35
  };
38
36
  export default MlCenterPosition;
@@ -5,8 +5,6 @@ declare const storyoptions: {
5
5
  (props: import("./MlCenterPosition").MlCenterPositionProps): JSX.Element;
6
6
  defaultProps: {
7
7
  mapId: undefined;
8
- onColor: string;
9
- offColor: string;
10
8
  };
11
9
  };
12
10
  argTypes: {};
@@ -13,3 +13,4 @@ export declare const EditLinestring: any;
13
13
  export declare const DrawPolygon: any;
14
14
  export declare const DrawPoint: any;
15
15
  export declare const DrawLinestring: any;
16
+ export declare const catalogueDemo: any;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- interface MlFillExtrusionLayerProps {
2
+ export interface MlFillExtrusionLayerProps {
3
3
  /**
4
4
  * Id of the target MapLibre instance in mapContext
5
5
  */
@@ -1,10 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { MlFillExtrusionLayerProps } from './MlFillExtrusionLayer';
3
+ declare const storyoptions: {
4
+ title: string;
5
+ component: {
6
+ (props: MlFillExtrusionLayerProps): JSX.Element;
7
+ defaultProps: {
8
+ mapId: undefined;
9
+ paint: {
10
+ "fill-extrusion-color": string;
11
+ "fill-extrusion-height": {
12
+ property: string;
13
+ type: string;
14
+ };
15
+ "fill-extrusion-base": {
16
+ property: string;
17
+ type: string;
18
+ };
19
+ "fill-extrusion-opacity": number;
20
+ };
21
+ };
22
+ };
23
+ argTypes: {};
24
+ decorators: ((Story: any, context: any) => JSX.Element)[];
25
+ };
1
26
  export default storyoptions;
2
- export const ExampleConfig: any;
3
- declare namespace storyoptions {
4
- export const title: string;
5
- export { MlFillExtrusionLayer as component };
6
- export const argTypes: {};
7
- export { mapContextDecorator as decorators };
8
- }
9
- import MlFillExtrusionLayer from "./MlFillExtrusionLayer";
10
- import mapContextDecorator from "../../decorators/MapContextDecorator";
27
+ export declare const ExampleConfig: any;
@@ -70,7 +70,6 @@ declare const MlFollowGps: {
70
70
  (props: MlFollowGpsProps): JSX.Element;
71
71
  defaultProps: {
72
72
  mapId: undefined;
73
- onColor: string;
74
73
  offColor: string;
75
74
  showAccuracyCircle: boolean;
76
75
  showUserLocation: boolean;
@@ -52,7 +52,7 @@ export type MlGeoJsonLayerProps = {
52
52
  * RasterLayerSpecification
53
53
 
54
54
  */
55
- layout?: Exclude<LayerSpecification['layout'], RasterLayerSpecification['layout']>;
55
+ layout?: LayerSpecification['layout'];
56
56
  /**
57
57
  * Javascript object that is spread into the addLayer commands first parameter.
58
58
  */
@@ -13,3 +13,4 @@ export declare const Polygon: any;
13
13
  export declare const HeatMap: any;
14
14
  export declare const Symbol: any;
15
15
  export declare const DefaultPaintOverrides: any;
16
+ export declare const catalogueDemo: any;
@@ -1,14 +1,24 @@
1
1
  /// <reference types="react" />
2
- import * as turf from "@turf/turf";
2
+ import * as turf from '@turf/turf';
3
+ import { GeoJSONObject } from '@turf/turf';
3
4
  interface MlMeasureToolProps {
4
5
  /**
5
6
  * String that specify if the Tool measures an area ("polygon") or length ("line")
6
7
  */
7
- measureType?: string;
8
+ measureType?: 'polygon' | 'line';
8
9
  /**
9
10
  * String that dictates which unit of measurement is used
10
11
  */
11
12
  unit?: turf.Units;
13
+ /**
14
+ * Callback function that is called each time measurment geometry within has changed within MlMeasureTool.
15
+ * First parameter is the new GeoJson feature.
16
+ */
17
+ onChange?: (options: {
18
+ value: number;
19
+ unit: string | undefined;
20
+ geojson: GeoJSONObject;
21
+ }) => void;
12
22
  }
13
23
  declare const MlMeasureTool: {
14
24
  (props: MlMeasureToolProps): JSX.Element;
@@ -1,6 +1,7 @@
1
1
  export default storyoptions;
2
2
  export const MeasureLine: any;
3
3
  export const MeasurePolygon: any;
4
+ export const catalogueDemo: any;
4
5
  declare namespace storyoptions {
5
6
  export const title: string;
6
7
  export { MlMeasureTool as component };
@@ -1,5 +1,5 @@
1
1
  export default storyoptions;
2
- export const Standard: any;
2
+ export const catalogueDemo: any;
3
3
  export const StyleExample: any;
4
4
  declare namespace storyoptions {
5
5
  export const title: string;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { MlNavigationToolsProps } from "./MlNavigationTools";
2
+ import { MlNavigationToolsProps } from './MlNavigationTools';
3
3
  declare const storyoptions: {
4
4
  title: string;
5
5
  component: {
@@ -26,3 +26,4 @@ export declare const AlternativePosition: any;
26
26
  export declare const NoZoomButtons: any;
27
27
  export declare const NoFollowGpsButton: any;
28
28
  export declare const CustomButton: any;
29
+ export declare const catalogueDemo: any;
@@ -10,5 +10,5 @@ declare const storyoptions: {
10
10
  decorators: ((Story: any, context: any) => JSX.Element)[];
11
11
  };
12
12
  export default storyoptions;
13
- export declare const Toolbar: any;
13
+ export declare const catalogueDemo: any;
14
14
  export declare const Overlay: any;
@@ -31,3 +31,4 @@ export default storyoptions;
31
31
  export declare const FillConfig: any;
32
32
  export declare const CircleConfig: any;
33
33
  export declare const LineConfig: any;
34
+ export declare const catalogueDemo: any;
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
7
7
  */
8
8
  export interface MlThreeJsLayerProps {
9
9
  mapId?: string;
10
- init?: object;
10
+ init?: () => void;
11
11
  onDone?: () => void;
12
12
  }
13
13
  declare const MlThreeJsLayer: {
@@ -37,6 +37,7 @@ export interface MlWmsLoaderProps {
37
37
  * Id of the target MapLibre instance in mapContext
38
38
  */
39
39
  mapId?: string;
40
+ layerId?: string;
40
41
  insertBeforeLayer?: string;
41
42
  /**
42
43
  * URL parameters that will be used in the getCapabilities request
@@ -88,6 +89,7 @@ export interface MlWmsLoaderProps {
88
89
  * Custom buttons to display for the WMSLoader
89
90
  */
90
91
  buttons?: JSX.Element;
92
+ sortable?: boolean;
91
93
  }
92
94
  export type LayerType = {
93
95
  visible: boolean;
@@ -38,6 +38,7 @@ export interface LayerContextType {
38
38
  tileUrl: string;
39
39
  moveUp: (layerId: string) => void;
40
40
  moveDown: (layerId: string) => void;
41
+ moveLayer: (layerId: string, getNewPos: (oldPos: number) => number) => void;
41
42
  }
42
43
  declare const LayerContext: React.Context<LayerContextType>;
43
44
  declare function LayerContextProvider(props: LayerContextProps): JSX.Element;
@@ -0,0 +1,20 @@
1
+ export interface useAddImageProps {
2
+ /**
3
+ *
4
+ */
5
+ imageId: string;
6
+ /**
7
+ *
8
+ */
9
+ imagePath: string;
10
+ }
11
+ /**
12
+ *
13
+ */
14
+ declare const useAddImage: {
15
+ (props: useAddImageProps): void;
16
+ defaultProps: {
17
+ mapId: undefined;
18
+ };
19
+ };
20
+ export default useAddImage;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ declare const storyoptions: {
3
+ title: string;
4
+ component: {
5
+ (props: import("./useAddImage").useAddImageProps): void;
6
+ defaultProps: {
7
+ mapId: undefined;
8
+ };
9
+ };
10
+ argTypes: {};
11
+ decorators: ((Story: any, context: any) => JSX.Element)[];
12
+ };
13
+ export default storyoptions;
14
+ export declare const ExampleConfig: any;
package/dist/index.d.ts CHANGED
@@ -35,6 +35,7 @@ export { default as MlTemporalController } from "./components/MlTemporalControll
35
35
  export { default as MlBasicComponent } from "./components/MlBasicComponent.js";
36
36
  export { default as MlOrderLayers } from "./components/MlOrderLayers/MlOrderLayers";
37
37
  export { default as MlTerrainLayer } from "./components/MlTerrainLayer/MlTerrainLayer";
38
+ export { default as MlSketchTool } from './components/MlSketchTool/MlSketchTool';
38
39
  export { default as useCameraFollowPath } from "./hooks/useCameraFollowPath/useCameraFollowPath";
39
40
  export { default as useExportMap } from "./hooks/useExportMap";
40
41
  export { default as useGpx } from "./hooks/useGpx/useGpx";