@milemaker/milemaker-js 1.0.5 → 1.1.0-alpha.1

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/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
@@ -7,6 +7,7 @@ export declare const MAP_DEFAULT_POLYLINE_STROKE_WIDTH = 5;
7
7
  export declare const MAP_DEFAULT_POLYLINE_STROKE_OPACITY = 1;
8
8
  export declare const NMAPS_TRAFFIC_PREFIX = "traffic";
9
9
  export declare const NMAPS_TRAFFIC_SOURCE_NAME = "ndrive-traffic";
10
+ export declare const NMAPS_TRUCK_SOURCE_NAME = "ndrive-truck";
10
11
  export declare const NMAPS_LAYOUT_PROPERTY_VISIBILITY_KEY = "visibility";
11
12
  export declare const NMAPSLAYOUT_PROPERTY_VISIBILITY_VALUES: {
12
13
  visible: string;
@@ -0,0 +1,2 @@
1
+ import { CreateActionsFactory, TruckRestrictionsLayerActions } from "../types";
2
+ export declare const truckRestrictionsLayerActionsFactory: CreateActionsFactory<TruckRestrictionsLayerActions>;
@@ -44,6 +44,30 @@ export type TrafficLayerActions = {
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
+ showTruckRestrictionsLayer(): void;
58
+ /**
59
+ * Hide truck restrictions layer
60
+ */
61
+ hideTruckRestrictionsLayer(): void;
62
+ /**
63
+ * Get is truck restrictions layer visible
64
+ */
65
+ getIsVisibleTruckRestrictionsLayer(): boolean;
66
+ /**
67
+ * Toggle truck restrictions layer visibility
68
+ */
69
+ toggle(): void;
70
+ };
47
71
  /**
48
72
  * Map layer actions
49
73
  * @interface
@@ -59,4 +83,8 @@ export type MapLayerActions = {
59
83
  * Traffic layer actions
60
84
  */
61
85
  trafficLayerActions: TrafficLayerActions;
86
+ /**
87
+ * Truck restrictions layer actions
88
+ */
89
+ truckRestrictionsLayerActions: TruckRestrictionsLayerActions;
62
90
  };
@@ -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,29 @@
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
+ placement?: PopperPlacement;
14
+ offset?: PopperOffset;
15
+ flip?: boolean;
16
+ };
17
+ export type PopperPosition = {
18
+ top: number;
19
+ left: number;
20
+ placement: PopperPlacement;
21
+ };
22
+ export type PopperInstance = {
23
+ update(): void;
24
+ destroy(): void;
25
+ setContent(content: string): void;
26
+ show(): void;
27
+ hide(): void;
28
+ getIsVisible(): boolean;
29
+ };
@@ -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,8 @@
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";
@@ -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>;
@@ -2,4 +2,6 @@ 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";
5
7
  export * from "./createZoomControl.factory";
@@ -85,6 +85,18 @@ 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;
88
100
  /**
89
101
  * Zoom control
90
102
  * @group Map Controls
@@ -107,6 +119,16 @@ export type MapControlCreators = {
107
119
  * @function
108
120
  */
109
121
  createTrafficLayerControl: (options?: BaseControlCreatorOptions) => TrafficLayerControl;
122
+ /**
123
+ * Creates and returns a truck restrictions layer control instance.
124
+ * @function
125
+ */
126
+ createTruckRestrictionsLayerControl: (options?: BaseControlCreatorOptions) => TruckRestrictionsLayerControl;
127
+ /**
128
+ * Creates and returns an overlay layer control instance.
129
+ * @function
130
+ */
131
+ createOverlayLayerControl: (options?: BaseControlCreatorOptions) => OverlayLayerControl;
110
132
  /**
111
133
  * Creates and returns a zoom control instance.
112
134
  * @function