@carto/ps-react-maps 1.4.0 → 1.5.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.
@@ -1,6 +1,6 @@
1
1
  import { EditableGeoJsonLayer } from '@nebula.gl/layers';
2
2
  import { EventManager } from 'mjolnir.js';
3
- import { CustomEditableLayerProps } from './map-measurement-tool.types';
3
+ import type { CustomEditableLayerProps } from './map-measurement-tool.types';
4
4
  export declare class CustomEditableGeojsonLayer extends EditableGeoJsonLayer {
5
5
  eventManager: EventManager;
6
6
  constructor(props: CustomEditableLayerProps);
@@ -1,5 +1,5 @@
1
- import { FeatureCollection, MeasureDistanceMode, ModeProps } from '@nebula.gl/edit-modes';
2
- import { BasePointerEvent } from '@nebula.gl/edit-modes/dist-types/types';
1
+ import { FeatureCollection, MeasureDistanceMode, type ModeProps } from '@nebula.gl/edit-modes';
2
+ import type { BasePointerEvent } from '@nebula.gl/edit-modes/dist-types/types';
3
3
  export declare class CustomMeasureDistanceMode extends MeasureDistanceMode {
4
4
  handleClick(event: BasePointerEvent, props: ModeProps<FeatureCollection>): void;
5
5
  handleKeyUp(event: KeyboardEvent, props: ModeProps<FeatureCollection>): void;
@@ -1,5 +1,5 @@
1
- import { MapMeasurementUnit } from './map-measurement-tool.types';
2
- import { LengthUnits } from 'convert-units/definitions/length';
1
+ import { type DefaultMeasureToolProps, MapMeasurementUnit } from './map-measurement-tool.types';
2
+ import type { LengthUnits } from 'convert-units/definitions/length';
3
3
  export declare const EVENT_MANAGER_EVENT_TYPES: string[];
4
4
  export declare const MAP_MEASURE_LAYER_ID = "mapMeasureLayer";
5
5
  export declare const DEFAULT_LAYER_PROPS: {
@@ -29,15 +29,6 @@ export declare const DEFAULT_LAYER_PROPS: {
29
29
  };
30
30
  };
31
31
  export declare const DEFAULT_COLORS: Record<string, [number, number, number, number]>;
32
- export declare const DEFAULT_PROPS: {
33
- locale: string;
34
- getColumnName: string;
35
- styles: {
36
- colors: {
37
- editing: [number, number, number, number];
38
- finished: [number, number, number, number];
39
- };
40
- };
41
- };
32
+ export declare const DEFAULT_PROPS: Required<DefaultMeasureToolProps>;
42
33
  export declare const CONVERSIONS_UNITS: Record<MapMeasurementUnit, LengthUnits>;
43
34
  export declare const INTL_UNITS: Record<MapMeasurementUnit, string>;
@@ -7,4 +7,4 @@ import { type MapMeasurementToolsLayerProps } from './map-measurement-tool.types
7
7
  * @param {MapMeasurementToolsLayerProps['layerProps']} props.layerProps - The layer props.
8
8
  * @returns The rendered map measurement tools layer.
9
9
  */
10
- export declare function MapMeasurementToolsLayer({ mapId, defaultProps: { getColumnName, styles }, layerProps, }: MapMeasurementToolsLayerProps): Layer<never> | null;
10
+ export declare function MapMeasurementToolsLayer({ mapId, defaultProps: { styles }, layerProps, }: MapMeasurementToolsLayerProps): Layer<never> | null;
@@ -1,4 +1,4 @@
1
- import { Theme } from '@mui/material';
1
+ import type { Theme } from '@mui/material';
2
2
  export declare const styles: {
3
3
  container: {
4
4
  display: "flex";
@@ -1,7 +1,7 @@
1
1
  import type { EditableGeojsonLayerProps } from '@nebula.gl/layers/dist-types/layers/editable-geojson-layer';
2
2
  import type { EventManager } from 'mjolnir.js';
3
3
  import type { ReactNode } from 'react';
4
- import { Tooltip } from '@/map-provider';
4
+ import type { Tooltip } from '@/map-provider';
5
5
  export declare enum MapMeasurementUnit {
6
6
  milimeter = "milimeter",
7
7
  centimeter = "centimeter",
@@ -46,6 +46,8 @@ export type CustomEditableLayerProps<D = unknown> = EditableGeojsonLayerProps<D>
46
46
  eventManager: EventManager;
47
47
  selectedFeatures: any[];
48
48
  onChangeFeatures: (features: D[]) => void;
49
+ } & {
50
+ onHover?: MapMeasurementToolsLayerHoverProps;
49
51
  };
50
52
  export type CustomEditableLayerHoverProps = {
51
53
  distance: number;
@@ -70,7 +72,6 @@ export type MapMeasurementToolsLayerEditProps = {
70
72
  };
71
73
  };
72
74
  export type DefaultMeasureToolProps = {
73
- getColumnName: string;
74
75
  styles?: {
75
76
  colors?: {
76
77
  editing?: [number, number, number, number];
@@ -78,9 +79,7 @@ export type DefaultMeasureToolProps = {
78
79
  };
79
80
  };
80
81
  };
81
- export type MapMeasurementToolsLayerLayerProps = Partial<CustomEditableLayerProps & {
82
- onHover?: MapMeasurementToolsLayerHoverProps;
83
- }>;
82
+ export type MapMeasurementToolsLayerLayerProps = Partial<CustomEditableLayerProps>;
84
83
  export type MapMeasurementToolsLayerProps = {
85
84
  mapId: string;
86
85
  defaultProps?: DefaultMeasureToolProps;
@@ -1,7 +1,12 @@
1
1
  import { MapMeasurementUnit } from './map-measurement-tool.types';
2
+ import type { MapsProps } from '@/map-provider';
3
+ import type { ControllerOptions } from '@deck.gl/core/typed/controllers/controller';
2
4
  export declare function convertMetersTo(distance: number, unit: MapMeasurementUnit): number;
3
5
  export declare function getTextLayerFormattedDistance({ meters, unit, locale, }: {
4
6
  meters: number;
5
7
  unit: MapMeasurementUnit;
6
8
  locale: string;
7
9
  }): string;
10
+ export declare function getDeckController(controller: MapsProps['controller'], { hasDoubleClickZoom, }: {
11
+ hasDoubleClickZoom: boolean;
12
+ }): ControllerOptions;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="google.maps" />
2
2
  import type { PickingInfo } from '@deck.gl/core/typed';
3
+ import type { ControllerOptions } from '@deck.gl/core/typed/controllers/controller';
3
4
  import type { GoogleMapsOverlay, GoogleMapsOverlayProps } from '@deck.gl/google-maps/typed';
4
5
  import type { DeckGLProps, DeckGLRef } from '@deck.gl/react/typed';
5
6
  import type { Properties } from 'csstype';
@@ -75,6 +76,7 @@ export type Basemap = (typeof GMapsBasemap)[keyof typeof GMapsBasemap] | (typeof
75
76
  export type CommonProps = {
76
77
  id: string;
77
78
  basemap: Basemap;
79
+ controller?: ControllerOptions;
78
80
  } & DeckGLProps & Partial<MapReferences>;
79
81
  /**
80
82
  * Properties for the maps.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-maps",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "CARTO's Professional Service React Maps library",
5
5
  "files": [
6
6
  "dist"