@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.
Files changed (75) hide show
  1. package/LICENSE +134 -0
  2. package/README.md +41 -0
  3. package/dist/MapProvider/index.d.ts +2453 -0
  4. package/dist/actions/constants/actions.constants.d.ts +14 -0
  5. package/dist/actions/constants/index.d.ts +1 -0
  6. package/dist/actions/index.d.ts +10 -0
  7. package/dist/actions/layer/baseLayerActions.factory.d.ts +6 -0
  8. package/dist/actions/layer/index.d.ts +6 -0
  9. package/dist/actions/layer/trafficLayerActions.factory.d.ts +3 -0
  10. package/dist/actions/layer/types/index.d.ts +1 -0
  11. package/dist/actions/layer/types/layerActions.types.d.ts +62 -0
  12. package/dist/actions/marker/createMarkerAction.factory.d.ts +2 -0
  13. package/dist/actions/marker/createRouteStopMarkerAction.factory.d.ts +3 -0
  14. package/dist/actions/marker/createRouteStopMarkersAction.factory.d.ts +3 -0
  15. package/dist/actions/marker/index.d.ts +3 -0
  16. package/dist/actions/marker/types/index.d.ts +1 -0
  17. package/dist/actions/marker/types/markerActions.types.d.ts +217 -0
  18. package/dist/actions/popup/createPopupAction.factory.d.ts +4 -0
  19. package/dist/actions/popup/index.d.ts +3 -0
  20. package/dist/actions/popup/types/index.d.ts +1 -0
  21. package/dist/actions/popup/types/popupActions.types.d.ts +128 -0
  22. package/dist/actions/route/createRouteAction.factory.d.ts +3 -0
  23. package/dist/actions/route/createShapeAction.factory.d.ts +3 -0
  24. package/dist/actions/route/index.d.ts +3 -0
  25. package/dist/actions/route/types/index.d.ts +1 -0
  26. package/dist/actions/route/types/routeActions.types.d.ts +96 -0
  27. package/dist/actions/types/actions.enums.d.ts +11 -0
  28. package/dist/actions/types/actions.types.d.ts +60 -0
  29. package/dist/actions/types/index.d.ts +7 -0
  30. package/dist/actions/zoom/createZoomActions.factory.d.ts +3 -0
  31. package/dist/actions/zoom/index.d.ts +2 -0
  32. package/dist/actions/zoom/types/index.d.ts +1 -0
  33. package/dist/actions/zoom/types/zoomActions.types.d.ts +76 -0
  34. package/dist/constants/common.constants.d.ts +4 -0
  35. package/dist/constants/index.d.ts +1 -0
  36. package/dist/controls/constants/controls.constants.d.ts +8 -0
  37. package/dist/controls/constants/index.d.ts +1 -0
  38. package/dist/controls/createAttributionControl.factory.d.ts +4 -0
  39. package/dist/controls/createBaseLayerControl.factory.d.ts +3 -0
  40. package/dist/controls/createCurrentPositionControl.factory.d.ts +3 -0
  41. package/dist/controls/createTrafficLayerControl.factory.d.ts +3 -0
  42. package/dist/controls/createZoomControl.factory.d.ts +3 -0
  43. package/dist/controls/index.d.ts +5 -0
  44. package/dist/controls/types/controls.enums.d.ts +11 -0
  45. package/dist/controls/types/controls.types.d.ts +121 -0
  46. package/dist/controls/types/index.d.ts +2 -0
  47. package/dist/createMap/constants/createMap.constants.d.ts +1 -0
  48. package/dist/createMap/constants/index.d.ts +1 -0
  49. package/dist/createMap/createMap.d.ts +23 -0
  50. package/dist/createMap/index.d.ts +1 -0
  51. package/dist/createMap/types/createMap.types.d.ts +67 -0
  52. package/dist/createMap/types/index.d.ts +1 -0
  53. package/dist/helpers/decodeRoutePolylineString.helper.d.ts +7 -0
  54. package/dist/helpers/generateUuid.helper.d.ts +1 -0
  55. package/dist/helpers/getControlAbsolutePosition.helper.d.ts +6 -0
  56. package/dist/helpers/getDistanceBetweenLonLatLike.helper.d.ts +8 -0
  57. package/dist/helpers/getIsSupported.helper.d.ts +5 -0
  58. package/dist/helpers/getMapFlyToAnimationDuration.helper.d.ts +7 -0
  59. package/dist/helpers/getMapFlyToOptions.helper.d.ts +14 -0
  60. package/dist/helpers/getNumberOfTimeUnites.helper.d.ts +9 -0
  61. package/dist/helpers/htmlRender.d.ts +29 -0
  62. package/dist/helpers/index.d.ts +5 -0
  63. package/dist/helpers/injectHTMLElement.helper.d.ts +7 -0
  64. package/dist/helpers/parseLonLatLikeToCoordinates.helper.d.ts +7 -0
  65. package/dist/helpers/parseLonLatLikeToTuple.helper.d.ts +7 -0
  66. package/dist/helpers/replaceMatchInSvg.helper.d.ts +16 -0
  67. package/dist/index.cjs +3944 -0
  68. package/dist/index.d.ts +3 -0
  69. package/dist/index.js +54058 -0
  70. package/dist/nmaps-gl-5352a2f0.js +4 -0
  71. package/dist/nmaps-gl-df6fcdba.cjs +1 -0
  72. package/dist/types/common.enums.d.ts +11 -0
  73. package/dist/types/common.types.d.ts +59 -0
  74. package/dist/types/index.d.ts +5 -0
  75. package/package.json +55 -0
package/LICENSE ADDED
@@ -0,0 +1,134 @@
1
+ Copyright (c) 2023, MileMaker
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
+
11
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
+
15
+ -------------------------------------------------------------------------------
16
+
17
+ Contains code from nmaps-gl-js v1.6.2
18
+
19
+ nmaps-gl-js is licensed under a BSD-3-Clause license
20
+
21
+ Copyright (c) 2020, NMaps
22
+
23
+ All rights reserved.
24
+
25
+ Redistribution and use in source and binary forms, with or without modification,
26
+ are permitted provided that the following conditions are met:
27
+
28
+ * Redistributions of source code must retain the above copyright notice,
29
+ this list of conditions and the following disclaimer.
30
+ * Redistributions in binary form must reproduce the above copyright notice,
31
+ this list of conditions and the following disclaimer in the documentation
32
+ and/or other materials provided with the distribution.
33
+ * Neither the name of NMaps GL JS nor the names of its contributors
34
+ may be used to endorse or promote products derived from this software
35
+ without specific prior written permission.
36
+
37
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
38
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
39
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
40
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
42
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
43
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
44
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
45
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
46
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
47
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48
+
49
+ -------------------------------------------------------------------------------
50
+
51
+ Contains code from mapbox-gl-js v1.13 and earlier
52
+
53
+ Version v1.13 of mapbox-gl-js and earlier are licensed under a BSD-3-Clause license
54
+
55
+ Copyright (c) 2020, Mapbox
56
+ Redistribution and use in source and binary forms, with or without modification,
57
+ are permitted provided that the following conditions are met:
58
+
59
+ * Redistributions of source code must retain the above copyright notice,
60
+ this list of conditions and the following disclaimer.
61
+ * Redistributions in binary form must reproduce the above copyright notice,
62
+ this list of conditions and the following disclaimer in the documentation
63
+ and/or other materials provided with the distribution.
64
+ * Neither the name of Mapbox GL JS nor the names of its contributors
65
+ may be used to endorse or promote products derived from this software
66
+ without specific prior written permission.
67
+
68
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
69
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
70
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
71
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
72
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
73
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
74
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
75
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
76
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
77
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
78
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
79
+
80
+ -------------------------------------------------------------------------------
81
+
82
+ Contains code from glfx.js
83
+
84
+ Copyright (C) 2011 by Evan Wallace
85
+
86
+ Permission is hereby granted, free of charge, to any person obtaining a copy
87
+ of this software and associated documentation files (the "Software"), to deal
88
+ in the Software without restriction, including without limitation the rights
89
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
90
+ copies of the Software, and to permit persons to whom the Software is
91
+ furnished to do so, subject to the following conditions:
92
+
93
+ The above copyright notice and this permission notice shall be included in
94
+ all copies or substantial portions of the Software.
95
+
96
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
97
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
99
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
101
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
102
+ THE SOFTWARE.
103
+
104
+ --------------------------------------------------------------------------------
105
+
106
+ Contains a portion of d3-color https://github.com/d3/d3-color
107
+
108
+ Copyright 2010-2016 Mike Bostock
109
+ All rights reserved.
110
+
111
+ Redistribution and use in source and binary forms, with or without modification,
112
+ are permitted provided that the following conditions are met:
113
+
114
+ * Redistributions of source code must retain the above copyright notice, this
115
+ list of conditions and the following disclaimer.
116
+
117
+ * Redistributions in binary form must reproduce the above copyright notice,
118
+ this list of conditions and the following disclaimer in the documentation
119
+ and/or other materials provided with the distribution.
120
+
121
+ * Neither the name of the author nor the names of contributors may be used to
122
+ endorse or promote products derived from this software without specific prior
123
+ written permission.
124
+
125
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
126
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
127
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
128
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
129
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
130
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
131
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
132
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
133
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
134
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # It's the MileMaker JS Routing SDK.
2
+
3
+ ### Installation
4
+
5
+ #### Using yarn:
6
+
7
+ ```bash
8
+ yarn add @milemaker/milemaker-js
9
+ ```
10
+
11
+ #### Using npm:
12
+
13
+ ```bash
14
+ npm install @milemaker/milemaker-js
15
+ ```
16
+
17
+ ### Initialization
18
+
19
+ Create map instance
20
+
21
+ ```ts
22
+ const mapInstance: MapInstance = await createMap({
23
+ container: containerHtmlElement | elementIdString,
24
+ accessToken: "*ACCESS_TOKEN*",
25
+ });
26
+ ```
27
+
28
+ ### Adding default map controls
29
+
30
+ Add such lines
31
+
32
+ ```ts
33
+ mapInstance.controls.createBaseLayerControl();
34
+ mapInstance.controls.createZoomControl();
35
+ mapInstance.controls.createCurrentPositionControl();
36
+ mapInstance.controls.createTrafficLayerControl();
37
+ ```
38
+
39
+ ### Documentation
40
+
41
+ For more info visit [Documentation](https://js-developer.milemaker.com/)