@tomtom-org/maps-sdk-plugin-viewport-places 0.2.1 → 0.3.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.txt +44 -470
- package/THIRD_PARTY.txt +1 -0
- package/dist/THIRD_PARTY.txt +1 -1
- package/dist/index.d.ts +133 -135
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/third-party.json +1 -0
- package/package.json +13 -8
package/LICENSE.txt
CHANGED
|
@@ -1,513 +1,87 @@
|
|
|
1
|
-
TOMTOM MAPS SDK FOR JAVASCRIPT LICENSE AGREEMENT (“AGREEMENT”)
|
|
1
|
+
TOMTOM MAPS SDK FOR JAVASCRIPT LICENSE AGREEMENT (“AGREEMENT”)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Last update: September 2026
|
|
4
4
|
|
|
5
|
-
By downloading
|
|
5
|
+
By downloading or accessing the “TomTom Maps SDK for JavaScript” (the “SDK”), you are entering into a binding agreement with TomTom Global Content B.V. (“TomTom”). The SDK comprises all software, binaries and source code made available by TomTom for it, whether through the TomTom Developer Portal or public code repositories (e.g. GitHub). This Agreement with TomTom consists of the terms and conditions below together with the Data Processing Schedule. You should not use the SDK if you cannot agree to both.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
You may not use the SDK or accept this Agreement if you are barred from receiving it under the laws of the European Union or of any other country, including the country in which you are resident or from which you use the SDK. If you accept this Agreement on behalf of your employer or another entity, you represent and warrant that you have full legal authority to bind that employer or entity. If you do not have that authority, you may not accept this Agreement or use the SDK on their behalf.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
1. GRANT OF LICENSE: Subject to and conditional upon your compliance at all times with this Agreement, TomTom grants you a limited, non-exclusive, non-transferable, non-sublicensable, revocable, royalty-free license during the Term (as defined in Clause 9) to use the SDK to develop web or mobile applications that are used in connection with the TomTom APIs and, in addition, third party online APIs (“Permitted Applications”). For the avoidance of doubt, you must use the TomTom APIs in connection with the SDK. Any Permitted Application and any use of the TomTom APIs is subject to TomTom’s standard terms of use applicable to the TomTom APIs as made available on the TomTom Developer Portal, or to any other specific written agreement executed between you and TomTom regarding the use of the TomTom APIs.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
2. UPDATES AND CHANGES TO THE SDK AND THIS AGREEMENT: TomTom reserves the right, with or without notice and at its sole discretion, to discontinue, update, modify, upgrade and supplement the SDK or any of its features, and to modify this Agreement. You agree that future versions of the SDK may be incompatible with applications developed on previous versions.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
3. YOUR FURTHER OBLIGATIONS:
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
3.1. You agree to use the SDK only for purposes permitted by (a) this Agreement and (b) any applicable law, regulation or generally accepted practice or guideline in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
|
|
16
16
|
|
|
17
|
-
2.
|
|
17
|
+
3.2. Other than as permitted by applicable legislation, you are prohibited from copying (except for backup purposes), modifying, adapting, (re)distributing, renting, lending, publicly presenting, decompiling, reverse engineering, disassembling or creating derivative works of the SDK or any part of it. Notwithstanding the foregoing, where the SDK is hosted on a public repository (e.g. GitHub, which allows forking under its terms of service), you may: (i) fork the repository solely for the purpose of submitting a pull request to TomTom, provided that such fork remains hosted within the platform and is not used as a basis for a separate or competing product or service; and (ii) download a local copy of the source code solely for the purpose of debugging your Permitted Application, provided that such copy is not shared or redistributed. The availability of the source code in a public repository does not constitute “Open-Source” licensing and grants you no rights under any Open Source Initiative (OSI) approved license. Neither that availability, nor any rights granted by the platform’s terms of service with respect to viewing or forking within the platform, shall be construed as a grant of rights to modify, fork or redistribute the SDK beyond those expressly granted in Clause 1 and this Clause 3.2.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
3.3. You may not use the SDK in connection with any illegal, fraudulent, dishonest or unethical activity or behaviour, and in particular not to create or develop, or help others create or develop, a product, service or library that competes, directly or indirectly, with the SDK or the TomTom APIs.
|
|
20
20
|
|
|
21
|
-
3.
|
|
21
|
+
3.4. You are permitted to display TomTom APIs results (“Results”) on third party content or map data, and to display results from third party content or map data on a TomTom map as a separate layer. Nothing herein entitles you to add or incorporate Results into OSM or any other open source database.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
3.5. The SDK may include data or software that TomTom licenses from third parties, including open-source software. Such components are made available to you under the terms and conditions of their applicable licenses, and you shall comply with all requirements and restrictions that those third parties may require TomTom to impose on you (as may be updated and amended by TomTom from time to time). It is your responsibility to check, review and comply with those terms as they apply to the SDK licensed to you under this Agreement. The applicable third party and open-source notices are set out in the accompanying THIRD_PARTY.txt file. In the event of a conflict between this Agreement and an open-source license governing a specific dependency, that open-source license shall prevail solely with respect to that dependency.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
4. PRIVACY: In order to improve the TomTom Developer Portal and the SDK, TomTom may collect certain usage related information from the software, including but not limited to general SDK and product identifiers, version numbers, and information on which tools and/or services in the SDK are used and how you use them. In addition, TomTom may collect your unique identifier and associated IP address for legitimate business reasons (such as, without limitation, the processing of invoices). This data is retained for a maximum period of 120 days and is maintained in accordance with our Privacy Policy.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
5. INTELLECTUAL PROPERTY RIGHTS AND COPYRIGHT NOTICES:
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
5.1. All intellectual property rights related to the SDK and to the TomTom APIs are owned by TomTom and/or its licensors and suppliers. TomTom obtains no intellectual property rights under this Agreement in or to any Permitted Application that you develop using the SDK and the TomTom APIs.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
5.2. Your use of any trade names, logos, trademarks, service marks and other marks of TomTom is subject to TomTom’s prior written approval, and any goodwill arising out of such use shall inure to the benefit of TomTom. You also agree not to remove, obscure, mask or change any logo and/or copyright notice placed on, or automatically generated by, the SDK or the TomTom APIs.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
6. WARRANTIES:
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
6.1. YOU ACKNOWLEDGE THAT THE SDK HAS NOT BEEN DEVELOPED TO MEET YOUR INDIVIDUAL REQUIREMENTS AND THAT IT IS THEREFORE YOUR RESPONSIBILITY TO ENSURE THAT ITS FACILITIES AND FUNCTIONS MEET YOUR REQUIREMENTS. TOMTOM DOES NOT AND CANNOT WARRANT THAT THE SDK OPERATES UNINTERRUPTED OR ERROR-FREE, OR THAT IT IS CAPABLE OF INTEROPERATING WITH ANY OTHER SYSTEM, DEVICE OR PRODUCT (EITHER SOFTWARE OR HARDWARE).
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
6.2. YOUR USE OF THE SDK AND OF ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH ITS USE IS AT YOUR OWN DISCRETION AND RISK, AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICES, OR ANY LOSS OF DATA, THAT RESULTS FROM SUCH USE.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
6.3. WITHOUT LIMITING CLAUSES 6.1 AND 6.2 ABOVE, THE SDK IS PROVIDED ON AN “AS IS” AND “ALL FAULTS” BASIS AND TOMTOM EXPRESSLY DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, SATISFACTORY QUALITY, ACCURACY, TITLE AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
6.4. THIS CLAUSE 6 DOES NOT AFFECT ANY OF YOUR LEGAL RIGHTS UNDER APPLICABLE MANDATORY NATIONAL LEGISLATION, INCLUDING BUT NOT LIMITED TO ANY MANDATORY STATUTORY WARRANTIES.
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
7. LIMITATION OF LIABILITY:
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
7.1. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, NEITHER TOMTOM NOR ITS LICENSORS, SUPPLIERS, OFFICERS, DIRECTORS OR EMPLOYEES SHALL BE LIABLE TO YOU OR TO ANY THIRD PARTY FOR ANY DAMAGES, WHETHER DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL (INCLUDING BUT NOT LIMITED TO DAMAGES FOR THE INABILITY TO USE OR ACCESS THE SDK OR THE TOMTOM APIS, LOSS OF DATA, LOSS OF BUSINESS, LOSS OF PROFITS, BUSINESS INTERRUPTION OR THE LIKE) ARISING OUT OF OR RELATED TO THE USE OF, THE INABILITY TO USE OR ACCESS, OR OTHERWISE THE PERFORMANCE OF THE SDK, EVEN IF TOMTOM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
7.2. TO THE EXTENT TOMTOM IS NOT PERMITTED UNDER APPLICABLE LAW TO EXCLUDE ITS LIABILITY PURSUANT TO CLAUSE 7.1 ABOVE, TOMTOM’S TOTAL AGGREGATE LIABILITY TO YOU SHALL BE LIMITED TO EUR 100.00.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
7.3. THE LIMITATIONS OF LIABILITY UNDER THIS CLAUSE 7 DO NOT: (I) AFFECT YOUR RIGHTS UNDER ANY APPLICABLE MANDATORY NATIONAL LEGISLATION; OR (II) EXCLUDE OR LIMIT ANY LIABILITY THAT CANNOT BE EXCLUDED OR LIMITED UNDER APPLICABLE LAW.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
8. IPR INDEMNITY: To the maximum extent permitted by law, you agree to defend, indemnify and hold TomTom and its respective directors, officers, employees, affiliates, agents and suppliers harmless from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorney’s fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person, or that defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this Agreement.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
9. TERM AND TERMINATION AND DIRECT ENFORCEMENT:
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
9.1. This Agreement begins on either (a) the date you demonstrate your acceptance of its terms and conditions or (b) the date you first use the SDK, and continues until terminated (jointly the “Term”) by either TomTom or you in accordance with this Agreement. The provisions of this Agreement which by their nature are intended to survive termination will remain in effect after termination, and you agree that TomTom may directly enforce these provisions against you.
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
9.2. Without prejudice to any other rights, TomTom may immediately terminate this Agreement if (i) you fail to comply with any of its terms and conditions, (ii) the agreement governing the use of the TomTom APIs between you and TomTom has terminated, or (iii) TomTom decides to no longer provide the SDK, or certain parts of it, either entirely or in territories related to your use.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
9.3. You may terminate this Agreement at any time by ceasing your use of the SDK.
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
10. GOVERNING LAW AND DISPUTE RESOLUTION:
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
10.1. This Agreement, and any dispute arising under or in connection with it (including any non-contractual claims and disputes), shall be governed by and construed in accordance with the laws of the Netherlands. The applicability of the United Nations Convention on Contracts for the International Sale of Goods is explicitly excluded.
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
10.2. If you, your employer or the entity on whose behalf you act is incorporated in the European Union, you and TomTom hereby irrevocably submit to the exclusive jurisdiction of the courts of Amsterdam, the Netherlands, in respect of any such dispute.
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
10.3. If you, your employer or the entity on whose behalf you act is incorporated outside the European Union, all such disputes shall be settled in accordance with the Arbitration Rules of the Netherlands Arbitration Institute. The arbitral tribunal shall be composed of three (3) arbitrators, the place of arbitration shall be Amsterdam and the language of the arbitration shall be English. Consolidation of the arbitral proceedings with other arbitral proceedings, as provided for in Article 1046 of the Dutch Code of Civil Procedure and Article 39 of the Arbitration Rules of the Netherlands Arbitration Institute, is excluded.
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
10.4. Notwithstanding Clauses 10.2 and 10.3, TomTom remains entitled to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
11. OTHER LEGAL TERMS:
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
11.1. No failure or delay by TomTom in exercising any right or remedy provided under this Agreement or by law constitutes a waiver of that or any other right or remedy, nor does it preclude or restrict the further exercise of that or any other right or remedy. No single or partial exercise of such right or remedy precludes or restricts its further exercise.
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
11.2. If any provision of this Agreement is held invalid or unenforceable, for any reason or to any extent, that does not affect the validity or enforceability of the remaining provisions, and the provision concerned shall be enforced to the extent permitted by law.
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
11.3. The rights granted to you in this Agreement may not be assigned or transferred by you without TomTom’s prior written approval.
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
11.4. The TomTom APIs and the SDK are provided as “Commercial Computer Software” or “restricted computer software”. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions set forth in 48 C.F.R. Section 12.212 or 48 C.F.R. 227.2702, as applicable, or successor provisions. In respect of the Map API and Search API, the manufacturer is TomTom Global Content B.V.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
11.5. By submitting any suggestion, bug fix or code contribution (“Contribution”) to TomTom (e.g. via a GitHub Pull Request), you grant TomTom a perpetual, irrevocable, worldwide, royalty-free and non-exclusive license to use, reproduce, modify and distribute the Contribution as part of the SDK. You represent that you have the legal right to grant this license and that the Contribution does not infringe any third-party intellectual property rights.
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
THIRD PARTY SOFTWARE NOTICES
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
As referred to in Clause 3.5, the third party and open-source components included in or required by this package are listed, together with their applicable license notices, in the THIRD_PARTY.txt file distributed alongside this LICENSE.txt. For the SDK bundles themselves, that file is also published at:
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
7.1. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, NEITHER TOMTOM NOR ITS LICENSORS, SUPPLIERS, OFFICERS, DIRECTORS OR EMPLOYEES SHALL BE LIABLE TO YOU OR TO ANY THIRD PARTY FOR ANY DAMAGES, WHETHER DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL (INCLUDING BUT NOT LIMITED TO DAMAGES FOR THE INABILITY TO USE OR ACCESS THE TOMTOM MAPS SDK FOR JAVASCRIPT OR TOMTOM MAPS APIS, LOSS OF DATA, LOSS OF BUSINESS, LOSS OF PROFITS, BUSINESS INTERRUPTION OR THE LIKE) ARISING OUT OF OR RELATED TO THE USE OF, THE INABILITY TO USE OR ACCESS, OR OTHERWISE THE PERFORMANCE OF THE TOMTOM MAPS SDK FOR JAVASCRIPT, EVEN IF TOMTOM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
7.2. TO THE EXTENT TOMTOM IS NOT PERMITTED UNDER APPLICABLE LAW TO EXCLUDE ITS LIABILITY PURSUANT TO CLAUSE 7.1 ABOVE, TOMTOM’S TOTAL AGGREGATE LIABILITY TO YOU SHALL BE LIMITED TO THE AMOUNT OF EUR100.00.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
7.3. THE ABOVE LIMITATIONS OF LIABILITY UNDER THIS CLAUSE 7 DO NOT: (I) AFFECT YOUR RIGHTS UNDER ANY APPLICABLE MANDATORY NATIONAL LEGISLATION; (II) EXCLUDE OR LIMIT ANY LIABILITY THAT CANNOT BE EXCLUDED OR LIMITED UNDER APPLICABLE LAW.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
8. IPR INDMENITY: To the maximum extent permitted by law, you agree to defend, indemnify and hold TomTom and its respective directors, officers, employees, affiliates, agents and suppliers harmless from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorney’s fees) arising out of or accruing from (a) your use of the TomTom Maps SDK for JavaScript, (b) any application you develop on the TomTom Maps SDK for JavaScript that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this Agreement.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
9. TERM AND TERMINATION AND DIRECT ENFORCEMENT:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
9.1. This Agreement begins on either (a) the date you demonstrate your acceptance of the terms and conditions of this Agreement or (b) when you first use the TomTom Maps SDK for JavaScript and shall continue until terminated (jointly the “Term”) by either TomTom or you subject to and in accordance with this Agreement. The provisions of this Agreement, which by their nature are intended to survive termination, will remain in effect after termination of this Agreement. Furthermore, you agree that TomTom may directly enforce these provisions against you.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
9.2. Without prejudice to any other rights, TomTom may immediately terminate this Agreement if (i) you fail to comply with any of its terms and conditions, or (ii) the agreement governing the use of TomTom Maps APIs between you and TomTom you has terminated, or (iii) TomTom decides to no longer provide the TomTom Maps SDK for JavaScript or certain parts of the TomTom Maps SDK for JavaScript either entirely or in certain territories related to your use.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
9.3. You may terminate this Agreement by ceasing your use of the TomTom Maps SDK for JavaScript at any time.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
10. GOVERNING LAW AND DISPUTE RESOLUTION:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
10.1. If you, your employer or the entity on whose behalf you act is incorporated in the European Union then this Agreement and any dispute arising under or in connection with it, including any non-contractual claims and disputes, shall be governed by and construed in accordance with the laws of the Netherlands. The applicability of the United Nations Convention on Contracts for the International Sale of Goods is explicitly excluded. You and TomTom hereby irrevocably submit to the exclusive jurisdiction of the courts of Amsterdam, the Netherlands in respect of any dispute arising under or in connection with this Agreement, including any non-contractual claims or disputes.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
10.2. If you, your employer or the entity on whose behalf you act is incorporated outside of European Union, then this Agreement and any dispute arising under or in connection with it, including any non-contractual claims and disputes, shall be governed by and construed in accordance with the laws of the Netherlands. All disputes arising in connection with the Agreement, including any non-contractual claims or disputes, shall be settled in accordance with the Arbitration Rules of the Netherlands Arbitration Institute. The arbitral tribunal shall be composed of three (3) arbitrators. The place or arbitration shall be Amsterdam and the language of the arbitration shall be English. Consolidation of the arbitral proceedings with other arbitral proceedings, as provided for in Article 1046 of the Dutch Code of Civil Procedure and Article 39 of the Arbitration Rules of the Netherlands Arbitration Institute, is excluded.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
10.3. Notwithstanding this, TomTom shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
|
|
140
|
-
|
|
141
|
-
--
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
11. OTHER LEGAL TERMS:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
11.1. No failure or delay by TomTom to exercise any right or remedy provided under this Agreement or by law shall constitute a waiver of that or any other right or remedy, nor shall it preclude or restrict the further exercise of that or any other right or remedy. No single or partial exercise of such right or remedy shall preclude or restrict the further exercise of that or any other right or remedy.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
11.2. Should for any reason, or to any extent, any provision of this Agreement be held invalid or unenforceable, such invalidity or enforceability shall not affect or render invalid or unenforceable the remaining provisions of this Agreement and the application of that provision shall be enforced to the extent permitted by law.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
11.3. The rights granted to you in this Agreement may not be assigned or transferred by you without TomTom’s prior written approval.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
11.4. The TomTom Maps APIs and TomTom Maps SDK for JavaScript are provided as “Commercial Computer Software” or “restricted computer software”. Use, duplication, or disclosure by the U.S. Government or U.S. Government subcontractor is subject to the restrictions set forth in 48.C.F.R. Section 12.212 or 48 C.F.R.227.2702, as applicable or successor provisions. In respect of the Map API and Search API, the manufacturer is TomTom Global Content B.V.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
11.5. The availability of the TomTom Maps SDK source code in a public repository does not constitute 'Open-Source' licensing. This Agreement does not grant you any rights under any Open-Source Initiative (OSI) approved license. Your rights are strictly limited to those expressly granted in Clause 1."
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
11.6 By submitting any suggestion, bug fix, or code contribution (“Contribution”) to TomTom (e.g., via a GitHub Pull Request), you hereby grant TomTom a perpetual, irrevocable, worldwide, royalty-free, and non-exclusive license to use, reproduce, modify, and distribute the Contribution as part of the TomTom Maps SDK. You represent that you have the legal right to grant this license and that the Contribution does not infringe any third-party intellectual property rights.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Name: zod
|
|
176
|
-
Version: 4.1.12
|
|
177
|
-
License: MIT
|
|
178
|
-
Private: false
|
|
179
|
-
Description: TypeScript-first schema declaration and validation library with static type inference
|
|
180
|
-
Repository: git+https://github.com/colinhacks/zod.git
|
|
181
|
-
Homepage: https://zod.dev
|
|
182
|
-
Author: Colin McDonnell <zod@colinhacks.com>
|
|
183
|
-
License Copyright:
|
|
184
|
-
===
|
|
185
|
-
|
|
186
|
-
MIT License
|
|
187
|
-
|
|
188
|
-
Copyright (c) 2025 Colin McDonnell
|
|
189
|
-
|
|
190
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
191
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
192
|
-
in the Software without restriction, including without limitation the rights
|
|
193
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
194
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
195
|
-
furnished to do so, subject to the following conditions:
|
|
196
|
-
|
|
197
|
-
The above copyright notice and this permission notice shall be included in all
|
|
198
|
-
copies or substantial portions of the Software.
|
|
199
|
-
|
|
200
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
201
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
202
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
203
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
204
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
205
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
206
|
-
SOFTWARE.
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
|
-
Name: lodash-es
|
|
211
|
-
Version: 4.17.21
|
|
212
|
-
License: MIT
|
|
213
|
-
Private: false
|
|
214
|
-
Description: Lodash exported as ES modules.
|
|
215
|
-
Repository: undefined
|
|
216
|
-
Homepage: https://lodash.com/custom-builds
|
|
217
|
-
Author: John-David Dalton <john.david.dalton@gmail.com>
|
|
218
|
-
Contributors:
|
|
219
|
-
John-David Dalton <john.david.dalton@gmail.com>
|
|
220
|
-
Mathias Bynens <mathias@qiwi.be>
|
|
221
|
-
License Copyright:
|
|
222
|
-
===
|
|
223
|
-
|
|
224
|
-
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
225
|
-
|
|
226
|
-
Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
227
|
-
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
228
|
-
|
|
229
|
-
This software consists of voluntary contributions made by many
|
|
230
|
-
individuals. For exact contribution history, see the revision history
|
|
231
|
-
available at https://github.com/lodash/lodash
|
|
232
|
-
|
|
233
|
-
The following license applies to all parts of this software except as
|
|
234
|
-
documented below:
|
|
235
|
-
|
|
236
|
-
====
|
|
237
|
-
|
|
238
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
239
|
-
a copy of this software and associated documentation files (the
|
|
240
|
-
"Software"), to deal in the Software without restriction, including
|
|
241
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
242
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
243
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
244
|
-
the following conditions:
|
|
245
|
-
|
|
246
|
-
The above copyright notice and this permission notice shall be
|
|
247
|
-
included in all copies or substantial portions of the Software.
|
|
248
|
-
|
|
249
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
250
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
251
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
252
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
253
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
254
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
255
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
256
|
-
|
|
257
|
-
====
|
|
258
|
-
|
|
259
|
-
Copyright and related rights for sample code are waived via CC0. Sample
|
|
260
|
-
code is defined as all source code displayed within the prose of the
|
|
261
|
-
documentation.
|
|
262
|
-
|
|
263
|
-
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
|
264
|
-
|
|
265
|
-
====
|
|
266
|
-
|
|
267
|
-
Files located in the node_modules and vendor directories are externally
|
|
268
|
-
maintained libraries used by this software which have their own
|
|
269
|
-
licenses; we recommend you read them, as their terms may differ from the
|
|
270
|
-
terms above.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
Name: @turf/helpers
|
|
279
|
-
Version: 7.3.0
|
|
280
|
-
License: MIT
|
|
281
|
-
Private: false
|
|
282
|
-
Description: Provides helper functions to create GeoJSON features, like points, lines, or areas on a map.
|
|
283
|
-
Repository: git://github.com/Turfjs/turf.git
|
|
284
|
-
Homepage: https://github.com/Turfjs/turf
|
|
285
|
-
Author: Turf Authors
|
|
286
|
-
Contributors:
|
|
287
|
-
Tom MacWright <@tmcw>
|
|
288
|
-
Stefano Borghi <@stebogit>
|
|
289
|
-
Denis Carriere <@DenisCarriere>
|
|
290
|
-
William Nordmann <@wnordmann>
|
|
291
|
-
License Copyright:
|
|
292
|
-
===
|
|
293
|
-
|
|
294
|
-
The MIT License (MIT)
|
|
295
|
-
|
|
296
|
-
Copyright (c) 2017 TurfJS
|
|
297
|
-
|
|
298
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
299
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
300
|
-
the Software without restriction, including without limitation the rights to
|
|
301
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
302
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
303
|
-
subject to the following conditions:
|
|
304
|
-
|
|
305
|
-
The above copyright notice and this permission notice shall be included in all
|
|
306
|
-
copies or substantial portions of the Software.
|
|
307
|
-
|
|
308
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
309
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
310
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
311
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
312
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
313
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
314
|
-
|
|
315
|
-
---
|
|
316
|
-
|
|
317
|
-
Name: @turf/invariant
|
|
318
|
-
Version: 7.3.0
|
|
319
|
-
License: MIT
|
|
320
|
-
Private: false
|
|
321
|
-
Description: Lightweight utility for input validation and data extraction in Turf.js. Ensures GeoJSON inputs are in the correct format and extracts specific components like coordinates or geometries.
|
|
322
|
-
Repository: git://github.com/Turfjs/turf.git
|
|
323
|
-
Homepage: https://github.com/Turfjs/turf
|
|
324
|
-
Author: Turf Authors
|
|
325
|
-
Contributors:
|
|
326
|
-
Tom MacWright <@tmcw>
|
|
327
|
-
Denis Carriere <@DenisCarriere>
|
|
328
|
-
License Copyright:
|
|
329
|
-
===
|
|
330
|
-
|
|
331
|
-
The MIT License (MIT)
|
|
332
|
-
|
|
333
|
-
Copyright (c) 2017 TurfJS
|
|
334
|
-
|
|
335
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
336
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
337
|
-
the Software without restriction, including without limitation the rights to
|
|
338
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
339
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
340
|
-
subject to the following conditions:
|
|
341
|
-
|
|
342
|
-
The above copyright notice and this permission notice shall be included in all
|
|
343
|
-
copies or substantial portions of the Software.
|
|
344
|
-
|
|
345
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
346
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
347
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
348
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
349
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
350
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
351
|
-
|
|
352
|
-
---
|
|
353
|
-
|
|
354
|
-
Name: @turf/bearing
|
|
355
|
-
Version: 7.3.0
|
|
356
|
-
License: MIT
|
|
357
|
-
Private: false
|
|
358
|
-
Description: Takes two points and finds the geographic bearing between them.
|
|
359
|
-
Repository: git://github.com/Turfjs/turf.git
|
|
360
|
-
Homepage: https://github.com/Turfjs/turf
|
|
361
|
-
Author: Turf Authors
|
|
362
|
-
License Copyright:
|
|
363
|
-
===
|
|
364
|
-
|
|
365
|
-
The MIT License (MIT)
|
|
366
|
-
|
|
367
|
-
Copyright (c) 2017 TurfJS
|
|
368
|
-
|
|
369
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
370
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
371
|
-
the Software without restriction, including without limitation the rights to
|
|
372
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
373
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
374
|
-
subject to the following conditions:
|
|
375
|
-
|
|
376
|
-
The above copyright notice and this permission notice shall be included in all
|
|
377
|
-
copies or substantial portions of the Software.
|
|
378
|
-
|
|
379
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
380
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
381
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
382
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
383
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
384
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
385
|
-
|
|
386
|
-
---
|
|
387
|
-
|
|
388
|
-
Name: maplibre-gl
|
|
389
|
-
Version: 5.12.0
|
|
390
|
-
License: BSD-3-Clause
|
|
391
|
-
Private: false
|
|
392
|
-
Description: BSD licensed community fork of mapbox-gl, a WebGL interactive maps library
|
|
393
|
-
Repository: git://github.com/maplibre/maplibre-gl-js.git
|
|
394
|
-
Homepage: https://maplibre.org/
|
|
395
|
-
License Copyright:
|
|
396
|
-
===
|
|
397
|
-
|
|
398
|
-
Copyright (c) 2023, MapLibre contributors
|
|
399
|
-
|
|
400
|
-
All rights reserved.
|
|
401
|
-
|
|
402
|
-
Redistribution and use in source and binary forms, with or without modification,
|
|
403
|
-
are permitted provided that the following conditions are met:
|
|
404
|
-
|
|
405
|
-
* Redistributions of source code must retain the above copyright notice,
|
|
406
|
-
this list of conditions and the following disclaimer.
|
|
407
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
|
408
|
-
this list of conditions and the following disclaimer in the documentation
|
|
409
|
-
and/or other materials provided with the distribution.
|
|
410
|
-
* Neither the name of MapLibre GL JS nor the names of its contributors
|
|
411
|
-
may be used to endorse or promote products derived from this software
|
|
412
|
-
without specific prior written permission.
|
|
413
|
-
|
|
414
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
415
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
416
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
417
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
418
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
419
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
420
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
421
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
422
|
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
423
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
424
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
-------------------------------------------------------------------------------
|
|
428
|
-
|
|
429
|
-
Contains code from mapbox-gl-js v1.13 and earlier
|
|
430
|
-
|
|
431
|
-
Version v1.13 of mapbox-gl-js and earlier are licensed under a BSD-3-Clause license
|
|
432
|
-
|
|
433
|
-
Copyright (c) 2020, Mapbox
|
|
434
|
-
Redistribution and use in source and binary forms, with or without modification,
|
|
435
|
-
are permitted provided that the following conditions are met:
|
|
436
|
-
|
|
437
|
-
* Redistributions of source code must retain the above copyright notice,
|
|
438
|
-
this list of conditions and the following disclaimer.
|
|
439
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
|
440
|
-
this list of conditions and the following disclaimer in the documentation
|
|
441
|
-
and/or other materials provided with the distribution.
|
|
442
|
-
* Neither the name of Mapbox GL JS nor the names of its contributors
|
|
443
|
-
may be used to endorse or promote products derived from this software
|
|
444
|
-
without specific prior written permission.
|
|
445
|
-
|
|
446
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
447
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
448
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
449
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
450
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
451
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
452
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
453
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
454
|
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
455
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
456
|
-
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
-------------------------------------------------------------------------------
|
|
460
|
-
|
|
461
|
-
Contains code from glfx.js
|
|
462
|
-
|
|
463
|
-
Copyright (C) 2011 by Evan Wallace
|
|
464
|
-
|
|
465
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
466
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
467
|
-
in the Software without restriction, including without limitation the rights
|
|
468
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
469
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
470
|
-
furnished to do so, subject to the following conditions:
|
|
471
|
-
|
|
472
|
-
The above copyright notice and this permission notice shall be included in
|
|
473
|
-
all copies or substantial portions of the Software.
|
|
474
|
-
|
|
475
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
476
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
477
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
478
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
479
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
480
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
481
|
-
THE SOFTWARE.
|
|
482
|
-
|
|
483
|
-
--------------------------------------------------------------------------------
|
|
484
|
-
|
|
485
|
-
Contains a portion of d3-color https://github.com/d3/d3-color
|
|
486
|
-
|
|
487
|
-
Copyright 2010-2016 Mike Bostock
|
|
488
|
-
All rights reserved.
|
|
489
|
-
|
|
490
|
-
Redistribution and use in source and binary forms, with or without modification,
|
|
491
|
-
are permitted provided that the following conditions are met:
|
|
492
|
-
|
|
493
|
-
* Redistributions of source code must retain the above copyright notice, this
|
|
494
|
-
list of conditions and the following disclaimer.
|
|
495
|
-
|
|
496
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
|
497
|
-
this list of conditions and the following disclaimer in the documentation
|
|
498
|
-
and/or other materials provided with the distribution.
|
|
499
|
-
|
|
500
|
-
* Neither the name of the author nor the names of contributors may be used to
|
|
501
|
-
endorse or promote products derived from this software without specific prior
|
|
502
|
-
written permission.
|
|
503
|
-
|
|
504
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
505
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
506
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
507
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
508
|
-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
509
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
510
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
511
|
-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
512
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
513
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
87
|
+
https://github.com/tomtom-international/maps-sdk-js/blob/main/THIRD_PARTY.txt
|
package/THIRD_PARTY.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
No third party dependencies.
|
package/dist/THIRD_PARTY.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
No third
|
|
1
|
+
No third party dependencies.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,135 +1,133 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PlacesModule } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
export { }
|
|
1
|
+
import { POICategory } from "@tomtom-org/maps-sdk/core";
|
|
2
|
+
import { PlacesModule, PlacesModuleConfig, TomTomMap } from "@tomtom-org/maps-sdk/map";
|
|
3
|
+
import { FuzzySearchParams } from "@tomtom-org/maps-sdk/services";
|
|
4
|
+
//#region src/viewportPlaces.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Common Options when adding a viewport places module.
|
|
7
|
+
*
|
|
8
|
+
* @group Viewport Places
|
|
9
|
+
*/
|
|
10
|
+
export type ViewportPlacesAddCommonOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Optional unique identifier for the viewport places module.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* * If not provided, a random ID will be generated.
|
|
16
|
+
* * If you need to keep updating or removing this place module later, provide a fixed ID.
|
|
17
|
+
*/
|
|
18
|
+
id?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Minimum zoom level at which the place module is visible.
|
|
21
|
+
*/
|
|
22
|
+
minZoom?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Maximum zoom level at which the place module is visible.
|
|
25
|
+
*/
|
|
26
|
+
maxZoom?: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Full Options when adding a viewport places module.
|
|
30
|
+
*
|
|
31
|
+
* @group Viewport Places
|
|
32
|
+
*/
|
|
33
|
+
export type ViewportPlacesAddOptions = ViewportPlacesAddCommonOptions & {
|
|
34
|
+
/**
|
|
35
|
+
* The search parameters to query places for this place module.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* `geoBias` and `signal` are not accepted here: each module always searches the current
|
|
39
|
+
* viewport and owns an `AbortSignal` so that a new search cancels the one it supersedes.
|
|
40
|
+
*/
|
|
41
|
+
searchOptions: Omit<FuzzySearchParams, 'geoBias' | 'signal'>;
|
|
42
|
+
/**
|
|
43
|
+
* Optional configuration for the places module, such as styling.
|
|
44
|
+
*/
|
|
45
|
+
placesModuleConfig?: PlacesModuleConfig;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Options when updating a viewport places module.
|
|
49
|
+
*
|
|
50
|
+
* @group Viewport Places
|
|
51
|
+
*/
|
|
52
|
+
export type ViewportPlacesOptions = Omit<ViewportPlacesAddOptions, 'id'> & {
|
|
53
|
+
/**
|
|
54
|
+
* The unique identifier of the place module to update.
|
|
55
|
+
* @remarks
|
|
56
|
+
* * This ID must correspond to an existing place module added via an "add" method.
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* A class for managing dynamic searched place modules on a TomTom map.
|
|
62
|
+
*
|
|
63
|
+
* It leverages the SDK search service to maintain place modules that automatically
|
|
64
|
+
* update and stay current as the map viewport changes.
|
|
65
|
+
*
|
|
66
|
+
* @group Viewport Places
|
|
67
|
+
*/
|
|
68
|
+
export declare class ViewportPlaces {
|
|
69
|
+
private readonly map;
|
|
70
|
+
/**
|
|
71
|
+
* Internal map of registered place modules, keyed by their `id`.
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
private registeredModules;
|
|
75
|
+
private readonly mapLibreMap;
|
|
76
|
+
/**
|
|
77
|
+
* Creates an instance of ViewportPlaces bound to a TomTom map.
|
|
78
|
+
* @param map - The TomTom map instance to attach place modules to.
|
|
79
|
+
*/
|
|
80
|
+
constructor(map: TomTomMap);
|
|
81
|
+
/**
|
|
82
|
+
* Performs the update logic for a registered PlacesModule, cancelling whatever search that
|
|
83
|
+
* module still has in flight.
|
|
84
|
+
* @param id - The unique identifier of the registered place module to refresh.
|
|
85
|
+
*/
|
|
86
|
+
private searchAndDisplay;
|
|
87
|
+
/**
|
|
88
|
+
* Adds a PlacesModule that displays places based on fuzzy search parameters and automatically updates as the map moves.
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* * Each call to "add" creates a new place module and places it above previously added modules.
|
|
92
|
+
* * Place modules are rendered bottom-up in the order they are added: the first added module is displayed at the bottom, and later modules are stacked on top of earlier ones.
|
|
93
|
+
* * The default places module theme is 'base-map' unless overridden in the options.
|
|
94
|
+
*
|
|
95
|
+
* @param options - The options for the place module.
|
|
96
|
+
* @returns A promise that resolves to the PlacesModule instance managing the module.
|
|
97
|
+
*/
|
|
98
|
+
add(options: ViewportPlacesAddOptions): Promise<PlacesModule>;
|
|
99
|
+
/**
|
|
100
|
+
* Adds a PlacesModule for specific POI categories that updates automatically as the map moves.
|
|
101
|
+
* The POIs are shown in the same style as the base map.
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* * This is a convenience wrapper over `add` that configures a category-based search for a PlacesModule.
|
|
105
|
+
* * Each call creates a new place module that will be stacked on top of previously added modules.
|
|
106
|
+
*
|
|
107
|
+
* @param options - The options for the category-based place module.
|
|
108
|
+
* @returns A promise that resolves to the PlacesModule instance managing the module.
|
|
109
|
+
*/
|
|
110
|
+
addPOICategories(options: ViewportPlacesAddCommonOptions & {
|
|
111
|
+
categories: POICategory[];
|
|
112
|
+
}): Promise<PlacesModule>;
|
|
113
|
+
/**
|
|
114
|
+
* Removes a specific place module by its ID, stopping its updates and clearing the displayed places.
|
|
115
|
+
* @remarks
|
|
116
|
+
* If the id does not exist, an error is logged into console.
|
|
117
|
+
*
|
|
118
|
+
* @param id - The unique identifier of the PlacesModule to remove.
|
|
119
|
+
*/
|
|
120
|
+
remove(id: string): void;
|
|
121
|
+
/**
|
|
122
|
+
* Removes all registered place modules, stopping their updates and clearing all displayed places.
|
|
123
|
+
*/
|
|
124
|
+
removeAll(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Updates the search and display options for an existing place module identified by its ID.
|
|
127
|
+
* This will immediately apply the new options and refresh the place module accordingly.
|
|
128
|
+
* @param newOptions - The new options to apply.
|
|
129
|
+
* @throws Error if the place module with the given ID does not exist.
|
|
130
|
+
*/
|
|
131
|
+
update(newOptions: ViewportPlacesOptions): Promise<void>;
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
package/dist/index.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{generateId as
|
|
1
|
+
import{generateId as o}from"@tomtom-org/maps-sdk/core";import{PlacesModule as e}from"@tomtom-org/maps-sdk/map";import{SDKAbortError as s,search as t}from"@tomtom-org/maps-sdk/services";var i=class{map;registeredModules={};mapLibreMap;constructor(o){this.map=o,this.mapLibreMap=o.mapLibreMap}async searchAndDisplay(o){const e=this.registeredModules[o];if(!e)return;const{placesModule:i,options:r}=e;e.controller?.abort();const a=this.mapLibreMap.getZoom();if(r.minZoom&&a<r.minZoom||r.maxZoom&&a>r.maxZoom)return void(await i.clear());const n=new AbortController;e.controller=n;try{const o=await t({geoBias:{boundingBox:this.map.getBBox()},limit:100,...r.searchOptions,signal:n.signal});if(n.signal.aborted)return;await i.show(o)}catch(l){if(l instanceof s)return;throw l}}async add(s){const t=s.id??o(),i={...s,placesModuleConfig:{theme:"base-map",...s.placesModuleConfig}},r=await e.create(this.map,i.placesModuleConfig),a=()=>this.searchAndDisplay(t),n=this.mapLibreMap.on("moveend",a);return this.registeredModules[t]={placesModule:r,subscription:n,options:i},await a(),r}async addPOICategories(o){return this.add({...o,searchOptions:{poiCategories:o.categories}})}remove(o){const e=this.registeredModules[o];e?(e.controller?.abort(),e.placesModule.clear(),e.subscription.unsubscribe(),delete this.registeredModules[o]):console.error(`Viewport places module ${o} not found`)}removeAll(){Object.keys(this.registeredModules).forEach(o=>this.remove(o))}async update(o){const e=this.registeredModules[o.id];if(!e)throw new Error(`Place module with id ${o.id} not found`);const s=e.options;e.options={...s,...o,searchOptions:{...s.searchOptions,...o.searchOptions},placesModuleConfig:{...s.placesModuleConfig,...o.placesModuleConfig}},e.placesModule.applyConfig(e.options.placesModuleConfig),await this.searchAndDisplay(o.id)}};export{i as ViewportPlaces};
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","names":[],"sources":["../src/viewportPlaces.ts"],"sourcesContent":["import { generateId, POICategory } from '@tomtom-org/maps-sdk/core';\nimport { PlacesModule, type PlacesModuleConfig, TomTomMap } from '@tomtom-org/maps-sdk/map';\nimport { type FuzzySearchParams, search } from '@tomtom-org/maps-sdk/services';\n\n/**\n * Common Options when adding a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesAddCommonOptions = {\n /**\n * Optional unique identifier for the viewport places module.\n *\n * @remarks\n * * If not provided, a random ID will be generated.\n * * If you need to keep updating or removing this place module later, provide a fixed ID.\n */\n id?: string;\n /**\n * Minimum zoom level at which the place module is visible.\n */\n minZoom?: number;\n /**\n * Maximum zoom level at which the place module is visible.\n */\n maxZoom?: number;\n};\n\n/**\n * Full Options when adding a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesAddOptions = ViewportPlacesAddCommonOptions & {\n /**\n * The search parameters to query places for this place module.\n */\n searchOptions: Omit<FuzzySearchParams, 'boundingBox' | 'position'>;\n /**\n * Optional configuration for the places module, such as styling.\n */\n placesModuleConfig?: PlacesModuleConfig;\n};\n\n/**\n * Options when updating a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesOptions = Omit<ViewportPlacesAddOptions, 'id'> & {\n /**\n * The unique identifier of the place module to update.\n * @remarks\n * * This ID must correspond to an existing place module added via an \"add\" method.\n */\n id: string;\n};\n\n/**\n * A class for managing dynamic searched place modules on a TomTom map.\n *\n * It leverages the SDK search service to maintain place modules that automatically\n * update and stay current as the map viewport changes.\n *\n * @group Viewport Places\n */\nexport class ViewportPlaces {\n /**\n * Internal map of registered place modules, keyed by their `id`.\n * @private\n */\n private registeredModules: Record<\n string,\n { options: ViewportPlacesAddOptions; placesModule: PlacesModule; subscription: any }\n > = {};\n private readonly mapLibreMap;\n\n /**\n * Creates an instance of ViewportPlaces bound to a TomTom map.\n * @param map - The TomTom map instance to attach place modules to.\n */\n constructor(private readonly map: TomTomMap) {\n this.mapLibreMap = map.mapLibreMap;\n }\n\n /**\n * Performs the update logic for a PlacesModule with given options.\n * @param placesModule - The PlacesModule to update.\n * @param options - The options containing search parameters and zoom constraints.\n */\n private async searchAndDisplay(placesModule: PlacesModule, options: ViewportPlacesAddOptions): Promise<void> {\n const zoom = this.mapLibreMap.getZoom();\n if ((options.minZoom && zoom < options.minZoom) || (options.maxZoom && zoom > options.maxZoom)) {\n await placesModule.clear();\n return;\n }\n await placesModule.show(\n await search({\n boundingBox: this.map.getBBox(),\n limit: 100,\n ...options.searchOptions,\n }),\n );\n }\n\n /**\n * Adds a PlacesModule that displays places based on fuzzy search parameters and automatically updates as the map moves.\n *\n * @remarks\n * * Each call to \"add\" creates a new place module and places it above previously added modules.\n * * Place modules are rendered bottom-up in the order they are added: the first added module is displayed at the bottom, and later modules are stacked on top of earlier ones.\n * * The default places module theme is 'base-map' unless overridden in the options.\n *\n * @param options - The options for the place module.\n * @returns A promise that resolves to the PlacesModule instance managing the module.\n */\n async add(options: ViewportPlacesAddOptions): Promise<PlacesModule> {\n const id = options.id ?? generateId();\n const effectiveOptions = {\n ...options,\n placesModuleConfig: { theme: 'base-map', ...options.placesModuleConfig } as PlacesModuleConfig,\n };\n\n const placesModule = await PlacesModule.get(this.map, effectiveOptions.placesModuleConfig);\n const searchAndDisplay = async () => {\n const entry = this.registeredModules[id];\n await this.searchAndDisplay(entry.placesModule, entry.options);\n };\n\n const subscription = this.mapLibreMap.on('moveend', searchAndDisplay);\n this.registeredModules[id] = { placesModule, subscription, options: effectiveOptions };\n await searchAndDisplay();\n return placesModule;\n }\n\n /**\n * Adds a PlacesModule for specific POI categories that updates automatically as the map moves.\n * The POIs are shown in the same style as the base map.\n *\n * @remarks\n * * This is a convenience wrapper over `add` that configures a category-based search for a PlacesModule.\n * * Each call creates a new place module that will be stacked on top of previously added modules.\n *\n * @param options - The options for the category-based place module.\n * @returns A promise that resolves to the PlacesModule instance managing the module.\n */\n async addPOICategories(\n options: ViewportPlacesAddCommonOptions & { categories: POICategory[] },\n ): Promise<PlacesModule> {\n return this.add({\n ...options,\n searchOptions: { poiCategories: options.categories },\n });\n }\n\n /**\n * Removes a specific place module by its ID, stopping its updates and clearing the displayed places.\n * @remarks\n * If the id does not exist, an error is logged into console.\n *\n * @param id - The unique identifier of the PlacesModule to remove.\n */\n remove(id: string): void {\n const entry = this.registeredModules[id];\n if (entry) {\n entry.placesModule.clear();\n entry.subscription.unsubscribe();\n delete this.registeredModules[id];\n } else {\n console.error(`Viewport places module ${id} not found`);\n }\n }\n\n /**\n * Removes all registered place modules, stopping their updates and clearing all displayed places.\n */\n removeAll(): void {\n Object.keys(this.registeredModules).forEach((key) => this.remove(key));\n }\n\n /**\n * Updates the search and display options for an existing place module identified by its ID.\n * This will immediately apply the new options and refresh the place module accordingly.\n * @param newOptions - The new options to apply.\n * @throws Error if the place module with the given ID does not exist.\n */\n async update(newOptions: ViewportPlacesOptions): Promise<void> {\n const entry = this.registeredModules[newOptions.id];\n if (!entry) {\n throw new Error(`Place module with id ${newOptions.id} not found`);\n }\n const currentOptions = entry.options;\n\n // Update the options by merging current and new options:\n entry.options = {\n ...currentOptions,\n ...newOptions,\n // search and places display options are merged incrementally:\n searchOptions: { ...currentOptions.searchOptions, ...newOptions.searchOptions },\n placesModuleConfig: { ...currentOptions.placesModuleConfig, ...newOptions.placesModuleConfig },\n };\n // Update the places module configuration and refresh the display:\n entry.placesModule.applyConfig(entry.options.placesModuleConfig);\n await this.searchAndDisplay(entry.placesModule, entry.options);\n }\n}\n"],"mappings":"sKAkEA,IAAa,EAAb,MAKI,kBAGI,CAAA,EACJ,YAMA,WAAA,CAAY,GAAiB,KAAA,IAAA,EACzB,KAAK,YAAc,EAAI,YAQ3B,sBAAc,CAAiB,EAA4B,GACvD,MAAM,EAAO,KAAK,YAAY,UACzB,EAAQ,SAAW,EAAO,EAAQ,SAAa,EAAQ,SAAW,EAAO,EAAQ,cAC5E,EAAa,cAGjB,EAAa,WACT,EAAO,CACT,YAAa,KAAK,IAAI,UACtB,MAAO,OACJ,EAAQ,iBAgBvB,SAAM,CAAI,GACN,MAAM,EAAK,EAAQ,IAAM,IACnB,EAAmB,IAClB,EACH,mBAAoB,CAAE,MAAO,cAAe,EAAQ,qBAGlD,QAAqB,EAAa,IAAI,KAAK,IAAK,EAAiB,oBACjE,EAAmB,UACrB,MAAM,EAAQ,KAAK,kBAAkB,SAC/B,KAAK,iBAAiB,EAAM,aAAc,EAAM,UAGpD,EAAe,KAAK,YAAY,GAAG,UAAW,GAGpD,OAFA,KAAK,kBAAkB,GAAM,CAAE,eAAc,eAAc,QAAS,SAC9D,IACC,EAcX,sBAAM,CACF,GAEA,OAAO,KAAK,IAAI,IACT,EACH,cAAe,CAAE,cAAe,EAAQ,cAWhD,MAAA,CAAO,GACH,MAAM,EAAQ,KAAK,kBAAkB,GACjC,GACA,EAAM,aAAa,QACnB,EAAM,aAAa,qBACZ,KAAK,kBAAkB,IAE9B,QAAQ,MAAM,0BAA0B,eAOhD,SAAA,GACI,OAAO,KAAK,KAAK,mBAAmB,QAAS,GAAQ,KAAK,OAAO,IASrE,YAAM,CAAO,GACT,MAAM,EAAQ,KAAK,kBAAkB,EAAW,IAChD,IAAK,EACD,MAAM,IAAI,MAAM,wBAAwB,EAAW,gBAEvD,MAAM,EAAiB,EAAM,QAG7B,EAAM,QAAU,IACT,KACA,EAEH,cAAe,IAAK,EAAe,iBAAkB,EAAW,eAChE,mBAAoB,IAAK,EAAe,sBAAuB,EAAW,qBAG9E,EAAM,aAAa,YAAY,EAAM,QAAQ,0BACvC,KAAK,iBAAiB,EAAM,aAAc,EAAM"}
|
|
1
|
+
{"version":3,"file":"index.es.js","names":[],"sources":["../src/viewportPlaces.ts"],"sourcesContent":["import { generateId, POICategory } from '@tomtom-org/maps-sdk/core';\nimport { PlacesModule, type PlacesModuleConfig, TomTomMap } from '@tomtom-org/maps-sdk/map';\nimport { type FuzzySearchParams, SDKAbortError, search } from '@tomtom-org/maps-sdk/services';\nimport type { Subscription } from 'maplibre-gl';\n\n/**\n * Common Options when adding a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesAddCommonOptions = {\n /**\n * Optional unique identifier for the viewport places module.\n *\n * @remarks\n * * If not provided, a random ID will be generated.\n * * If you need to keep updating or removing this place module later, provide a fixed ID.\n */\n id?: string;\n /**\n * Minimum zoom level at which the place module is visible.\n */\n minZoom?: number;\n /**\n * Maximum zoom level at which the place module is visible.\n */\n maxZoom?: number;\n};\n\n/**\n * Full Options when adding a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesAddOptions = ViewportPlacesAddCommonOptions & {\n /**\n * The search parameters to query places for this place module.\n *\n * @remarks\n * `geoBias` and `signal` are not accepted here: each module always searches the current\n * viewport and owns an `AbortSignal` so that a new search cancels the one it supersedes.\n */\n searchOptions: Omit<FuzzySearchParams, 'geoBias' | 'signal'>;\n /**\n * Optional configuration for the places module, such as styling.\n */\n placesModuleConfig?: PlacesModuleConfig;\n};\n\n/**\n * Options when updating a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesOptions = Omit<ViewportPlacesAddOptions, 'id'> & {\n /**\n * The unique identifier of the place module to update.\n * @remarks\n * * This ID must correspond to an existing place module added via an \"add\" method.\n */\n id: string;\n};\n\n/**\n * A class for managing dynamic searched place modules on a TomTom map.\n *\n * It leverages the SDK search service to maintain place modules that automatically\n * update and stay current as the map viewport changes.\n *\n * @group Viewport Places\n */\nexport class ViewportPlaces {\n /**\n * Internal map of registered place modules, keyed by their `id`.\n * @private\n */\n private registeredModules: Record<\n string,\n {\n options: ViewportPlacesAddOptions;\n placesModule: PlacesModule;\n subscription: Subscription;\n /** Cancels this module's in-flight search when a newer viewport supersedes it. */\n controller?: AbortController;\n }\n > = {};\n private readonly mapLibreMap;\n\n /**\n * Creates an instance of ViewportPlaces bound to a TomTom map.\n * @param map - The TomTom map instance to attach place modules to.\n */\n constructor(private readonly map: TomTomMap) {\n this.mapLibreMap = map.mapLibreMap;\n }\n\n /**\n * Performs the update logic for a registered PlacesModule, cancelling whatever search that\n * module still has in flight.\n * @param id - The unique identifier of the registered place module to refresh.\n */\n private async searchAndDisplay(id: string): Promise<void> {\n const entry = this.registeredModules[id];\n if (!entry) return;\n\n const { placesModule, options } = entry;\n\n // The previous viewport's search is stale. Must precede the zoom guard below: that path\n // clears and returns early, and a search left running would repopulate what it cleared.\n entry.controller?.abort();\n\n const zoom = this.mapLibreMap.getZoom();\n if ((options.minZoom && zoom < options.minZoom) || (options.maxZoom && zoom > options.maxZoom)) {\n await placesModule.clear();\n return;\n }\n\n const controller = new AbortController();\n entry.controller = controller;\n\n try {\n const places = await search({\n geoBias: { boundingBox: this.map.getBBox() },\n limit: 100,\n ...options.searchOptions,\n signal: controller.signal,\n });\n // Superseded between the response arriving and rendering it\n if (controller.signal.aborted) return;\n\n await placesModule.show(places);\n } catch (error) {\n if (error instanceof SDKAbortError) return;\n\n throw error;\n }\n }\n\n /**\n * Adds a PlacesModule that displays places based on fuzzy search parameters and automatically updates as the map moves.\n *\n * @remarks\n * * Each call to \"add\" creates a new place module and places it above previously added modules.\n * * Place modules are rendered bottom-up in the order they are added: the first added module is displayed at the bottom, and later modules are stacked on top of earlier ones.\n * * The default places module theme is 'base-map' unless overridden in the options.\n *\n * @param options - The options for the place module.\n * @returns A promise that resolves to the PlacesModule instance managing the module.\n */\n async add(options: ViewportPlacesAddOptions): Promise<PlacesModule> {\n const id = options.id ?? generateId();\n const effectiveOptions = {\n ...options,\n placesModuleConfig: { theme: 'base-map', ...options.placesModuleConfig } as PlacesModuleConfig,\n };\n\n const placesModule = await PlacesModule.create(this.map, effectiveOptions.placesModuleConfig);\n const searchAndDisplay = () => this.searchAndDisplay(id);\n\n const subscription = this.mapLibreMap.on('moveend', searchAndDisplay);\n this.registeredModules[id] = { placesModule, subscription, options: effectiveOptions };\n await searchAndDisplay();\n return placesModule;\n }\n\n /**\n * Adds a PlacesModule for specific POI categories that updates automatically as the map moves.\n * The POIs are shown in the same style as the base map.\n *\n * @remarks\n * * This is a convenience wrapper over `add` that configures a category-based search for a PlacesModule.\n * * Each call creates a new place module that will be stacked on top of previously added modules.\n *\n * @param options - The options for the category-based place module.\n * @returns A promise that resolves to the PlacesModule instance managing the module.\n */\n async addPOICategories(\n options: ViewportPlacesAddCommonOptions & { categories: POICategory[] },\n ): Promise<PlacesModule> {\n return this.add({\n ...options,\n searchOptions: { poiCategories: options.categories },\n });\n }\n\n /**\n * Removes a specific place module by its ID, stopping its updates and clearing the displayed places.\n * @remarks\n * If the id does not exist, an error is logged into console.\n *\n * @param id - The unique identifier of the PlacesModule to remove.\n */\n remove(id: string): void {\n const entry = this.registeredModules[id];\n if (entry) {\n entry.controller?.abort();\n entry.placesModule.clear();\n entry.subscription.unsubscribe();\n delete this.registeredModules[id];\n } else {\n console.error(`Viewport places module ${id} not found`);\n }\n }\n\n /**\n * Removes all registered place modules, stopping their updates and clearing all displayed places.\n */\n removeAll(): void {\n Object.keys(this.registeredModules).forEach((key) => this.remove(key));\n }\n\n /**\n * Updates the search and display options for an existing place module identified by its ID.\n * This will immediately apply the new options and refresh the place module accordingly.\n * @param newOptions - The new options to apply.\n * @throws Error if the place module with the given ID does not exist.\n */\n async update(newOptions: ViewportPlacesOptions): Promise<void> {\n const entry = this.registeredModules[newOptions.id];\n if (!entry) {\n throw new Error(`Place module with id ${newOptions.id} not found`);\n }\n const currentOptions = entry.options;\n\n // Update the options by merging current and new options:\n entry.options = {\n ...currentOptions,\n ...newOptions,\n // search and places display options are merged incrementally:\n searchOptions: { ...currentOptions.searchOptions, ...newOptions.searchOptions },\n placesModuleConfig: { ...currentOptions.placesModuleConfig, ...newOptions.placesModuleConfig },\n };\n // Update the places module configuration and refresh the display:\n entry.placesModule.applyConfig(entry.options.placesModuleConfig);\n await this.searchAndDisplay(newOptions.id);\n }\n}\n"],"mappings":"yLAuEA,IAAa,EAAb,MAqBiC,IAhB7B,kBASI,CAAC,EACL,YAMA,WAAA,CAAY,GAAiB,KAAA,IAAA,EACzB,KAAK,YAAc,EAAI,WAC3B,CAOA,sBAAc,CAAiB,GAC3B,MAAM,EAAQ,KAAK,kBAAkB,GACrC,IAAK,EAAO,OAEZ,MAAM,aAAE,EAAA,QAAc,GAAY,EAIlC,EAAM,YAAY,QAElB,MAAM,EAAO,KAAK,YAAY,UAC9B,GAAK,EAAQ,SAAW,EAAO,EAAQ,SAAa,EAAQ,SAAW,EAAO,EAAQ,QAElF,kBADM,EAAa,SAIvB,MAAM,EAAa,IAAI,gBACvB,EAAM,WAAa,EAEnB,IACI,MAAM,QAAe,EAAO,CACxB,QAAS,CAAE,YAAa,KAAK,IAAI,WACjC,MAAO,OACJ,EAAQ,cACX,OAAQ,EAAW,SAGvB,GAAI,EAAW,OAAO,QAAS,aAEzB,EAAa,KAAK,EAC5B,CAAA,MAAS,GACL,GAAI,aAAiB,EAAe,OAEpC,MAAM,CACV,CACJ,CAaA,SAAM,CAAI,GACN,MAAM,EAAK,EAAQ,IAAM,IACnB,EAAmB,IAClB,EACH,mBAAoB,CAAE,MAAO,cAAe,EAAQ,qBAGlD,QAAqB,EAAa,OAAO,KAAK,IAAK,EAAiB,oBACpE,EAAA,IAAyB,KAAK,iBAAiB,GAE/C,EAAe,KAAK,YAAY,GAAG,UAAW,GAGpD,OAFA,KAAK,kBAAkB,GAAM,CAAE,eAAc,eAAc,QAAS,SAC9D,IACC,CACX,CAaA,sBAAM,CACF,GAEA,OAAO,KAAK,IAAI,IACT,EACH,cAAe,CAAE,cAAe,EAAQ,aAEhD,CASA,MAAA,CAAO,GACH,MAAM,EAAQ,KAAK,kBAAkB,GACjC,GACA,EAAM,YAAY,QAClB,EAAM,aAAa,QACnB,EAAM,aAAa,qBACZ,KAAK,kBAAkB,IAE9B,QAAQ,MAAM,0BAA0B,cAEhD,CAKA,SAAA,GACI,OAAO,KAAK,KAAK,mBAAmB,QAAS,GAAQ,KAAK,OAAO,GACrE,CAQA,YAAM,CAAO,GACT,MAAM,EAAQ,KAAK,kBAAkB,EAAW,IAChD,IAAK,EACD,MAAM,IAAI,MAAM,wBAAwB,EAAW,gBAEvD,MAAM,EAAiB,EAAM,QAG7B,EAAM,QAAU,IACT,KACA,EAEH,cAAe,IAAK,EAAe,iBAAkB,EAAW,eAChE,mBAAoB,IAAK,EAAe,sBAAuB,EAAW,qBAG9E,EAAM,aAAa,YAAY,EAAM,QAAQ,0BACvC,KAAK,iBAAiB,EAAW,GAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
package/package.json
CHANGED
|
@@ -2,27 +2,30 @@
|
|
|
2
2
|
"name": "@tomtom-org/maps-sdk-plugin-viewport-places",
|
|
3
3
|
"author": "TomTom International B.V.",
|
|
4
4
|
"license": "See in LICENSE.txt",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "Plugin to leverage search to show places on the current viewport that refresh as the map moves",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@tomtom-org/maps-sdk": "0.
|
|
10
|
+
"@tomtom-org/maps-sdk": ">=0.56.0 <1.0.0"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@microsoft/api-extractor": "7.56.3",
|
|
14
13
|
"@tsconfig/recommended": "^1.0.13",
|
|
15
|
-
"@types/node": "^
|
|
14
|
+
"@types/node": "^26.3.0",
|
|
15
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
16
|
+
"rolldown": "^1.2.5",
|
|
16
17
|
"ts-node": "^10.9.2",
|
|
17
|
-
"typescript": "^6.0.
|
|
18
|
-
"vite": "^8.
|
|
19
|
-
"
|
|
18
|
+
"typescript": "^6.0.3",
|
|
19
|
+
"vite": "^8.2.2",
|
|
20
|
+
"vitest": "^4.1.11",
|
|
21
|
+
"@tomtom-org/maps-sdk": "0.56.0"
|
|
20
22
|
},
|
|
21
23
|
"files": [
|
|
22
24
|
"dist",
|
|
23
25
|
"package.json",
|
|
24
26
|
"README.md",
|
|
25
|
-
"LICENSE.txt"
|
|
27
|
+
"LICENSE.txt",
|
|
28
|
+
"THIRD_PARTY.txt"
|
|
26
29
|
],
|
|
27
30
|
"exports": {
|
|
28
31
|
".": {
|
|
@@ -33,6 +36,8 @@
|
|
|
33
36
|
"scripts": {
|
|
34
37
|
"build": "vite build --config ../plugin-vite-config.ts",
|
|
35
38
|
"build:watch": "vite build --watch --config ../plugin-vite-config.ts",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:coverage": "vitest run --coverage",
|
|
36
41
|
"type-check": "tsc --noEmit"
|
|
37
42
|
}
|
|
38
43
|
}
|