@milemaker/milemaker-js 1.0.5 → 2.0.0-alpha.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.
Files changed (64) hide show
  1. package/README.md +1 -1
  2. package/dist/actions/constants/actions.constants.d.ts +4 -2
  3. package/dist/actions/index.d.ts +4 -1
  4. package/dist/actions/layer/baseLayerActions.factory.d.ts +1 -1
  5. package/dist/actions/layer/index.d.ts +5 -2
  6. package/dist/actions/layer/truckRestrictionsLayerActions.factory.d.ts +2 -0
  7. package/dist/actions/layer/types/layerActions.types.d.ts +59 -7
  8. package/dist/actions/layer/weatherLayerActions.factory.d.ts +8 -0
  9. package/dist/actions/marker/types/markerActions.types.d.ts +1 -1
  10. package/dist/actions/popup/types/popupActions.types.d.ts +1 -1
  11. package/dist/components/Menu/Menu.d.ts +2 -0
  12. package/dist/components/Menu/Menu.types.d.ts +15 -0
  13. package/dist/components/Menu/MenuItem.d.ts +3 -0
  14. package/dist/components/Popper/Popper.d.ts +3 -0
  15. package/dist/components/Popper/Popper.types.d.ts +32 -0
  16. package/dist/components/Radio/Radio.types.d.ts +9 -0
  17. package/dist/components/Radio/RadioButton.d.ts +3 -0
  18. package/dist/components/Radio/RadioButtonGroup.d.ts +3 -0
  19. package/dist/components/WeatherLegend/RainSnowIceLegend/RainSnowIceLegend.d.ts +3 -0
  20. package/dist/components/WeatherLegend/RainSnowIceLegend/RainSnowIceLegend.types.d.ts +18 -0
  21. package/dist/components/WeatherLegend/RainSnowIceLegend/index.d.ts +2 -0
  22. package/dist/components/WeatherLegend/WeatherAlertsLegend/WeatherAlertsLegend.constants.d.ts +2 -0
  23. package/dist/components/WeatherLegend/WeatherAlertsLegend/WeatherAlertsLegend.d.ts +3 -0
  24. package/dist/components/WeatherLegend/WeatherAlertsLegend/WeatherAlertsLegend.types.d.ts +12 -0
  25. package/dist/components/WeatherLegend/WeatherAlertsLegend/index.d.ts +2 -0
  26. package/dist/components/WeatherLegend/WeatherLegend.d.ts +3 -0
  27. package/dist/components/WeatherLegend/WeatherLegend.types.d.ts +19 -0
  28. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/WeatherTemperaturesLegend.constants.d.ts +2 -0
  29. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/WeatherTemperaturesLegend.d.ts +3 -0
  30. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/WeatherTemperaturesLegend.types.d.ts +15 -0
  31. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/index.d.ts +2 -0
  32. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/WeatherWindSpeedsLegend.constants.d.ts +6 -0
  33. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/WeatherWindSpeedsLegend.d.ts +3 -0
  34. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/WeatherWindSpeedsLegend.types.d.ts +15 -0
  35. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/index.d.ts +2 -0
  36. package/dist/components/WeatherLegend/index.d.ts +6 -0
  37. package/dist/components/index.d.ts +9 -0
  38. package/dist/controls/createOverlayLayerControl.factory.d.ts +3 -0
  39. package/dist/controls/createTruckRestrictionsLayerControl.factory.d.ts +3 -0
  40. package/dist/controls/createWeatherLayerControl.factory.d.ts +3 -0
  41. package/dist/controls/index.d.ts +3 -0
  42. package/dist/controls/types/controls.types.d.ts +35 -0
  43. package/dist/controls/utils/index.d.ts +4 -0
  44. package/dist/controls/utils/weatherLayers.constants.d.ts +5 -0
  45. package/dist/controls/utils/weatherLayers.helpers.d.ts +12 -0
  46. package/dist/controls/utils/weatherLayers.rendering.d.ts +2 -0
  47. package/dist/controls/utils/weatherLayers.types.d.ts +1 -0
  48. package/dist/createMap/errorMap/createMap.error.d.ts +3 -2
  49. package/dist/createMap/types/createMap.types.d.ts +7 -2
  50. package/dist/helpers/parseStringAsJson.d.ts +1 -1
  51. package/dist/index.cjs +366 -179
  52. package/dist/index.js +24119 -22816
  53. package/dist/types/common.enums.d.ts +23 -0
  54. package/dist/types/common.types.d.ts +13 -0
  55. package/dist/utils/constants.d.ts +28 -0
  56. package/dist/utils/helpers/getBrowserInfo.helper.d.ts +2 -0
  57. package/dist/utils/helpers/getMailToSupportHrefLink.helper.d.ts +8 -0
  58. package/dist/utils/helpers/limitEmailLength.helper.d.ts +2 -0
  59. package/dist/utils/helpers/prepareAppErrorMailToData.helper.d.ts +7 -0
  60. package/dist/utils/helpers/prepareContactSupportMandatoryFields.helper.d.ts +4 -0
  61. package/dist/utils/types.d.ts +13 -0
  62. package/dist/utils/version.d.ts +1 -0
  63. package/package.json +5 -4
  64. package/dist/helpers/getMailToSupportHrefLink.helper.d.ts +0 -13
package/README.md CHANGED
@@ -33,7 +33,7 @@ Add such lines
33
33
  mapInstance.controls.createBaseLayerControl();
34
34
  mapInstance.controls.createZoomControl();
35
35
  mapInstance.controls.createCurrentPositionControl();
36
- mapInstance.controls.createTrafficLayerControl();
36
+ mapInstance.controls.createOverlayLayerControl();
37
37
  ```
38
38
 
39
39
  ### Documentation
@@ -1,12 +1,14 @@
1
- import { MapBaseLayer } from "../../types";
1
+ import { GeneralAppSettings, MapBaseLayer } from "../../types";
2
2
  export declare const DEFAULT_BASE_LAYER = MapBaseLayer.STREETS;
3
- export declare const DEFAULT_BASE_API_URL = "https://proxy-nodejs.prd.milemaker.com/proxy";
3
+ export declare const DEFAULT_GENERAL_APP_SETTINGS: GeneralAppSettings;
4
+ export declare const DEFAULT_BASE_API_URL = "https://proxy-nodejs.prd.milemaker.com";
4
5
  export declare const DEFAULT_ROUTE_COLOR = "rgba(0, 0, 0, 0.87)";
5
6
  export declare const MAP_FIT_INTO_BOUNDS_DEFAULT_PADDING = 100;
6
7
  export declare const MAP_DEFAULT_POLYLINE_STROKE_WIDTH = 5;
7
8
  export declare const MAP_DEFAULT_POLYLINE_STROKE_OPACITY = 1;
8
9
  export declare const NMAPS_TRAFFIC_PREFIX = "traffic";
9
10
  export declare const NMAPS_TRAFFIC_SOURCE_NAME = "ndrive-traffic";
11
+ export declare const NMAPS_TRUCK_SOURCE_NAME = "ndrive-truck";
10
12
  export declare const NMAPS_LAYOUT_PROPERTY_VISIBILITY_KEY = "visibility";
11
13
  export declare const NMAPSLAYOUT_PROPERTY_VISIBILITY_VALUES: {
12
14
  visible: string;
@@ -1,4 +1,4 @@
1
- import { MapBaseLayer } from "../types";
1
+ import { GeneralAppSettings, MapBaseLayer } from "../types";
2
2
  import { CreateActionsFactory, MapActions } from "./types";
3
3
  export * from "./zoom";
4
4
  export * from "./layer";
@@ -6,5 +6,8 @@ export * from "./layer";
6
6
  export * from "./marker";
7
7
  export * from "./popup";
8
8
  export declare const createMapActionFactory: CreateActionsFactory<MapActions, {
9
+ accessToken: string;
10
+ baseApiUrl: string;
9
11
  defaultBaseLayer?: MapBaseLayer;
12
+ generalAppSettings?: GeneralAppSettings;
10
13
  }>;
@@ -2,5 +2,5 @@ import { MapBaseLayer } from "../../types";
2
2
  import { CreateActionsFactory } from "../types";
3
3
  import { BaseLayerActions } from "./types";
4
4
  export declare const baseLayerActionsFactory: CreateActionsFactory<BaseLayerActions, {
5
- defaultBaseLayer?: MapBaseLayer;
5
+ defaultBaseLayer: MapBaseLayer;
6
6
  }>;
@@ -1,6 +1,9 @@
1
- import { MapBaseLayer } from "../../types";
1
+ import { GeneralAppSettings, MapBaseLayer } from "../../types";
2
2
  import { CreateActionsFactory } from "../types";
3
3
  import { MapLayerActions } from "./types";
4
4
  export declare const layerActionsFactory: CreateActionsFactory<MapLayerActions, {
5
- defaultBaseLayer?: MapBaseLayer;
5
+ accessToken: string;
6
+ baseApiUrl: string;
7
+ defaultBaseLayer: MapBaseLayer;
8
+ generalAppSettings: GeneralAppSettings;
6
9
  }>;
@@ -0,0 +1,2 @@
1
+ import { CreateActionsFactory, TruckRestrictionsLayerActions } from "../types";
2
+ export declare const truckRestrictionsLayerActionsFactory: CreateActionsFactory<TruckRestrictionsLayerActions>;
@@ -1,4 +1,4 @@
1
- import { MapBaseLayer } from "../../../types";
1
+ import { MapBaseLayer, WeatherLayer } from "../../../types";
2
2
  /**
3
3
  * Base layer actions
4
4
  * @interface
@@ -10,15 +10,15 @@ export type BaseLayerActions = {
10
10
  * Change current base layer
11
11
  * @param baseLayer - Base layer to set
12
12
  */
13
- changeBaseLayer(baseLayer: MapBaseLayer): void;
13
+ change(baseLayer: MapBaseLayer): void;
14
14
  /**
15
15
  * Get current base layer
16
16
  */
17
- getCurrentBaseLayer(): MapBaseLayer;
17
+ getCurrent(): MapBaseLayer;
18
18
  /**
19
19
  * Get is given base layer currently visible
20
20
  */
21
- getIsVisibleBaseLayer(baseLayer: MapBaseLayer): boolean;
21
+ getIsVisible(baseLayer: MapBaseLayer): boolean;
22
22
  };
23
23
  /**
24
24
  * Traffic layer actions
@@ -30,20 +30,64 @@ export type TrafficLayerActions = {
30
30
  /**
31
31
  * Show traffic layer
32
32
  */
33
- showTrafficLayer(): void;
33
+ show(): void;
34
34
  /**
35
35
  * Hide traffic layer
36
36
  */
37
- hideTrafficLayer(): void;
37
+ hide(): void;
38
38
  /**
39
39
  * Get is traffic layer visible
40
40
  */
41
- getIsVisibleTrafficLayer(): boolean;
41
+ getIsVisible(): boolean;
42
42
  /**
43
43
  * Toggle traffic layer visibility
44
44
  */
45
45
  toggle(): void;
46
46
  };
47
+ /**
48
+ * Truck restrictions layer actions
49
+ * @interface
50
+ * @group Actions
51
+ * @category Layers
52
+ */
53
+ export type TruckRestrictionsLayerActions = {
54
+ /**
55
+ * Show truck restrictions layer
56
+ */
57
+ show(): void;
58
+ /**
59
+ * Hide truck restrictions layer
60
+ */
61
+ hide(): void;
62
+ /**
63
+ * Get is truck restrictions layer visible
64
+ */
65
+ getIsVisible(): boolean;
66
+ /**
67
+ * Toggle truck restrictions layer visibility
68
+ */
69
+ toggle(): void;
70
+ };
71
+ /**
72
+ * Weather layer actions
73
+ * @interface
74
+ * @group Actions
75
+ * @category Layers
76
+ */
77
+ export type WeatherLayerActions = {
78
+ /**
79
+ * Show weather layer
80
+ */
81
+ show(weatherLayer: WeatherLayer | WeatherLayer[]): void;
82
+ /**
83
+ * Hide weather layer
84
+ */
85
+ hide(weatherLayer: WeatherLayer | WeatherLayer[]): void;
86
+ /**
87
+ * Get is weather layer visible
88
+ */
89
+ getIsVisible(weatherLayer: WeatherLayer | WeatherLayer[]): boolean;
90
+ };
47
91
  /**
48
92
  * Map layer actions
49
93
  * @interface
@@ -59,4 +103,12 @@ export type MapLayerActions = {
59
103
  * Traffic layer actions
60
104
  */
61
105
  trafficLayerActions: TrafficLayerActions;
106
+ /**
107
+ * Truck restrictions layer actions
108
+ */
109
+ truckRestrictionsLayerActions: TruckRestrictionsLayerActions;
110
+ /**
111
+ * Weather layer actions
112
+ */
113
+ weatherLayerActions: WeatherLayerActions;
62
114
  };
@@ -0,0 +1,8 @@
1
+ import { GeneralAppSettings } from "../../types";
2
+ import { CreateActionsFactory } from "../types";
3
+ import { WeatherLayerActions } from "./types";
4
+ export declare const weatherLayerActionsFactory: CreateActionsFactory<WeatherLayerActions, {
5
+ accessToken: string;
6
+ baseApiUrl: string;
7
+ generalAppSettings: GeneralAppSettings;
8
+ }>;
@@ -12,7 +12,7 @@ export type Marker = {
12
12
  * Move marker to given coordinate
13
13
  * @param lonLatLike - Coordinate to move marker
14
14
  */
15
- moveMarker(lonLatLike: LonLatLike): void;
15
+ move(lonLatLike: LonLatLike): void;
16
16
  /**
17
17
  * Get marker's coordinate
18
18
  */
@@ -12,7 +12,7 @@ export type Popup = {
12
12
  * Move popup to given coordinate
13
13
  * @param lonLatLike - Coordinate to move popup
14
14
  */
15
- movePopup(lonLatLike: LonLatLike): void;
15
+ move(lonLatLike: LonLatLike): void;
16
16
  /**
17
17
  * Get popup's coordinate
18
18
  */
@@ -0,0 +1,2 @@
1
+ import "./Menu.scss";
2
+ export declare const createMenu: (content: string, className?: string) => string;
@@ -0,0 +1,15 @@
1
+ export type MenuItemConfig = {
2
+ id: string;
3
+ label: string;
4
+ value: string;
5
+ icon?: string;
6
+ disabled?: boolean;
7
+ };
8
+ export type MenuConfig = {
9
+ items: MenuItemConfig[];
10
+ onItemClick?: (value: string) => void;
11
+ };
12
+ export type MenuItemOptions = {
13
+ onClick?: () => void;
14
+ disabled?: boolean;
15
+ };
@@ -0,0 +1,3 @@
1
+ import "./Menu.scss";
2
+ import { MenuItemOptions } from "./Menu.types";
3
+ export declare const createMenuItem: (label: string, content: string, options?: MenuItemOptions) => string;
@@ -0,0 +1,3 @@
1
+ import "./Popper.scss";
2
+ import { PopperInstance, PopperOptions } from "./Popper.types";
3
+ export declare const createPopper: (anchorElement: HTMLElement, content: string, options: PopperOptions) => PopperInstance;
@@ -0,0 +1,32 @@
1
+ export declare enum PopperPlacement {
2
+ LEFT = "left",
3
+ RIGHT = "right",
4
+ TOP = "top",
5
+ BOTTOM = "bottom",
6
+ AUTO = "auto"
7
+ }
8
+ export type PopperOffset = {
9
+ x?: number;
10
+ y?: number;
11
+ };
12
+ export type PopperOptions = {
13
+ id: string;
14
+ header?: string;
15
+ placement?: PopperPlacement;
16
+ offset?: PopperOffset;
17
+ flip?: boolean;
18
+ };
19
+ export type PopperPosition = {
20
+ top: number;
21
+ left: number;
22
+ placement: PopperPlacement;
23
+ };
24
+ export type PopperInstance = {
25
+ update(): void;
26
+ destroy(): void;
27
+ setContent(content: string): void;
28
+ show(): void;
29
+ hide(): void;
30
+ getIsVisible(): boolean;
31
+ getId(): string;
32
+ };
@@ -0,0 +1,9 @@
1
+ export type RadioButtonOptions = {
2
+ checked?: boolean;
3
+ disabled?: boolean;
4
+ name?: string;
5
+ };
6
+ export type RadioGroupOptions = {
7
+ name: string;
8
+ value?: string | null;
9
+ };
@@ -0,0 +1,3 @@
1
+ import "./Radio.scss";
2
+ import { RadioButtonOptions } from "./Radio.types";
3
+ export declare const createRadioButton: (value: string, options?: RadioButtonOptions) => string;
@@ -0,0 +1,3 @@
1
+ import "./Radio.scss";
2
+ import { RadioGroupOptions } from "./Radio.types";
3
+ export declare const createRadioButtonGroup: (content: string, options: RadioGroupOptions) => string;
@@ -0,0 +1,3 @@
1
+ import "./RainSnowIceLegend.scss";
2
+ import { RainSnowIceLegendInstance, RainSnowIceLegendOptions } from "./RainSnowIceLegend.types";
3
+ export declare const createRainSnowIceLegend: (options: RainSnowIceLegendOptions) => RainSnowIceLegendInstance;
@@ -0,0 +1,18 @@
1
+ export declare enum LegendType {
2
+ RAIN = "rain",
3
+ SNOW = "snow",
4
+ ICE = "ice"
5
+ }
6
+ export type LegendColors = Record<LegendType, string[]>;
7
+ export type RainSnowIceLegendOptions = {
8
+ title: string;
9
+ isVisible: boolean;
10
+ parentElement: HTMLElement;
11
+ accessToken: string;
12
+ };
13
+ export type RainSnowIceLegendInstance = {
14
+ show(): void;
15
+ hide(): void;
16
+ destroy(): void;
17
+ getIsVisible(): boolean;
18
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./RainSnowIceLegend";
2
+ export * from "./RainSnowIceLegend.types";
@@ -0,0 +1,2 @@
1
+ export declare const LEGEND_URL = "https://legends.aerisapi.com/advisories-r7-col5-p15,5.svg";
2
+ export declare const SEVERE_LABELS_MATCHES: string[];
@@ -0,0 +1,3 @@
1
+ import "./WeatherAlertsLegend.scss";
2
+ import { WeatherAlertsLegendInstance, WeatherAlertsLegendOptions } from "./WeatherAlertsLegend.types";
3
+ export declare const createWeatherAlertsLegend: (options: WeatherAlertsLegendOptions) => WeatherAlertsLegendInstance;
@@ -0,0 +1,12 @@
1
+ export type WeatherAlertsLegendOptions = {
2
+ title: string;
3
+ isVisible: boolean;
4
+ parentElement: HTMLElement;
5
+ accessToken: string;
6
+ };
7
+ export type WeatherAlertsLegendInstance = {
8
+ show(): void;
9
+ hide(): void;
10
+ destroy(): void;
11
+ getIsVisible(): boolean;
12
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./WeatherAlertsLegend";
2
+ export * from "./WeatherAlertsLegend.types";
@@ -0,0 +1,3 @@
1
+ import "./WeatherLegend.scss";
2
+ import { WeatherLegendInstance, WeatherLegendOptions } from "./WeatherLegend.types";
3
+ export declare const createWeatherLegend: (parentElement: HTMLElement, options: WeatherLegendOptions) => WeatherLegendInstance;
@@ -0,0 +1,19 @@
1
+ export type WeatherLegendOptions = {
2
+ title: string;
3
+ isVisible: boolean;
4
+ fetchLegend: () => Promise<void>;
5
+ renderData: () => string;
6
+ accessToken: string;
7
+ };
8
+ export type WeatherLegendInstance = {
9
+ show(): void;
10
+ hide(): void;
11
+ update(options: Partial<WeatherLegendOptions>): void;
12
+ destroy(): void;
13
+ getIsVisible(): boolean;
14
+ };
15
+ export declare enum WeatherLegendState {
16
+ LOADING = "loading",
17
+ ERROR = "error",
18
+ SUCCESS = "success"
19
+ }
@@ -0,0 +1,2 @@
1
+ import { UnitsFormat } from "../../../types";
2
+ export declare const LEGEND_TEMPERATURES_URLS_PER_UNITS: Record<UnitsFormat, string>;
@@ -0,0 +1,3 @@
1
+ import "./WeatherTemperaturesLegend.scss";
2
+ import { WeatherTemperaturesLegendInstance, WeatherTemperaturesLegendOptions } from "./WeatherTemperaturesLegend.types";
3
+ export declare const createWeatherTemperaturesLegend: (options: WeatherTemperaturesLegendOptions) => WeatherTemperaturesLegendInstance;
@@ -0,0 +1,15 @@
1
+ import { UnitsFormat } from "../../../types";
2
+ export type WeatherTemperaturesLegendOptions = {
3
+ title: string;
4
+ isVisible: boolean;
5
+ parentElement: HTMLElement;
6
+ units: UnitsFormat;
7
+ accessToken: string;
8
+ };
9
+ export type WeatherTemperaturesLegendInstance = {
10
+ show(): void;
11
+ hide(): void;
12
+ destroy(): void;
13
+ getIsVisible(): boolean;
14
+ updateUnits(units: UnitsFormat): void;
15
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./WeatherTemperaturesLegend";
2
+ export * from "./WeatherTemperaturesLegend.types";
@@ -0,0 +1,6 @@
1
+ import { UnitsFormat } from "../../../types";
2
+ export declare const LEGEND_WIND_SPEEDS_URLS_PER_UNITS: Record<UnitsFormat, string>;
3
+ export declare const LEGEND_WIND_SPEEDS_UNITS_LABELS: {
4
+ imperial: string;
5
+ metric: string;
6
+ };
@@ -0,0 +1,3 @@
1
+ import "./WeatherWindSpeedsLegend.scss";
2
+ import { WeatherWindSpeedsLegendInstance, WeatherWindSpeedsLegendOptions } from "./WeatherWindSpeedsLegend.types";
3
+ export declare const createWeatherWindSpeedsLegend: (options: WeatherWindSpeedsLegendOptions) => WeatherWindSpeedsLegendInstance;
@@ -0,0 +1,15 @@
1
+ import { UnitsFormat } from "../../../types";
2
+ export type WeatherWindSpeedsLegendOptions = {
3
+ title: string;
4
+ isVisible: boolean;
5
+ parentElement: HTMLElement;
6
+ units: UnitsFormat;
7
+ accessToken: string;
8
+ };
9
+ export type WeatherWindSpeedsLegendInstance = {
10
+ show(): void;
11
+ hide(): void;
12
+ destroy(): void;
13
+ getIsVisible(): boolean;
14
+ updateUnits(units: UnitsFormat): void;
15
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./WeatherWindSpeedsLegend";
2
+ export * from "./WeatherWindSpeedsLegend.types";
@@ -0,0 +1,6 @@
1
+ export * from "./WeatherLegend";
2
+ export * from "./WeatherLegend.types";
3
+ export * from "./RainSnowIceLegend";
4
+ export * from "./WeatherTemperaturesLegend";
5
+ export * from "./WeatherWindSpeedsLegend";
6
+ export * from "./WeatherAlertsLegend";
@@ -0,0 +1,9 @@
1
+ export * from "./Popper/Popper";
2
+ export * from "./Popper/Popper.types";
3
+ export * from "./Menu/Menu";
4
+ export * from "./Menu/MenuItem";
5
+ export * from "./Menu/Menu.types";
6
+ export * from "./Radio/RadioButton";
7
+ export * from "./Radio/RadioButtonGroup";
8
+ export * from "./Radio/Radio.types";
9
+ export * from "./WeatherLegend";
@@ -0,0 +1,3 @@
1
+ import "./styles/overlayLayerControl.scss";
2
+ import { ControlCreatorFactory, OverlayLayerControl } from "./types";
3
+ export declare const createOverlayLayerControlFactory: ControlCreatorFactory<OverlayLayerControl>;
@@ -0,0 +1,3 @@
1
+ import "./styles/truckRestrictionsLayerControl.scss";
2
+ import { ControlCreatorFactory, TruckRestrictionsLayerControl } from "./types";
3
+ export declare const createTruckRestrictionsLayerControlFactory: ControlCreatorFactory<TruckRestrictionsLayerControl>;
@@ -0,0 +1,3 @@
1
+ import "./styles/weatherLayerControl.scss";
2
+ import { ControlCreatorFactory, WeatherLayerControl } from "./types";
3
+ export declare const createWeatherLayerControlFactory: ControlCreatorFactory<WeatherLayerControl>;
@@ -2,4 +2,7 @@ export * from "./createAttributionControl.factory";
2
2
  export * from "./createBaseLayerControl.factory";
3
3
  export * from "./createCurrentPositionControl.factory";
4
4
  export * from "./createTrafficLayerControl.factory";
5
+ export * from "./createTruckRestrictionsLayerControl.factory";
6
+ export * from "./createOverlayLayerControl.factory";
7
+ export * from "./createWeatherLayerControl.factory";
5
8
  export * from "./createZoomControl.factory";
@@ -85,6 +85,24 @@ export type CurrentPositionControl = BaseMapControl;
85
85
  * @interface
86
86
  */
87
87
  export type TrafficLayerControl = BaseMapControl;
88
+ /**
89
+ * Truck restrictions layer control
90
+ * @group Map Controls
91
+ * @interface
92
+ */
93
+ export type TruckRestrictionsLayerControl = BaseMapControl;
94
+ /**
95
+ * Overlay layer control
96
+ * @group Map Controls
97
+ * @interface
98
+ */
99
+ export type OverlayLayerControl = BaseMapControl;
100
+ /**
101
+ * Weather layer control
102
+ * @group Map Controls
103
+ * @interface
104
+ */
105
+ export type WeatherLayerControl = BaseMapControl;
88
106
  /**
89
107
  * Zoom control
90
108
  * @group Map Controls
@@ -107,6 +125,23 @@ export type MapControlCreators = {
107
125
  * @function
108
126
  */
109
127
  createTrafficLayerControl: (options?: BaseControlCreatorOptions) => TrafficLayerControl;
128
+ /**
129
+ * Creates and returns a truck restrictions layer control instance.
130
+ * @function
131
+ */
132
+ createTruckRestrictionsLayerControl: (options?: BaseControlCreatorOptions) => TruckRestrictionsLayerControl;
133
+ /**
134
+ * Creates and returns an overlay layer control instance.
135
+ * @function
136
+ */
137
+ createOverlayLayerControl: (options?: BaseControlCreatorOptions & {
138
+ accessToken: string;
139
+ }) => OverlayLayerControl;
140
+ /**
141
+ * Creates and returns a weather layer control instance.
142
+ * @function
143
+ */
144
+ createWeatherLayerControl: (options?: BaseControlCreatorOptions) => WeatherLayerControl;
110
145
  /**
111
146
  * Creates and returns a zoom control instance.
112
147
  * @function
@@ -0,0 +1,4 @@
1
+ export * from "./weatherLayers.constants";
2
+ export * from "./weatherLayers.helpers";
3
+ export * from "./weatherLayers.rendering";
4
+ export * from "./weatherLayers.types";
@@ -0,0 +1,5 @@
1
+ import { WeatherLayer } from "../../types";
2
+ import { WeatherLayerType } from "./weatherLayers.types";
3
+ export declare const WEATHER_LAYER_MAP: Record<WeatherLayerType, WeatherLayer | WeatherLayer[]>;
4
+ export declare const WEATHER_LAYER_LABELS: Record<WeatherLayerType, string>;
5
+ export declare const WEATHER_LAYER_OPTIONS: WeatherLayerType[];
@@ -0,0 +1,12 @@
1
+ import { WeatherLayerActions } from "../../actions/layer/types";
2
+ import { WeatherLayerType } from "./weatherLayers.types";
3
+ export declare const getSelectedWeatherLayer: (weatherLayerActions: WeatherLayerActions) => WeatherLayerType | null;
4
+ export declare const showWeatherLayer: (weatherLayerActions: WeatherLayerActions, layerType: WeatherLayerType) => void;
5
+ export declare const hideWeatherLayer: (weatherLayerActions: WeatherLayerActions, layerType: WeatherLayerType) => void;
6
+ export declare const isWeatherLayerType: (value: string | null) => value is WeatherLayerType;
7
+ export declare const fetchSvgRectAndExtractColors: (svgUrl: string) => Promise<string[]>;
8
+ export declare const fetchSvgCircleAndExtractColorsAndLabels: (svgUrl: string, labelsMatches?: string[]) => Promise<{
9
+ color: string;
10
+ label: string;
11
+ }[]>;
12
+ export declare const fetchImageAsObjectUrl: (imageUrl: string) => Promise<string>;
@@ -0,0 +1,2 @@
1
+ import { WeatherLayerType } from "./weatherLayers.types";
2
+ export declare const renderWeatherLayerMenuItems: (selectedLayer: WeatherLayerType | null, radioGroupName: string) => string;
@@ -0,0 +1 @@
1
+ export type WeatherLayerType = "radar" | "alerts" | "satellite" | "roadConditions" | "temperatures" | "windSpeeds";
@@ -3,7 +3,8 @@ import "./styles/errorMap.scss";
3
3
  type RenderErrorMapProps = {
4
4
  container: HTMLElement | string;
5
5
  onRetry(): Promise<MapInstance>;
6
- error: Error;
6
+ error: unknown;
7
+ accessToken: string;
7
8
  };
8
- export declare const renderErrorMap: ({ container, onRetry, error }: RenderErrorMapProps) => void;
9
+ export declare const renderErrorMap: ({ container, onRetry, error, accessToken }: RenderErrorMapProps) => void;
9
10
  export {};
@@ -1,6 +1,6 @@
1
1
  import { MapActions } from "../../actions/types";
2
2
  import { AttributionControl, MapControlCreators } from "../../controls/types";
3
- import { LonLatLike, MapBaseLayer } from "../../types";
3
+ import { GeneralAppSettings, LonLatLike, MapBaseLayer } from "../../types";
4
4
  /**
5
5
  * Map initialization options.
6
6
  * @group Map Initialization
@@ -17,7 +17,7 @@ export type CreateMapProps = {
17
17
  accessToken: string;
18
18
  /**
19
19
  * Base Api Url
20
- * @default https://proxy-nodejs.prd.milemaker.com/proxy
20
+ * @default https://proxy-nodejs.prd.milemaker.com
21
21
  */
22
22
  baseApiUrl?: string;
23
23
  /**
@@ -35,6 +35,11 @@ export type CreateMapProps = {
35
35
  * @default [-97.98373685376561, 35.87721419596477]
36
36
  */
37
37
  initialCenter?: LonLatLike;
38
+ /**
39
+ * General application settings
40
+ * @default {units: UnitsFormat.IMPERIAL}
41
+ */
42
+ generalAppSettings?: GeneralAppSettings;
38
43
  /**
39
44
  * Callback function to be called when the map is ready. It receives a MapInstance as a parameter.
40
45
  * @event
@@ -1 +1 @@
1
- export declare const parseStringAsJson: (stg: string) => any;
1
+ export declare const parseStringAsJson: (stg?: string | undefined) => any;