@milemaker/milemaker-js 1.0.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.
- package/LICENSE +134 -0
- package/README.md +41 -0
- package/dist/MapProvider/index.d.ts +2453 -0
- package/dist/actions/constants/actions.constants.d.ts +14 -0
- package/dist/actions/constants/index.d.ts +1 -0
- package/dist/actions/index.d.ts +10 -0
- package/dist/actions/layer/baseLayerActions.factory.d.ts +6 -0
- package/dist/actions/layer/index.d.ts +6 -0
- package/dist/actions/layer/trafficLayerActions.factory.d.ts +3 -0
- package/dist/actions/layer/types/index.d.ts +1 -0
- package/dist/actions/layer/types/layerActions.types.d.ts +62 -0
- package/dist/actions/marker/createMarkerAction.factory.d.ts +2 -0
- package/dist/actions/marker/createRouteStopMarkerAction.factory.d.ts +3 -0
- package/dist/actions/marker/createRouteStopMarkersAction.factory.d.ts +3 -0
- package/dist/actions/marker/index.d.ts +3 -0
- package/dist/actions/marker/types/index.d.ts +1 -0
- package/dist/actions/marker/types/markerActions.types.d.ts +217 -0
- package/dist/actions/popup/createPopupAction.factory.d.ts +4 -0
- package/dist/actions/popup/index.d.ts +3 -0
- package/dist/actions/popup/types/index.d.ts +1 -0
- package/dist/actions/popup/types/popupActions.types.d.ts +128 -0
- package/dist/actions/route/createRouteAction.factory.d.ts +3 -0
- package/dist/actions/route/createShapeAction.factory.d.ts +3 -0
- package/dist/actions/route/index.d.ts +3 -0
- package/dist/actions/route/types/index.d.ts +1 -0
- package/dist/actions/route/types/routeActions.types.d.ts +96 -0
- package/dist/actions/types/actions.enums.d.ts +11 -0
- package/dist/actions/types/actions.types.d.ts +60 -0
- package/dist/actions/types/index.d.ts +7 -0
- package/dist/actions/zoom/createZoomActions.factory.d.ts +3 -0
- package/dist/actions/zoom/index.d.ts +2 -0
- package/dist/actions/zoom/types/index.d.ts +1 -0
- package/dist/actions/zoom/types/zoomActions.types.d.ts +76 -0
- package/dist/constants/common.constants.d.ts +4 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/controls/constants/controls.constants.d.ts +8 -0
- package/dist/controls/constants/index.d.ts +1 -0
- package/dist/controls/createAttributionControl.factory.d.ts +4 -0
- package/dist/controls/createBaseLayerControl.factory.d.ts +3 -0
- package/dist/controls/createCurrentPositionControl.factory.d.ts +3 -0
- package/dist/controls/createTrafficLayerControl.factory.d.ts +3 -0
- package/dist/controls/createZoomControl.factory.d.ts +3 -0
- package/dist/controls/index.d.ts +5 -0
- package/dist/controls/types/controls.enums.d.ts +11 -0
- package/dist/controls/types/controls.types.d.ts +121 -0
- package/dist/controls/types/index.d.ts +2 -0
- package/dist/createMap/constants/createMap.constants.d.ts +1 -0
- package/dist/createMap/constants/index.d.ts +1 -0
- package/dist/createMap/createMap.d.ts +23 -0
- package/dist/createMap/index.d.ts +1 -0
- package/dist/createMap/types/createMap.types.d.ts +67 -0
- package/dist/createMap/types/index.d.ts +1 -0
- package/dist/helpers/decodeRoutePolylineString.helper.d.ts +7 -0
- package/dist/helpers/generateUuid.helper.d.ts +1 -0
- package/dist/helpers/getControlAbsolutePosition.helper.d.ts +6 -0
- package/dist/helpers/getDistanceBetweenLonLatLike.helper.d.ts +8 -0
- package/dist/helpers/getIsSupported.helper.d.ts +5 -0
- package/dist/helpers/getMapFlyToAnimationDuration.helper.d.ts +7 -0
- package/dist/helpers/getMapFlyToOptions.helper.d.ts +14 -0
- package/dist/helpers/getNumberOfTimeUnites.helper.d.ts +9 -0
- package/dist/helpers/htmlRender.d.ts +29 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/injectHTMLElement.helper.d.ts +7 -0
- package/dist/helpers/parseLonLatLikeToCoordinates.helper.d.ts +7 -0
- package/dist/helpers/parseLonLatLikeToTuple.helper.d.ts +7 -0
- package/dist/helpers/replaceMatchInSvg.helper.d.ts +16 -0
- package/dist/index.cjs +3944 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +54058 -0
- package/dist/nmaps-gl-5352a2f0.js +4 -0
- package/dist/nmaps-gl-df6fcdba.cjs +1 -0
- package/dist/types/common.enums.d.ts +11 -0
- package/dist/types/common.types.d.ts +59 -0
- package/dist/types/index.d.ts +5 -0
- package/package.json +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./zoomActions.types";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { LonLatLike } from "../../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Center by coordinates options
|
|
4
|
+
* @interface
|
|
5
|
+
* @group Actions
|
|
6
|
+
* @category Zoom
|
|
7
|
+
*/
|
|
8
|
+
export type CenterByCoordinatesOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Zoom
|
|
11
|
+
*/
|
|
12
|
+
zoom?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Animate
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
animate?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Zoom step
|
|
20
|
+
* @default 4
|
|
21
|
+
*/
|
|
22
|
+
zoomStep?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Zoom value
|
|
25
|
+
*/
|
|
26
|
+
zoomValue?: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Zoom actions
|
|
30
|
+
* @interface
|
|
31
|
+
* @group Actions
|
|
32
|
+
* @category Zoom
|
|
33
|
+
*/
|
|
34
|
+
export type ZoomActions = {
|
|
35
|
+
/**
|
|
36
|
+
* Reset camera pan
|
|
37
|
+
*/
|
|
38
|
+
resetPan(options?: {
|
|
39
|
+
animate?: boolean;
|
|
40
|
+
}): void;
|
|
41
|
+
/**
|
|
42
|
+
* Zoom in by given step
|
|
43
|
+
*/
|
|
44
|
+
zoomIn(step?: number): void;
|
|
45
|
+
/**
|
|
46
|
+
* Zoom in by given step
|
|
47
|
+
*/
|
|
48
|
+
zoomOut(step?: number): void;
|
|
49
|
+
/**
|
|
50
|
+
* Get is disabled zoom in
|
|
51
|
+
*/
|
|
52
|
+
getIsDisabledZoomIn(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Get is disabled zoom out
|
|
55
|
+
*/
|
|
56
|
+
getIsDisabledZoomOut(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Fit into given bounds with zooming.
|
|
59
|
+
*/
|
|
60
|
+
mapFlyToBounds(lonLatLikeArray: LonLatLike[], options?: {
|
|
61
|
+
/**
|
|
62
|
+
* Padding
|
|
63
|
+
* @default 100
|
|
64
|
+
*/
|
|
65
|
+
padding?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Animate
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
animate?: boolean;
|
|
71
|
+
}): void;
|
|
72
|
+
/**
|
|
73
|
+
* centerByCoordinates
|
|
74
|
+
*/
|
|
75
|
+
centerByCoordinates(lonLatLike: LonLatLike, options?: CenterByCoordinatesOptions): void;
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./common.constants";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./controls.constants";
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import MapProvider from "../../MapProvider";
|
|
2
|
+
import { MapActions } from "../../actions/types";
|
|
3
|
+
import { ControlPosition } from "./controls.enums";
|
|
4
|
+
/**
|
|
5
|
+
* Basic map control
|
|
6
|
+
* @interface
|
|
7
|
+
* @group Map Controls
|
|
8
|
+
*/
|
|
9
|
+
type BaseMapControl = {
|
|
10
|
+
/**
|
|
11
|
+
* Hide map control
|
|
12
|
+
*/
|
|
13
|
+
hide(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Show map control
|
|
16
|
+
*/
|
|
17
|
+
show(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get is map control visible
|
|
20
|
+
*/
|
|
21
|
+
getIsVisible(): boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Basic control creator factory options
|
|
25
|
+
* @group Map Controls
|
|
26
|
+
* @ignore
|
|
27
|
+
* @interface
|
|
28
|
+
*/
|
|
29
|
+
type BaseControlCreatorFactoryOptions = {
|
|
30
|
+
map: MapProvider.Map;
|
|
31
|
+
actions: MapActions;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Control creator factory
|
|
35
|
+
* @group Map Controls
|
|
36
|
+
* @ignore
|
|
37
|
+
* @typeParam {Control extends BaseMapControl} Return - A control to return
|
|
38
|
+
* @typeParam {AdditionalOptions = void} AdditionalOptions - Additional creator options
|
|
39
|
+
*/
|
|
40
|
+
export type ControlCreatorFactory<Control extends BaseMapControl, AdditionalOptions = void> = (props: BaseControlCreatorFactoryOptions) => (options?: BaseControlCreatorOptions & (AdditionalOptions extends void ? unknown : AdditionalOptions)) => Control;
|
|
41
|
+
/**
|
|
42
|
+
* Basic control creator options
|
|
43
|
+
* @group Map Controls
|
|
44
|
+
* @interface
|
|
45
|
+
*/
|
|
46
|
+
type BaseControlCreatorOptions = {
|
|
47
|
+
/**
|
|
48
|
+
* Control position on a screen
|
|
49
|
+
* @default "bottom-right"
|
|
50
|
+
*/
|
|
51
|
+
position?: ControlPosition;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Attribution control
|
|
55
|
+
* @group Map Controls
|
|
56
|
+
* @interface
|
|
57
|
+
*/
|
|
58
|
+
export type AttributionControl = {
|
|
59
|
+
/**
|
|
60
|
+
* Add custom attribution string
|
|
61
|
+
* @param customAttribution - Custom attribution or array of attributions to add
|
|
62
|
+
*/
|
|
63
|
+
addAttribution(customAttribution: string | string[]): void;
|
|
64
|
+
/**
|
|
65
|
+
* Remove custom attribution by a string match
|
|
66
|
+
* @param customAttribution - Custom attribution to remove by string match
|
|
67
|
+
*/
|
|
68
|
+
removeAttribution(customAttribution: string): void;
|
|
69
|
+
} & BaseMapControl;
|
|
70
|
+
/**
|
|
71
|
+
* Base layer control
|
|
72
|
+
* @group Map Controls
|
|
73
|
+
* @interface
|
|
74
|
+
*/
|
|
75
|
+
export type BaseLayerControl = BaseMapControl;
|
|
76
|
+
/**
|
|
77
|
+
* Current position control
|
|
78
|
+
* @group Map Controls
|
|
79
|
+
* @interface
|
|
80
|
+
*/
|
|
81
|
+
export type CurrentPositionControl = BaseMapControl;
|
|
82
|
+
/**
|
|
83
|
+
* Traffic layer control
|
|
84
|
+
* @group Map Controls
|
|
85
|
+
* @interface
|
|
86
|
+
*/
|
|
87
|
+
export type TrafficLayerControl = BaseMapControl;
|
|
88
|
+
/**
|
|
89
|
+
* Zoom control
|
|
90
|
+
* @group Map Controls
|
|
91
|
+
* @interface
|
|
92
|
+
*/
|
|
93
|
+
export type ZoomControl = BaseMapControl;
|
|
94
|
+
/**
|
|
95
|
+
* Map control creators
|
|
96
|
+
* @group Map Controls
|
|
97
|
+
* @interface
|
|
98
|
+
*/
|
|
99
|
+
export type MapControlCreators = {
|
|
100
|
+
/**
|
|
101
|
+
* Creates and returns a base layer control instance.
|
|
102
|
+
* @function
|
|
103
|
+
*/
|
|
104
|
+
createBaseLayerControl: (options?: BaseControlCreatorOptions) => BaseLayerControl;
|
|
105
|
+
/**
|
|
106
|
+
* Creates and returns a traffic layer control instance.
|
|
107
|
+
* @function
|
|
108
|
+
*/
|
|
109
|
+
createTrafficLayerControl: (options?: BaseControlCreatorOptions) => TrafficLayerControl;
|
|
110
|
+
/**
|
|
111
|
+
* Creates and returns a zoom control instance.
|
|
112
|
+
* @function
|
|
113
|
+
*/
|
|
114
|
+
createZoomControl: (options?: BaseControlCreatorOptions) => ZoomControl;
|
|
115
|
+
/**
|
|
116
|
+
* Creates and returns a current position control instance.
|
|
117
|
+
* @function
|
|
118
|
+
*/
|
|
119
|
+
createCurrentPositionControl: (options?: BaseControlCreatorOptions) => CurrentPositionControl;
|
|
120
|
+
};
|
|
121
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULTER_MAP_MIN_ZOOM = 2.5;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./createMap.constants";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "../styles/styles.scss";
|
|
2
|
+
import { CreateMapProps, MapInstance } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* This is the main method that allows to mount the app and use all the features
|
|
5
|
+
* @group Map Initialization
|
|
6
|
+
* @param {CreateMapProps} options - Options to configure the map with
|
|
7
|
+
* @example
|
|
8
|
+
* How to create map instance, with default streets map style
|
|
9
|
+
* ```ts
|
|
10
|
+
* const containerElement = document.getElementById("map");
|
|
11
|
+
*
|
|
12
|
+
* if (!containerElement) {
|
|
13
|
+
* ...
|
|
14
|
+
* return;
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* const mapInstance: MapInstance = await createMap({
|
|
18
|
+
* container: containerElement,
|
|
19
|
+
* accessToken: "*ACCESS_TOKEN*",
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const createMap: ({ container, baseApiUrl, accessToken, initialZoom, initialCenter, baseLayer, onReady, onError }: CreateMapProps) => Promise<MapInstance>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./createMap";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { MapActions } from "../../actions/types";
|
|
2
|
+
import { AttributionControl, MapControlCreators } from "../../controls/types";
|
|
3
|
+
import { LonLatLike, MapBaseLayer } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* Map initialization options.
|
|
6
|
+
* @group Map Initialization
|
|
7
|
+
* @interface
|
|
8
|
+
*/
|
|
9
|
+
export type CreateMapProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Element to mount the map, or element id
|
|
12
|
+
*/
|
|
13
|
+
container: HTMLElement | string;
|
|
14
|
+
/**
|
|
15
|
+
* Access token
|
|
16
|
+
*/
|
|
17
|
+
accessToken: string;
|
|
18
|
+
/**
|
|
19
|
+
* Base Api Url
|
|
20
|
+
* @default https://localhost/proxy
|
|
21
|
+
*/
|
|
22
|
+
baseApiUrl?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Base layer token
|
|
25
|
+
* @default MapBaseLayer.STREETS
|
|
26
|
+
*/
|
|
27
|
+
baseLayer?: MapBaseLayer;
|
|
28
|
+
/**
|
|
29
|
+
* Map initial zoom
|
|
30
|
+
* @default 4
|
|
31
|
+
*/
|
|
32
|
+
initialZoom?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Map initial zoom
|
|
35
|
+
* @default [-97.98373685376561, 35.87721419596477]
|
|
36
|
+
*/
|
|
37
|
+
initialCenter?: LonLatLike;
|
|
38
|
+
/**
|
|
39
|
+
* Callback function to be called when the map is ready. It receives a MapInstance as a parameter.
|
|
40
|
+
* @event
|
|
41
|
+
*/
|
|
42
|
+
onReady?(result: MapInstance): void;
|
|
43
|
+
/**
|
|
44
|
+
* Callback function to be called when an error occurs. It receives an Error as a parameter.
|
|
45
|
+
* @event
|
|
46
|
+
*/
|
|
47
|
+
onError?(error: Error): void;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Map instance.
|
|
51
|
+
* @group Map Initialization
|
|
52
|
+
* @interface
|
|
53
|
+
*/
|
|
54
|
+
export type MapInstance = {
|
|
55
|
+
/**
|
|
56
|
+
* The attribution control instance.
|
|
57
|
+
*/
|
|
58
|
+
attributionControl: AttributionControl;
|
|
59
|
+
/**
|
|
60
|
+
* The map control creators.
|
|
61
|
+
*/
|
|
62
|
+
controls: MapControlCreators;
|
|
63
|
+
/**
|
|
64
|
+
* The map actions.
|
|
65
|
+
*/
|
|
66
|
+
actions: MapActions;
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./createMap.types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateUuid: () => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LonLatLike } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a {@link LonLatLike} to {@link Coordinates}
|
|
4
|
+
* @group Helpers
|
|
5
|
+
* @param initialCoordinates - {@link LonLatLike} object to be parsed
|
|
6
|
+
* @param targetCoordinates - {@link LonLatLike} object to be parsed
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDistanceBetweenPoints(initialCoordinates: LonLatLike, targetCoordinates: LonLatLike): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LonLatLike } from "../types";
|
|
2
|
+
export declare const getMapFlyToAnimationDuration: ({ initialPixelCoordinates, targetPixelCoordinates, initialZoom, targetZoom }: {
|
|
3
|
+
initialPixelCoordinates: LonLatLike;
|
|
4
|
+
targetPixelCoordinates: LonLatLike;
|
|
5
|
+
initialZoom?: number | undefined;
|
|
6
|
+
targetZoom?: number | undefined;
|
|
7
|
+
}) => number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CenterByCoordinatesOptions, LonLatTuple } from "../types";
|
|
2
|
+
export declare const getMapFlyToOptions: ({ currentZoom, targetLonLatLike, transformLonLatToPoint, currentCenter, animate, zoom, zoomValue, zoomStep }: {
|
|
3
|
+
currentCenter: LonLatTuple;
|
|
4
|
+
targetLonLatLike: LonLatTuple;
|
|
5
|
+
currentZoom: number;
|
|
6
|
+
transformLonLatToPoint(lonLatLike: LonLatTuple): {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
} & object;
|
|
10
|
+
} & CenterByCoordinatesOptions) => {
|
|
11
|
+
zoom: number;
|
|
12
|
+
duration: number;
|
|
13
|
+
animate: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const TIME_IN_MILLISECONDS: {
|
|
2
|
+
millisecond: number;
|
|
3
|
+
second: number;
|
|
4
|
+
minute: number;
|
|
5
|
+
hour: number;
|
|
6
|
+
day: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const getNumberOfTimeUnites: (number: number, unit: keyof typeof TIME_IN_MILLISECONDS, inUnit?: keyof typeof TIME_IN_MILLISECONDS | undefined) => number;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type StateItem<T> = {
|
|
2
|
+
getValue: () => T;
|
|
3
|
+
setValue: (value: T | ((current: T) => T)) => void;
|
|
4
|
+
};
|
|
5
|
+
type Props<State extends Record<string, unknown> = Record<string, unknown>> = {
|
|
6
|
+
elementId: string;
|
|
7
|
+
parentElement: HTMLElement;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: string;
|
|
10
|
+
state?: State;
|
|
11
|
+
render(state: {
|
|
12
|
+
[Key in keyof State]: State[Key];
|
|
13
|
+
}): string;
|
|
14
|
+
onmount?(): (() => void) | void;
|
|
15
|
+
listeners?: Record<string, Record<`on${keyof GlobalEventHandlersEventMap}` | string, (events: Event) => void>>;
|
|
16
|
+
};
|
|
17
|
+
type Returns<State extends Record<string, unknown> = Record<string, unknown>> = {
|
|
18
|
+
render(): void;
|
|
19
|
+
unmount(): void;
|
|
20
|
+
mount(): void;
|
|
21
|
+
state: {
|
|
22
|
+
[Key in keyof State]: StateItem<State[Key]>;
|
|
23
|
+
};
|
|
24
|
+
mountedElementRef: {
|
|
25
|
+
current: HTMLElement | null;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const htmlRender: <State extends Record<string, unknown> = Record<string, unknown>>({ elementId, parentElement, className, style, onmount, listeners, state: initialState, render: renderProp }: Props<State>) => Returns<State>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Coordinates, LonLatLike } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a {@link LonLatLike} to {@link Coordinates}
|
|
4
|
+
* @group Helpers
|
|
5
|
+
* @param lonLatLike - {@link LonLatLike} object to be parsed
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseLonLatLikeToCoordinates: (lonLatLike: LonLatLike) => Coordinates;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LonLatLike, LonLatTuple } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a {@link LonLatLike} to {@link LonLatTuple}
|
|
4
|
+
* @group Helpers
|
|
5
|
+
* @param lonLatLike - {@link LonLatLike} object to be parsed
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseLonLatLikeToTuple: (lonLatLike: LonLatLike) => LonLatTuple;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replace a match in svg string
|
|
3
|
+
* @group Helpers
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* replaceMatch({ searchValue: /{fill}/g, value: color, stringSvg });
|
|
7
|
+
* ```
|
|
8
|
+
* @param searchValue - Search to replace
|
|
9
|
+
* @param value - Value to be placed
|
|
10
|
+
* @param stringSvg - Svg string
|
|
11
|
+
*/
|
|
12
|
+
export declare function replaceMatchInSvg({ searchValue, stringSvg, value }: {
|
|
13
|
+
searchValue: RegExp;
|
|
14
|
+
stringSvg: string;
|
|
15
|
+
value: number | string;
|
|
16
|
+
}): string;
|