@mapcomponents/react-maplibre 1.0.9 → 1.0.11

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 (37) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/index.cjs.js +125 -69
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +125 -69
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/src/components/MlClientSearch/lib/createGeojsonFeature.d.ts +3 -2
  7. package/dist/src/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +1 -1
  8. package/dist/src/components/MlCreatePdfForm/lib/PdfPreview.d.ts +1 -1
  9. package/dist/src/components/MlCreatePngButton/MlCreatePngButton.d.ts +1 -1
  10. package/dist/src/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +2 -2
  11. package/dist/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +2 -1
  12. package/dist/src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.d.ts +3 -1
  13. package/dist/src/components/MlGpxViewer/MlGpxViewer.d.ts +1 -1
  14. package/dist/src/components/MlGpxViewer/util/GeoJsonContext.d.ts +3 -3
  15. package/dist/src/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +1 -1
  16. package/dist/src/components/MlLayer/MlLayer.d.ts +1 -1
  17. package/dist/src/components/MlMeasureTool/MlMeasureTool.d.ts +8 -7
  18. package/dist/src/components/MlMultiMeasureTool/MlMultiMeasureTool.d.ts +3 -3
  19. package/dist/src/components/MlSketchTool/MlSketchTool.d.ts +1 -1
  20. package/dist/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +1 -1
  21. package/dist/src/components/MlSpatialElevationProfile/util/getElevationData.d.ts +1 -1
  22. package/dist/src/components/MlTemporalController/MlTemporalController.d.ts +1 -1
  23. package/dist/src/components/MlTemporalController/utils/MlTemporalControllerLabels.d.ts +1 -1
  24. package/dist/src/components/MlTemporalController/utils/useFilterData.d.ts +2 -2
  25. package/dist/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +2 -2
  26. package/dist/src/hooks/useExportMap/lib.d.ts +1 -1
  27. package/dist/src/hooks/useFeatureEditor/useFeatureEditor.d.ts +3 -3
  28. package/dist/src/hooks/useFeatureEditor/utils/FeatureEditorStyle.d.ts +44 -16
  29. package/dist/src/hooks/useGpx/useGpx.d.ts +2 -2
  30. package/dist/src/hooks/useLayer.d.ts +3 -3
  31. package/dist/src/hooks/useLayerHoverPopup/LayerHoverPopup.d.ts +2 -1
  32. package/dist/src/protocol_handlers/csv.d.ts +2 -2
  33. package/dist/src/protocol_handlers/osm.d.ts +2 -2
  34. package/dist/src/protocol_handlers/topojson.d.ts +2 -2
  35. package/dist/src/protocol_handlers/xml.d.ts +2 -2
  36. package/package.json +6 -4
  37. package/rollup.config.mjs +2 -1
@@ -1,3 +1,4 @@
1
- type ExcludedGeometryCollection = GeoJSON.Point | GeoJSON.MultiPoint | GeoJSON.LineString | GeoJSON.MultiLineString | GeoJSON.Polygon;
2
- export declare function createGeoJSONFeature(coordinates: ExcludedGeometryCollection['coordinates']): GeoJSON.Feature<ExcludedGeometryCollection>;
1
+ import { Point, MultiPoint, LineString, MultiLineString, Polygon, Feature } from 'geojson';
2
+ type ExcludedGeometryCollection = Point | MultiPoint | LineString | MultiLineString | Polygon;
3
+ export declare function createGeoJSONFeature(coordinates: ExcludedGeometryCollection['coordinates']): Feature<ExcludedGeometryCollection>;
3
4
  export {};
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { createExportOptions } from 'src/hooks/useExportMap/lib';
3
3
  export interface MlCreatePdfButtonProps {
4
4
  /**
5
- * Id of the target MapLibre instance in mapContext
5
+ * ID of the target MapLibre instance in mapContext
6
6
  */
7
7
  mapId?: string;
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PdfPreviewOptions } from './pdfContext';
3
- import { Feature } from '@turf/turf';
3
+ import { Feature } from 'geojson';
4
4
  type Props = {
5
5
  /**
6
6
  * Id of the target MapLibre instance in mapContext
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { createExportOptions } from 'src/hooks/useExportMap/lib';
3
3
  export interface MlCreatePngButtonProps {
4
4
  /**
5
- * Id of the target MapLibre instance in mapContext
5
+ * ID of the target MapLibre instance in mapContext
6
6
  */
7
7
  mapId?: string;
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Feature, FeatureCollection } from '@turf/turf';
2
+ import { Feature, FeatureCollection } from 'geojson';
3
3
  import { useLayerProps } from '../../hooks/useLayer';
4
4
  import { LineLayerSpecification, CircleLayerSpecification, FillLayerSpecification, LayerSpecification, RasterLayerSpecification } from 'maplibre-gl';
5
5
  export type MlGeoJsonLayerProps = {
@@ -21,7 +21,7 @@ export type MlGeoJsonLayerProps = {
21
21
  /**
22
22
  * GeoJSON data that is supposed to be rendered by this component.
23
23
  */
24
- geojson?: GeoJSON.Feature | GeoJSON.FeatureCollection | Feature | FeatureCollection | undefined;
24
+ geojson?: Feature | FeatureCollection | undefined;
25
25
  /**
26
26
  * Type of the layer that will be added to the MapLibre instance.
27
27
  * All types from LayerSpecification union type are supported except the type from
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
+ import { FeatureCollection } from 'geojson';
2
3
  interface PolygonStylerProps {
3
- geojson: GeoJSON.FeatureCollection;
4
+ geojson: FeatureCollection;
4
5
  openSidebar: boolean;
5
6
  setOpenSidebar: (open: boolean) => void;
6
7
  }
@@ -1,2 +1,4 @@
1
- declare const getDefaulLayerTypeByGeometry: Function;
1
+ import { Feature, FeatureCollection } from "geojson";
2
+ import { LayerSpecification } from "maplibre-gl";
3
+ declare const getDefaulLayerTypeByGeometry: (geojson: Feature | FeatureCollection | undefined) => LayerSpecification['type'];
2
4
  export default getDefaulLayerTypeByGeometry;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FeatureCollection } from '@turf/turf';
2
+ import { FeatureCollection } from 'geojson';
3
3
  import { MetadataType } from '../../hooks/useGpx/useGpx';
4
4
  export interface MlGpxViewerProps {
5
5
  /**
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import { FeatureCollection } from '@turf/turf';
2
+ import { FeatureCollection } from "geojson";
3
3
  type ContextProps = {
4
4
  data: FeatureCollection;
5
- setData: Function;
6
- getEmptyFeatureCollection: Function;
5
+ setData: (data: FeatureCollection) => void;
6
+ getEmptyFeatureCollection: () => FeatureCollection;
7
7
  };
8
8
  declare const GeoJsonContext: React.Context<Partial<ContextProps>>;
9
9
  export declare const GeoJsonContextProvider: React.Provider<Partial<ContextProps>>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SymbolLayerSpecification } from 'maplibre-gl';
3
- import { Feature, FeatureCollection } from '@turf/turf';
3
+ import { Feature, FeatureCollection } from 'geojson';
4
4
  export interface MlImageMarkerLayerProps {
5
5
  /**
6
6
  * Id of the target MapLibre instance in mapContext
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useLayerProps } from '../../hooks/useLayer';
3
- import { Feature, FeatureCollection } from '@turf/turf';
3
+ import { Feature, FeatureCollection } from 'geojson';
4
4
  interface MlLayerProps {
5
5
  /**
6
6
  * Id of the target MapLibre instance in mapContext
@@ -1,6 +1,12 @@
1
1
  import React from 'react';
2
2
  import * as turf from '@turf/turf';
3
- import { GeoJSONObject } from '@turf/turf';
3
+ import { Feature } from 'geojson';
4
+ export interface MlMeasureToolOnChangeOptions {
5
+ value: number;
6
+ unit: string | undefined;
7
+ geojson: Feature;
8
+ geometries?: [];
9
+ }
4
10
  export interface MlMeasureToolProps {
5
11
  /**
6
12
  * String that specify if the Tool measures an area ("polygon") or length ("line")
@@ -14,12 +20,7 @@ export interface MlMeasureToolProps {
14
20
  * Callback function that is called each time measurment geometry within has changed within MlMeasureTool.
15
21
  * First parameter is the new GeoJson feature.
16
22
  */
17
- onChange?: (options: {
18
- value: number;
19
- unit: string | undefined;
20
- geojson: GeoJSONObject;
21
- geometries?: [];
22
- }) => void;
23
+ onChange?: (options: MlMeasureToolOnChangeOptions) => void;
23
24
  /**
24
25
  * Callback function that is called by the end of drawing geometries.
25
26
  */
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { SxProps } from '@mui/material';
3
3
  import * as turf from '@turf/turf';
4
- import { GeoJSONObject } from '@turf/turf';
4
+ import { Feature } from 'geojson';
5
5
  export interface MlMultiMeasureToolProps {
6
6
  /**
7
7
  * Id of the target MapLibre instance in mapContext
@@ -35,8 +35,8 @@ export interface MlMultiMeasureToolProps {
35
35
  */
36
36
  onChange?: (options: {
37
37
  value: number;
38
- unit: string | undefined;
39
- geojson: GeoJSONObject;
38
+ unit?: string;
39
+ geojson: Feature;
40
40
  geometries?: [];
41
41
  }) => void;
42
42
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Feature } from '@turf/turf';
2
+ import { Feature } from 'geojson';
3
3
  import { SxProps } from '@mui/system/styleFunctionSx/styleFunctionSx';
4
4
  export interface MlSketchToolProps {
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Feature, FeatureCollection } from '@turf/turf';
2
+ import { Feature, FeatureCollection } from 'geojson';
3
3
  /**
4
4
  * MlSpatialElevationProfile returns a Button that will add a standard OSM tile layer to the maplibre-gl instance.
5
5
  *
@@ -8,5 +8,5 @@ interface _geojsonInfo {
8
8
  line: line;
9
9
  min: number;
10
10
  }
11
- export default function getElevationData(_geojsonInfo: _geojsonInfo, elevationFactor: number): import("@turf/turf").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
11
+ export default function getElevationData(_geojsonInfo: _geojsonInfo, elevationFactor: number): import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
12
12
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FeatureCollection } from '@turf/turf';
2
+ import { FeatureCollection } from 'geojson';
3
3
  import { LineLayerSpecification, CircleLayerSpecification, FillLayerSpecification, SymbolLayoutProps, SymbolPaintProps } from 'maplibre-gl';
4
4
  import { useLayerProps } from 'src/hooks/useLayer';
5
5
  export interface MlTemporalControllerProps {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SymbolLayerSpecification, SymbolLayoutProps } from 'maplibre-gl';
3
- import { FeatureCollection } from '@turf/turf';
3
+ import { FeatureCollection } from 'geojson';
4
4
  interface MlTemporalControllerLabelsProps {
5
5
  data: FeatureCollection;
6
6
  currentVal: number;
@@ -1,4 +1,4 @@
1
- import { FeatureCollection } from '@turf/turf';
1
+ import { FeatureCollection } from 'geojson';
2
2
  export interface useTemporalControllerProps {
3
3
  geojson: FeatureCollection;
4
4
  timeField: string;
@@ -8,7 +8,7 @@ export interface useTemporalControllerProps {
8
8
  mapId: string | undefined;
9
9
  }
10
10
  export default function useFilterData(props: useTemporalControllerProps): {
11
- filteredData: FeatureCollection<import("@turf/turf").Geometry | import("@turf/turf").GeometryCollection, import("@turf/turf").Properties> | undefined;
11
+ filteredData: FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined;
12
12
  minVal: any;
13
13
  maxVal: any;
14
14
  };
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { Feature } from '@turf/turf';
2
+ import { Feature } from 'geojson';
3
3
  import { MlGeoJsonLayerProps } from '../MlGeoJsonLayer/MlGeoJsonLayer';
4
4
  export type MlTransitionGeoJsonLayerProps = MlGeoJsonLayerProps & {
5
5
  transitionTime?: number;
6
- geojson?: Feature | GeoJSON.Feature;
6
+ geojson?: Feature;
7
7
  };
8
8
  /**
9
9
  * Adds source and layer of types "line", "fill" or "circle" to display GeoJSON data on the map.
@@ -1,7 +1,7 @@
1
1
  import { Map } from 'maplibre-gl';
2
2
  import jsPDF from 'jspdf';
3
3
  import MapLibreGlWrapper from '../../components/MapLibreMap/lib/MapLibreGlWrapper';
4
- import { BBox } from '@turf/turf';
4
+ import { BBox } from 'geojson';
5
5
  interface createExportOptions {
6
6
  map: MapLibreGlWrapper;
7
7
  width: number;
@@ -1,6 +1,6 @@
1
1
  import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
2
2
  import MapboxDraw from '@mapbox/mapbox-gl-draw';
3
- import { GeoJSONObject, Feature } from '@turf/turf';
3
+ import { Feature } from 'geojson';
4
4
  export interface useFeatureEditorProps {
5
5
  /**
6
6
  * Id of the target MapLibre instance in mapContext
@@ -19,7 +19,7 @@ export interface useFeatureEditorProps {
19
19
  * Callback function that is called each time the GeoJson data has changed within MlFeatureEditor.
20
20
  * First parameter is the new GeoJson feature.
21
21
  */
22
- onChange?: (para: GeoJSONObject[]) => void;
22
+ onChange?: (para: Feature[]) => void;
23
23
  /**
24
24
  * Callback function that is called each time the GeoJson data within has been finished within MlFeatureEditor.
25
25
  * First parameter is the new GeoJson feature.
@@ -39,7 +39,7 @@ export interface useFeatureEditorProps {
39
39
  * GeoJson Feature editor that allows to create or manipulate GeoJson data
40
40
  */
41
41
  declare const useFeatureEditor: (props: useFeatureEditorProps) => {
42
- feature: GeoJSONObject[] | undefined;
42
+ feature: Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>[] | undefined;
43
43
  drawToolsReady: boolean;
44
44
  draw: MapboxDraw | undefined;
45
45
  };
@@ -6,11 +6,13 @@ declare function featureEditorStyle(): ({
6
6
  'fill-color': string;
7
7
  'fill-outline-color': string;
8
8
  'fill-opacity': number;
9
- 'circle-radius'?: undefined;
10
- 'circle-color'?: undefined;
11
9
  'line-color'?: undefined;
12
10
  'line-width'?: undefined;
13
11
  'line-dasharray'?: undefined;
12
+ 'circle-radius'?: undefined;
13
+ 'circle-color'?: undefined;
14
+ 'circle-stroke-color'?: undefined;
15
+ 'circle-stroke-width'?: undefined;
14
16
  'circle-opacity'?: undefined;
15
17
  };
16
18
  layout?: undefined;
@@ -18,18 +20,23 @@ declare function featureEditorStyle(): ({
18
20
  id: string;
19
21
  type: string;
20
22
  filter: (string | string[])[];
23
+ layout: {
24
+ 'line-cap': string;
25
+ 'line-join': string;
26
+ };
21
27
  paint: {
22
- 'circle-radius': number;
23
- 'circle-color': string;
28
+ 'line-color': string;
29
+ 'line-width': number;
24
30
  'fill-color'?: undefined;
25
31
  'fill-outline-color'?: undefined;
26
32
  'fill-opacity'?: undefined;
27
- 'line-color'?: undefined;
28
- 'line-width'?: undefined;
29
33
  'line-dasharray'?: undefined;
34
+ 'circle-radius'?: undefined;
35
+ 'circle-color'?: undefined;
36
+ 'circle-stroke-color'?: undefined;
37
+ 'circle-stroke-width'?: undefined;
30
38
  'circle-opacity'?: undefined;
31
39
  };
32
- layout?: undefined;
33
40
  } | {
34
41
  id: string;
35
42
  type: string;
@@ -40,34 +47,53 @@ declare function featureEditorStyle(): ({
40
47
  };
41
48
  paint: {
42
49
  'line-color': string;
50
+ 'line-dasharray': number[];
43
51
  'line-width': number;
44
52
  'fill-color'?: undefined;
45
53
  'fill-outline-color'?: undefined;
46
54
  'fill-opacity'?: undefined;
47
55
  'circle-radius'?: undefined;
48
56
  'circle-color'?: undefined;
49
- 'line-dasharray'?: undefined;
57
+ 'circle-stroke-color'?: undefined;
58
+ 'circle-stroke-width'?: undefined;
50
59
  'circle-opacity'?: undefined;
51
60
  };
52
61
  } | {
53
62
  id: string;
54
63
  type: string;
55
64
  filter: (string | string[])[];
56
- layout: {
57
- 'line-cap': string;
58
- 'line-join': string;
65
+ paint: {
66
+ 'circle-radius': number;
67
+ 'circle-color': string;
68
+ 'circle-stroke-color': string;
69
+ 'circle-stroke-width': number;
70
+ 'fill-color'?: undefined;
71
+ 'fill-outline-color'?: undefined;
72
+ 'fill-opacity'?: undefined;
73
+ 'line-color'?: undefined;
74
+ 'line-width'?: undefined;
75
+ 'line-dasharray'?: undefined;
76
+ 'circle-opacity'?: undefined;
59
77
  };
78
+ layout?: undefined;
79
+ } | {
80
+ id: string;
81
+ type: string;
82
+ filter: (string | string[])[];
60
83
  paint: {
61
- 'line-color': string;
62
- 'line-dasharray': number[];
63
- 'line-width': number;
84
+ 'circle-radius': number;
85
+ 'circle-color': string;
64
86
  'fill-color'?: undefined;
65
87
  'fill-outline-color'?: undefined;
66
88
  'fill-opacity'?: undefined;
67
- 'circle-radius'?: undefined;
68
- 'circle-color'?: undefined;
89
+ 'line-color'?: undefined;
90
+ 'line-width'?: undefined;
91
+ 'line-dasharray'?: undefined;
92
+ 'circle-stroke-color'?: undefined;
93
+ 'circle-stroke-width'?: undefined;
69
94
  'circle-opacity'?: undefined;
70
95
  };
96
+ layout?: undefined;
71
97
  } | {
72
98
  id: string;
73
99
  type: string;
@@ -82,6 +108,8 @@ declare function featureEditorStyle(): ({
82
108
  'line-color'?: undefined;
83
109
  'line-width'?: undefined;
84
110
  'line-dasharray'?: undefined;
111
+ 'circle-stroke-color'?: undefined;
112
+ 'circle-stroke-width'?: undefined;
85
113
  };
86
114
  layout?: undefined;
87
115
  })[];
@@ -1,4 +1,4 @@
1
- import { FeatureCollection } from '@turf/turf';
1
+ import { FeatureCollection } from 'geojson';
2
2
  export interface useGpxProps {
3
3
  /**
4
4
  * a string containing GPX data that is supposed to be parsed and converted to GeoJSON by this hook
@@ -16,7 +16,7 @@ export interface MetadataType {
16
16
  */
17
17
  declare const useGpx: {
18
18
  (props: useGpxProps): {
19
- geojson: FeatureCollection<import("@turf/turf").Geometry | import("@turf/turf").GeometryCollection, import("@turf/turf").Properties> | undefined;
19
+ geojson: FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined;
20
20
  metadata: MetadataType[];
21
21
  };
22
22
  defaultProps: {
@@ -1,7 +1,7 @@
1
1
  import { useMapType } from './useMap';
2
2
  import { GeoJSONSourceSpecification, LayerSpecification, MapMouseEvent, Style, MapEventType, Map, FilterSpecification } from 'maplibre-gl';
3
3
  import MapLibreGlWrapper from '../components/MapLibreMap/lib/MapLibreGlWrapper';
4
- import { GeoJSONObject } from '@turf/turf';
4
+ import { Feature, FeatureCollection, GeoJsonObject } from 'geojson';
5
5
  type getLayerType = Style['getLayer'];
6
6
  type useLayerType = {
7
7
  map: MapLibreGlWrapper | undefined;
@@ -11,7 +11,7 @@ type useLayerType = {
11
11
  mapHook: useMapType;
12
12
  };
13
13
  export type MapEventHandler = (ev: MapMouseEvent & {
14
- features?: GeoJSON.Feature[] | undefined;
14
+ features?: Feature[] | undefined;
15
15
  } & Record<string, unknown>) => void;
16
16
  export interface useLayerProps {
17
17
  mapId?: string;
@@ -19,7 +19,7 @@ export interface useLayerProps {
19
19
  idPrefix?: string;
20
20
  insertBeforeLayer?: string;
21
21
  insertBeforeFirstSymbolLayer?: boolean;
22
- geojson?: GeoJSONObject | GeoJSON.Feature | GeoJSON.FeatureCollection;
22
+ geojson?: GeoJsonObject | Feature | FeatureCollection;
23
23
  options: Partial<LayerSpecification & {
24
24
  source?: GeoJSONSourceSpecification | string;
25
25
  id?: string;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { Feature } from 'geojson';
2
3
  export interface LayerHoverPopupProps {
3
4
  /**
4
5
  * Id of the target MapLibre instance in mapContext
@@ -8,7 +9,7 @@ export interface LayerHoverPopupProps {
8
9
  * Id of an existing layer in the mapLibre instance this event will be registered to
9
10
  */
10
11
  layerId?: string;
11
- getPopupContent: (feature: GeoJSON.Feature) => string;
12
+ getPopupContent: (feature: Feature) => string;
12
13
  }
13
14
  /**
14
15
  * useLayerHoverPopup hook registers a mouseenter event to display feature properties in a MapLibre popup if a feature on the configured layer is hovered
@@ -1,8 +1,8 @@
1
1
  import { RequestParameters } from 'maplibre-gl';
2
- import { FeatureCollection } from '@turf/turf';
2
+ import { FeatureCollection } from 'geojson';
3
3
  import * as csv2geojsonType from './csv2geojson';
4
4
  declare function convertCsv(filename: string, options: csv2geojsonType.csvOptions): Promise<FeatureCollection>;
5
5
  declare const CSVProtocolHandler: (params: RequestParameters) => Promise<{
6
- data: FeatureCollection<import("@turf/turf").Geometry | import("@turf/turf").GeometryCollection, import("@turf/turf").Properties>;
6
+ data: FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
7
7
  }>;
8
8
  export { CSVProtocolHandler, convertCsv };
@@ -1,11 +1,11 @@
1
1
  import { RequestParameters } from 'maplibre-gl';
2
- import { FeatureCollection, Geometry, GeometryCollection, Properties } from '@turf/turf';
2
+ import { FeatureCollection } from 'geojson';
3
3
  import osm2geojson from 'osm2geojson-lite';
4
4
  declare function convertOSM(params: {
5
5
  filename: string;
6
6
  options: osm2geojson.Options;
7
7
  }): Promise<FeatureCollection>;
8
8
  declare const OSMProtocolHandler: (params: RequestParameters) => Promise<{
9
- data: FeatureCollection<Geometry | GeometryCollection, Properties>;
9
+ data: FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
10
10
  }>;
11
11
  export { OSMProtocolHandler, convertOSM };
@@ -1,9 +1,9 @@
1
1
  import { RequestParameters } from 'maplibre-gl';
2
- import { FeatureCollection, Geometry, GeometryCollection, Properties } from '@turf/turf';
2
+ import { FeatureCollection } from 'geojson';
3
3
  declare function convertTopojson(params: {
4
4
  filename: string;
5
5
  }): Promise<FeatureCollection>;
6
6
  declare const TopojsonProtocolHandler: (params: RequestParameters) => Promise<{
7
- data: FeatureCollection<Geometry | GeometryCollection, Properties>;
7
+ data: FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
8
8
  }>;
9
9
  export { TopojsonProtocolHandler, convertTopojson };
@@ -1,10 +1,10 @@
1
1
  import { RequestParameters } from 'maplibre-gl';
2
- import { FeatureCollection, Geometry, GeometryCollection, Properties } from '@turf/turf';
2
+ import { FeatureCollection } from 'geojson';
3
3
  declare function convertXML(params: {
4
4
  filename: string;
5
5
  protocolId: string;
6
6
  }): Promise<FeatureCollection>;
7
7
  declare const XMLProtocolHandler: (params: RequestParameters) => Promise<{
8
- data: FeatureCollection<Geometry | GeometryCollection, Properties>;
8
+ data: FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
9
9
  }>;
10
10
  export { XMLProtocolHandler, convertXML };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mapcomponents/react-maplibre",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "dist/index.cjs.js",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.esm.js",
7
7
  "source": "src/index.ts",
8
- "types": "dist/index.d.ts",
8
+ "types": "dist/src/index.d.ts",
9
9
  "scripts": {
10
10
  "build": "rollup -c",
11
11
  "start": "storybook dev",
@@ -31,9 +31,11 @@
31
31
  "@mui/icons-material": "^6.1.1",
32
32
  "@mui/material": "^6.1.1",
33
33
  "@reduxjs/toolkit": "^2.0.1",
34
+ "@rollup/plugin-json": "^6.1.0",
34
35
  "@tmcw/togeojson": "^5.8.1",
35
- "@turf/turf": "^6.5.0",
36
+ "@turf/turf": "^7.1.0",
36
37
  "@types/d3": "^7.4.3",
38
+ "@types/geojson": "^7946.0.14",
37
39
  "@types/react-color": "^3.0.11",
38
40
  "@types/topojson-client": "^3.1.4",
39
41
  "@xmldom/xmldom": "^0.8.10",
@@ -58,7 +60,7 @@
58
60
  "@babel/preset-react": "^7.23.3",
59
61
  "@bahmutov/cy-rollup": "^2.0.0",
60
62
  "@cfaester/enzyme-adapter-react-18": "^0.7.1",
61
- "@cypress/react": "^8.0.0",
63
+ "@cypress/react18": "^2.0.1",
62
64
  "@rollup/plugin-babel": "^6.0.4",
63
65
  "@rollup/plugin-commonjs": "^25.0.7",
64
66
  "@rollup/plugin-url": "^8.0.2",
package/rollup.config.mjs CHANGED
@@ -9,8 +9,9 @@ import externals from 'rollup-plugin-node-externals';
9
9
  import css from 'rollup-plugin-import-css';
10
10
  import del from 'rollup-plugin-delete';
11
11
  import svgr from '@svgr/rollup';
12
+ import * as fs from 'node:fs';
12
13
 
13
- import pkg from './package.json' assert {type:"json"};
14
+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
14
15
 
15
16
  const externalsConfig = {
16
17
  deps: true,