@mapslibvn/react 0.4.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 +21 -0
- package/README.md +37 -0
- package/THIRD_PARTY_NOTICES.md +393 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +149 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Đỗ Tiến Phong (MapsLibVN)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @mapslibvn/react
|
|
2
|
+
|
|
3
|
+
React bindings cho MapsLibVN: `<MapsLibVNMap>`, `<Marker>`, `useMap()` và `usePlaces()`.
|
|
4
|
+
|
|
5
|
+
## Cài đặt
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @mapslibvn/react maplibre-gl@^6.4.1 react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Yêu cầu React 18+ và trình duyệt hỗ trợ WebGL2. Nạp CSS của MapLibre một lần ở điểm vào ứng dụng.
|
|
12
|
+
|
|
13
|
+
## Ví dụ
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { MapsLibVNMap, Marker } from '@mapslibvn/react';
|
|
17
|
+
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
18
|
+
|
|
19
|
+
export function BanDo() {
|
|
20
|
+
return (
|
|
21
|
+
<MapsLibVNMap
|
|
22
|
+
apiKey="mlv_live_…"
|
|
23
|
+
apiBase="https://api.ai-solutions.io.vn"
|
|
24
|
+
containerStyle={{ height: 400 }}
|
|
25
|
+
>
|
|
26
|
+
<Marker lng={106.6981} lat={10.7725} />
|
|
27
|
+
</MapsLibVNMap>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Phần tử cha phải có chiều cao thật. Không tắt hoặc che attribution; khóa Web phải giới hạn đúng
|
|
33
|
+
origin.
|
|
34
|
+
|
|
35
|
+
Tài liệu: <https://mapslibvn-docs.pages.dev/react/>
|
|
36
|
+
|
|
37
|
+
Giấy phép mã nguồn: MIT; xem `THIRD_PARTY_NOTICES.md` cho giấy phép phụ thuộc và dữ liệu.
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
# Thông báo bên thứ ba — MapsLibVN SDK
|
|
2
|
+
|
|
3
|
+
Tài liệu này đi kèm các gói `@mapslibvn/core`, `@mapslibvn/web`, `@mapslibvn/react`,
|
|
4
|
+
`@mapslibvn/react-native` (giấy phép MIT, xem `LICENSE`). Phần mã máy chủ của MapsLibVN
|
|
5
|
+
(`apps/*`, `pipelines/*`, `infra/*`, `db/*`) không được phân phối và không nằm trong phạm vi
|
|
6
|
+
tài liệu này.
|
|
7
|
+
|
|
8
|
+
MapsLibVN **không liên kết với, không được tài trợ hay chứng thực bởi** MapLibre. "MapLibre" là
|
|
9
|
+
nhãn hiệu của bên thứ ba; tên đó xuất hiện ở đây và trong tài liệu chỉ để mô tả nguồn gốc kỹ
|
|
10
|
+
thuật của thư viện mà MapsLibVN sử dụng.
|
|
11
|
+
|
|
12
|
+
Cập nhật: 04/09/2026.
|
|
13
|
+
|
|
14
|
+
## 1. Thư viện được đóng gói hoặc là peer dependency của SDK
|
|
15
|
+
|
|
16
|
+
| Thành phần | Phiên bản đã kiểm | Giấy phép | Vai trò |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| maplibre-gl | 6.8.0 (peer, các gói web) | BSD-3-Clause | bộ vẽ bản đồ |
|
|
19
|
+
| pmtiles | 4.5.0 (dependency) | BSD-3-Clause | đọc tiles PMTiles qua HTTP Range |
|
|
20
|
+
| react, react-dom | 18.3.1 (peer, chỉ `@mapslibvn/react`) | MIT | |
|
|
21
|
+
| @maplibre/maplibre-react-native | 11.3.8 (peer, chỉ `@mapslibvn/react-native`) | MIT | bộ vẽ bản đồ native iOS/Android |
|
|
22
|
+
| react, react-native | react ≥ 19.1, react-native ≥ 0.80 (peer, chỉ `@mapslibvn/react-native`) | MIT | |
|
|
23
|
+
|
|
24
|
+
Nguyên văn giấy phép ở mục 4.
|
|
25
|
+
|
|
26
|
+
## 2. Style, phông, icon mà API phục vụ tới client
|
|
27
|
+
|
|
28
|
+
Worker trả style MapLibre tại `/v1/styles/*.json`, phông dạng glyph PBF và sprite icon.
|
|
29
|
+
Các thành phần này dẫn xuất từ:
|
|
30
|
+
|
|
31
|
+
| Thành phần | Nguồn | Giấy phép |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| Style sáng (`light`) | osm-liberty (maputnik) | mã BSD-3-Clause, thiết kế CC-BY 3.0 / CC-BY 4.0 (OpenMapTiles) |
|
|
34
|
+
| Style tối (`dark`) | dark-matter-gl-style (OpenMapTiles, dẫn xuất CartoDB Basemaps) | mã BSD-3-Clause, thiết kế CC-BY 4.0 |
|
|
35
|
+
| Lược đồ lớp tiles | OpenMapTiles | BSD-3-Clause (mã) + CC-BY 4.0 (thiết kế) |
|
|
36
|
+
| Phông Noto Sans (Regular, Bold, Italic) | openmaptiles/fonts v2.0 | SIL Open Font License 1.1 |
|
|
37
|
+
| Sprite icon | Maki (qua sprite osm-liberty) | CC0 1.0 Universal |
|
|
38
|
+
|
|
39
|
+
Cả osm-liberty và dark-matter **yêu cầu ghi nguồn OpenMapTiles hiển thị được trên bản đồ**;
|
|
40
|
+
MapsLibVN đáp ứng bằng chuỗi attribution bắt buộc ở mục 3. Nguyên văn hai giấy phép ở mục 4.
|
|
41
|
+
|
|
42
|
+
## 3. Dữ liệu bản đồ và nghĩa vụ ghi nguồn (spec 12.3)
|
|
43
|
+
|
|
44
|
+
| Nguồn | Giấy phép | Ghi nguồn bắt buộc |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| OpenStreetMap contributors | ODbL 1.0 | `© OpenStreetMap contributors` — https://www.openstreetmap.org/copyright |
|
|
47
|
+
| OpenMapTiles | BSD-3-Clause + CC-BY 4.0 | `© OpenMapTiles` — https://openmaptiles.org/ |
|
|
48
|
+
| Overture Maps Foundation (Places) | CDLA-Permissive 2.0 | `Places: Overture Maps Foundation` |
|
|
49
|
+
| Foursquare OS Places | Apache-2.0 | `Foursquare OS Places` |
|
|
50
|
+
|
|
51
|
+
Chuỗi đầy đủ do API trả tại `GET /v1/attribution`:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
© MapsLibVN · © OpenStreetMap contributors (ODbL) · © OpenMapTiles · Places: Overture Maps Foundation (CDLA-Permissive 2.0), Foursquare OS Places (Apache-2.0)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
SDK luôn hiển thị chuỗi này và **không có tuỳ chọn tắt**.
|
|
58
|
+
|
|
59
|
+
Dữ liệu OSM và các bảng dẫn xuất thuần OSM là Derivative Database theo ODbL; bản xuất có sẵn
|
|
60
|
+
qua `pnpm export:odbl`. Bản đồ và kết quả API là Produced Work: chỉ cần ghi nguồn.
|
|
61
|
+
|
|
62
|
+
## 4. Nguyên văn giấy phép
|
|
63
|
+
|
|
64
|
+
### 4.1 maplibre-gl — BSD-3-Clause
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Copyright (c) 2023, MapLibre contributors
|
|
68
|
+
|
|
69
|
+
All rights reserved.
|
|
70
|
+
|
|
71
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
72
|
+
are permitted provided that the following conditions are met:
|
|
73
|
+
|
|
74
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
75
|
+
this list of conditions and the following disclaimer.
|
|
76
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
77
|
+
this list of conditions and the following disclaimer in the documentation
|
|
78
|
+
and/or other materials provided with the distribution.
|
|
79
|
+
* Neither the name of MapLibre GL JS nor the names of its contributors
|
|
80
|
+
may be used to endorse or promote products derived from this software
|
|
81
|
+
without specific prior written permission.
|
|
82
|
+
|
|
83
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
84
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
85
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
86
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
87
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
88
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
89
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
90
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
91
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
92
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
93
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
-------------------------------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
Contains code from mapbox-gl-js v1.13 and earlier
|
|
99
|
+
|
|
100
|
+
Version v1.13 of mapbox-gl-js and earlier are licensed under a BSD-3-Clause license
|
|
101
|
+
|
|
102
|
+
Copyright (c) 2020, Mapbox
|
|
103
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
104
|
+
are permitted provided that the following conditions are met:
|
|
105
|
+
|
|
106
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
107
|
+
this list of conditions and the following disclaimer.
|
|
108
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
109
|
+
this list of conditions and the following disclaimer in the documentation
|
|
110
|
+
and/or other materials provided with the distribution.
|
|
111
|
+
* Neither the name of Mapbox GL JS nor the names of its contributors
|
|
112
|
+
may be used to endorse or promote products derived from this software
|
|
113
|
+
without specific prior written permission.
|
|
114
|
+
|
|
115
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
116
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
117
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
118
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
119
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
120
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
121
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
122
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
123
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
124
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
125
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
-------------------------------------------------------------------------------
|
|
129
|
+
|
|
130
|
+
Contains code from glfx.js
|
|
131
|
+
|
|
132
|
+
Copyright (C) 2011 by Evan Wallace
|
|
133
|
+
|
|
134
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
135
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
136
|
+
in the Software without restriction, including without limitation the rights
|
|
137
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
138
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
139
|
+
furnished to do so, subject to the following conditions:
|
|
140
|
+
|
|
141
|
+
The above copyright notice and this permission notice shall be included in
|
|
142
|
+
all copies or substantial portions of the Software.
|
|
143
|
+
|
|
144
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
145
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
146
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
147
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
148
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
149
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
150
|
+
THE SOFTWARE.
|
|
151
|
+
|
|
152
|
+
--------------------------------------------------------------------------------
|
|
153
|
+
|
|
154
|
+
Contains a portion of d3-color https://github.com/d3/d3-color
|
|
155
|
+
|
|
156
|
+
Copyright 2010-2016 Mike Bostock
|
|
157
|
+
All rights reserved.
|
|
158
|
+
|
|
159
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
160
|
+
are permitted provided that the following conditions are met:
|
|
161
|
+
|
|
162
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
163
|
+
list of conditions and the following disclaimer.
|
|
164
|
+
|
|
165
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
166
|
+
this list of conditions and the following disclaimer in the documentation
|
|
167
|
+
and/or other materials provided with the distribution.
|
|
168
|
+
|
|
169
|
+
* Neither the name of the author nor the names of contributors may be used to
|
|
170
|
+
endorse or promote products derived from this software without specific prior
|
|
171
|
+
written permission.
|
|
172
|
+
|
|
173
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
174
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
175
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
176
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
177
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
178
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
179
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
180
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
181
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
182
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 4.2 pmtiles — BSD-3-Clause
|
|
186
|
+
|
|
187
|
+
Gói npm `pmtiles` không kèm file giấy phép; nguyên văn dưới đây lấy từ repo gốc
|
|
188
|
+
https://github.com/protomaps/PMTiles (`LICENSE`).
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
The below license (BSD-3) applies to the reference implementations in this repository.
|
|
192
|
+
|
|
193
|
+
The PMTiles specification itself is public domain, or CC0 where applicable.
|
|
194
|
+
|
|
195
|
+
Sample tilesets available in this repository are subject to their own license terms.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
Copyright 2021 Protomaps LLC
|
|
200
|
+
|
|
201
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
202
|
+
|
|
203
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
204
|
+
|
|
205
|
+
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.
|
|
206
|
+
|
|
207
|
+
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.
|
|
208
|
+
|
|
209
|
+
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.
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 4.3 react, react-dom — MIT
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
MIT License
|
|
216
|
+
|
|
217
|
+
Copyright (c) Facebook, Inc. and its affiliates.
|
|
218
|
+
|
|
219
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
220
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
221
|
+
in the Software without restriction, including without limitation the rights
|
|
222
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
223
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
224
|
+
furnished to do so, subject to the following conditions:
|
|
225
|
+
|
|
226
|
+
The above copyright notice and this permission notice shall be included in all
|
|
227
|
+
copies or substantial portions of the Software.
|
|
228
|
+
|
|
229
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
230
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
231
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
232
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
233
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
234
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
235
|
+
SOFTWARE.
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### 4.4 osm-liberty (style sáng) — BSD-3-Clause + CC-BY
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
## Code License
|
|
242
|
+
|
|
243
|
+
The Mapbox GL Style JSON file is originally derived from [OSM Bright from Mapbox Open Styles](https://github.com/mapbox/mapbox-gl-styles/blob/master/LICENSE.md). The modified Mapbox GL Style JSON retains the same BSD license.
|
|
244
|
+
|
|
245
|
+
> Redistribution and use in source and binary forms, with or without modification,
|
|
246
|
+
are permitted provided that the following conditions are met:
|
|
247
|
+
|
|
248
|
+
> * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
249
|
+
* 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.
|
|
250
|
+
* Neither the name of Mapbox nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
251
|
+
|
|
252
|
+
> 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 OWNER 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.
|
|
253
|
+
|
|
254
|
+
## Design License
|
|
255
|
+
|
|
256
|
+
The look and feel of the OSM liberty map design is also derived (although heavily altered) from [OSM Bright from Mapbox Open Styles](https://github.com/mapbox/mapbox-gl-styles/blob/master/LICENSE.md) which is licensed under the Creative Commons Attribution 3.0 license.
|
|
257
|
+
|
|
258
|
+
The map is displaying and styling the data from [OpenMapTiles](https://openmaptiles.org/) with [CC-BY 4.0 design license](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md).
|
|
259
|
+
|
|
260
|
+
The products or services using this map style need to visibly credit "OpenMapTiles.org" or reference "OpenMapTiles" with a link to http://openmaptiles.org/. For a browsable electronic map based on OpenMapTiles and OpenStreetMap data, the credit should appear in the corner of the map. For example:
|
|
261
|
+
|
|
262
|
+
[© OpenMapTiles](https://openmaptiles.org/)
|
|
263
|
+
[© OpenStreetMap contributors](https://www.openstreetmap.org/copyright)
|
|
264
|
+
|
|
265
|
+
For printed and static maps a similar attribution should be made in a textual description near the image, in the same fashion as if you cite a photograph.
|
|
266
|
+
|
|
267
|
+
## Icons
|
|
268
|
+
|
|
269
|
+
OSM Liberty is using the [Maki POI icon set](https://github.com/mapbox/maki/blob/master/LICENSE.txt) which is licensed under CC0 1.0 Universal.
|
|
270
|
+
|
|
271
|
+
The right arrow was derived from [Wikipedia][wiki_arrow] which is in the public domain.
|
|
272
|
+
|
|
273
|
+
[wiki_arrow]: https://commons.wikimedia.org/wiki/File:Arrowright.svg
|
|
274
|
+
|
|
275
|
+
## Fonts
|
|
276
|
+
|
|
277
|
+
OSM Liberty is using the Roboto font family (Copyright 2011 Google).
|
|
278
|
+
Roboto is licensed under the [Apache License, Version 2.0](https://github.com/google/roboto/blob/master/LICENSE).
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### 4.5 dark-matter-gl-style (style tối) — BSD-3-Clause + CC-BY 4.0
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
Copyright (c) 2024, MapTiler.com & OpenMapTiles contributors.
|
|
285
|
+
Copyright (c) 2015, CartoDB Inc.
|
|
286
|
+
All rights reserved.
|
|
287
|
+
|
|
288
|
+
Derived from "CartoDB Basemaps" (https://github.com/CartoDB/CartoDB-basemaps)
|
|
289
|
+
designed by Stamen and Paul Norman for CartoDB Inc., licensed under CC-BY 3.0.
|
|
290
|
+
|
|
291
|
+
# Code license: BSD 3-Clause License
|
|
292
|
+
|
|
293
|
+
Redistribution and use in source and binary forms, with or without
|
|
294
|
+
modification, are permitted provided that the following conditions are met:
|
|
295
|
+
|
|
296
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
297
|
+
list of conditions and the following disclaimer.
|
|
298
|
+
|
|
299
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
300
|
+
this list of conditions and the following disclaimer in the documentation
|
|
301
|
+
and/or other materials provided with the distribution.
|
|
302
|
+
|
|
303
|
+
* Neither the name of the copyright holder nor the names of its
|
|
304
|
+
contributors may be used to endorse or promote products derived from
|
|
305
|
+
this software without specific prior written permission.
|
|
306
|
+
|
|
307
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
308
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
309
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
310
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
311
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
312
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
313
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
314
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
315
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
316
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
317
|
+
|
|
318
|
+
# Design license: CC-BY 4.0
|
|
319
|
+
|
|
320
|
+
The visual design features of the style (also known as the "look and feel" of
|
|
321
|
+
the map) are licensed under the Creative Commons Attribution 4.0 license.
|
|
322
|
+
|
|
323
|
+
To view a copy of the license, visit https://creativecommons.org/licenses/by/4.0/.
|
|
324
|
+
|
|
325
|
+
Attribution for the design defined in this repository needs not to be provided
|
|
326
|
+
on map images, but should be reasonably accessible from maps based on this style
|
|
327
|
+
(for example, in a webpage linked from copyright notice on the map).
|
|
328
|
+
|
|
329
|
+
Products or services using maps derived from OpenMapTiles schema need to visibly
|
|
330
|
+
credit "OpenMapTiles.org" or reference "OpenMapTiles" with a link to
|
|
331
|
+
https://openmaptiles.org/.
|
|
332
|
+
|
|
333
|
+
For a browsable electronic map based on OpenMapTiles and OpenStreetMap data, the
|
|
334
|
+
credit should appear in the corner of the map. For example:
|
|
335
|
+
|
|
336
|
+
[© OpenMapTiles](https://openmaptiles.org/)
|
|
337
|
+
[© OpenStreetMap contributors](https://www.openstreetmap.org/copyright)
|
|
338
|
+
|
|
339
|
+
For printed and static maps a similar attribution should be made in a textual
|
|
340
|
+
description near the image, in the same fashion as if you cite a photograph.
|
|
341
|
+
|
|
342
|
+
Exceptions to OpenMapTiles attribution requirement can be in a written form granted
|
|
343
|
+
by MapTiler AG (info@maptiler.com).
|
|
344
|
+
The project contributors grant MapTiler AG the license to give such
|
|
345
|
+
exceptions on a commercial basis.
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### 4.6 Noto Sans — SIL Open Font License 1.1
|
|
349
|
+
|
|
350
|
+
Phông Noto Sans (Copyright Google Inc.) được dùng dưới SIL Open Font License 1.1.
|
|
351
|
+
Nguyên văn: https://openfontlicense.org/open-font-license-official-text/
|
|
352
|
+
|
|
353
|
+
Điều kiện chính: được dùng, nhúng, sửa và phân phối lại kèm phần mềm, kể cả thương mại;
|
|
354
|
+
**không được bán riêng lẻ** bản thân phông; bản sửa đổi không được dùng tên "Noto" trừ khi
|
|
355
|
+
được phép; giấy phép và thông báo bản quyền phải đi kèm mọi bản phân phối.
|
|
356
|
+
|
|
357
|
+
### 4.7 Maki — CC0 1.0 Universal
|
|
358
|
+
|
|
359
|
+
Icon Maki (Mapbox) ở phạm vi công cộng theo CC0 1.0 Universal:
|
|
360
|
+
https://creativecommons.org/publicdomain/zero/1.0/ — không yêu cầu ghi nguồn.
|
|
361
|
+
|
|
362
|
+
### 4.8 @maplibre/maplibre-react-native — MIT
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
Copyright (c) 2022 MapLibre contributors
|
|
366
|
+
|
|
367
|
+
Copyright (c) 2015-2020 Mapbox
|
|
368
|
+
|
|
369
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
370
|
+
and associated documentation files (the "Software"), to deal in the Software without
|
|
371
|
+
restriction, including without limitation the rights to use, copy, modify, merge, publish,
|
|
372
|
+
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
|
|
373
|
+
Software is furnished to do so, subject to the following conditions:
|
|
374
|
+
|
|
375
|
+
The above copyright notice and this permission notice shall be included in all copies or
|
|
376
|
+
substantial portions of the Software.
|
|
377
|
+
|
|
378
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
379
|
+
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
380
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
381
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
382
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Gói này nhúng MapLibre Native (Android, iOS) khi build app — xem thông báo giấy phép trong
|
|
386
|
+
chính gói đó cho các thành phần native.
|
|
387
|
+
|
|
388
|
+
## 5. Công cụ phía máy chủ (không phân phối, liệt kê để minh bạch)
|
|
389
|
+
|
|
390
|
+
Planetiler (Apache-2.0), tippecanoe (BSD-2-Clause), osmium-tool (GPL-3.0 — dùng như công cụ
|
|
391
|
+
dòng lệnh, không liên kết mã), pyosmium (BSD-2-Clause), DuckDB (MIT), PostgreSQL
|
|
392
|
+
(PostgreSQL License), PostGIS (GPL-2.0 — chạy như dịch vụ), Hono (MIT), cloudflared
|
|
393
|
+
(Apache-2.0), Astro Starlight (MIT), Vitest (MIT), Playwright (Apache-2.0).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import { CreateMapOptions, PoiFeature, MapsLibVNMap as MapsLibVNMap$1, MarkerOptions } from '@mapslibvn/web';
|
|
4
|
+
import { MapsLibVNClient, AutocompleteItem } from '@mapslibvn/core';
|
|
5
|
+
export { AutocompleteItem, MapsLibVNClient, Place, PoiSource } from '@mapslibvn/core';
|
|
6
|
+
|
|
7
|
+
interface MapsLibVNMapProps extends Omit<CreateMapOptions, 'container'> {
|
|
8
|
+
className?: string;
|
|
9
|
+
/** CSS của khung map — khác prop `style` (theme) từ CreateMapOptions. */
|
|
10
|
+
containerStyle?: CSSProperties;
|
|
11
|
+
onPoiClick?: (poi: PoiFeature) => void;
|
|
12
|
+
onLoad?: (map: MapsLibVNMap$1) => void;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare function MapsLibVNMap({ apiKey, apiBase, style: mapStyle, center, zoom, lang, poiLayer, poiSources, compactAttribution, className, containerStyle, onPoiClick, onLoad, children, }: MapsLibVNMapProps): react.JSX.Element;
|
|
16
|
+
/** Map hiện hành — chỉ dùng bên trong <MapsLibVNMap>. */
|
|
17
|
+
declare function useMap(): MapsLibVNMap$1;
|
|
18
|
+
|
|
19
|
+
declare function Marker({ lng, lat, popupHtml, color }: MarkerOptions): null;
|
|
20
|
+
|
|
21
|
+
interface UsePlacesOptions {
|
|
22
|
+
near?: [number, number];
|
|
23
|
+
limit?: number;
|
|
24
|
+
debounceMs?: number;
|
|
25
|
+
/** Client tường minh — bắt buộc khi hook nằm ngoài <MapsLibVNMap>. */
|
|
26
|
+
client?: MapsLibVNClient;
|
|
27
|
+
}
|
|
28
|
+
interface UsePlacesResult {
|
|
29
|
+
items: AutocompleteItem[];
|
|
30
|
+
loading: boolean;
|
|
31
|
+
error: Error | null;
|
|
32
|
+
}
|
|
33
|
+
/** Autocomplete kiểu SWR: giữ items cũ khi tải và bỏ qua response của query đã huỷ. */
|
|
34
|
+
declare function usePlaces(query: string, options?: UsePlacesOptions): UsePlacesResult;
|
|
35
|
+
|
|
36
|
+
export { MapsLibVNMap, type MapsLibVNMapProps, Marker, type UsePlacesOptions, type UsePlacesResult, useMap, usePlaces };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// src/map.tsx
|
|
2
|
+
import {
|
|
3
|
+
createMap
|
|
4
|
+
} from "@mapslibvn/web";
|
|
5
|
+
import * as maplibregl from "maplibre-gl";
|
|
6
|
+
import { useContext, useEffect, useRef, useState } from "react";
|
|
7
|
+
|
|
8
|
+
// src/context.ts
|
|
9
|
+
import { createContext } from "react";
|
|
10
|
+
var MapContext = createContext(null);
|
|
11
|
+
|
|
12
|
+
// src/map.tsx
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function MapsLibVNMap({
|
|
15
|
+
apiKey,
|
|
16
|
+
apiBase,
|
|
17
|
+
style: mapStyle,
|
|
18
|
+
center,
|
|
19
|
+
zoom,
|
|
20
|
+
lang,
|
|
21
|
+
poiLayer,
|
|
22
|
+
poiSources,
|
|
23
|
+
compactAttribution,
|
|
24
|
+
className,
|
|
25
|
+
containerStyle,
|
|
26
|
+
onPoiClick,
|
|
27
|
+
onLoad,
|
|
28
|
+
children
|
|
29
|
+
}) {
|
|
30
|
+
const poiSourcesKey = poiSources?.join(",") ?? "";
|
|
31
|
+
const containerRef = useRef(null);
|
|
32
|
+
const [map, setMap] = useState(null);
|
|
33
|
+
const handlers = useRef({ onPoiClick, onLoad });
|
|
34
|
+
handlers.current = { onPoiClick, onLoad };
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!containerRef.current) return;
|
|
37
|
+
const options = { container: containerRef.current, apiKey, apiBase };
|
|
38
|
+
if (mapStyle !== void 0) options.style = mapStyle;
|
|
39
|
+
if (center !== void 0) options.center = center;
|
|
40
|
+
if (zoom !== void 0) options.zoom = zoom;
|
|
41
|
+
if (lang !== void 0) options.lang = lang;
|
|
42
|
+
if (poiLayer !== void 0) options.poiLayer = poiLayer;
|
|
43
|
+
if (poiSourcesKey) options.poiSources = poiSourcesKey.split(",");
|
|
44
|
+
if (compactAttribution !== void 0) options.compactAttribution = compactAttribution;
|
|
45
|
+
const nextMap = createMap(options, { maplibre: maplibregl });
|
|
46
|
+
nextMap.on("poiClick", (poi) => handlers.current.onPoiClick?.(poi));
|
|
47
|
+
nextMap.on("load", () => handlers.current.onLoad?.(nextMap));
|
|
48
|
+
setMap(nextMap);
|
|
49
|
+
return () => {
|
|
50
|
+
nextMap.remove();
|
|
51
|
+
setMap((current) => current === nextMap ? null : current);
|
|
52
|
+
};
|
|
53
|
+
}, [
|
|
54
|
+
apiKey,
|
|
55
|
+
apiBase,
|
|
56
|
+
mapStyle,
|
|
57
|
+
center?.[0],
|
|
58
|
+
center?.[1],
|
|
59
|
+
zoom,
|
|
60
|
+
lang,
|
|
61
|
+
poiLayer,
|
|
62
|
+
poiSourcesKey,
|
|
63
|
+
compactAttribution
|
|
64
|
+
]);
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className,
|
|
69
|
+
style: {
|
|
70
|
+
width: "100%",
|
|
71
|
+
height: "100%",
|
|
72
|
+
...containerStyle,
|
|
73
|
+
position: containerStyle?.position ?? "relative"
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx("div", { ref: containerRef, style: { position: "absolute", inset: 0 } }),
|
|
77
|
+
map ? /* @__PURE__ */ jsx(MapContext.Provider, { value: map, children }) : null
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function useMap() {
|
|
83
|
+
const map = useContext(MapContext);
|
|
84
|
+
if (!map) throw new Error("useMap ph\u1EA3i \u0111\u01B0\u1EE3c g\u1ECDi b\xEAn trong <MapsLibVNMap>");
|
|
85
|
+
return map;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/marker.tsx
|
|
89
|
+
import { useEffect as useEffect2 } from "react";
|
|
90
|
+
function Marker({ lng, lat, popupHtml, color }) {
|
|
91
|
+
const map = useMap();
|
|
92
|
+
useEffect2(() => {
|
|
93
|
+
const options = { lng, lat };
|
|
94
|
+
if (popupHtml !== void 0) options.popupHtml = popupHtml;
|
|
95
|
+
if (color !== void 0) options.color = color;
|
|
96
|
+
const marker = map.addMarker(options);
|
|
97
|
+
return () => {
|
|
98
|
+
marker.remove();
|
|
99
|
+
};
|
|
100
|
+
}, [map, lng, lat, popupHtml, color]);
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/use-places.ts
|
|
105
|
+
import { useContext as useContext2, useEffect as useEffect3, useState as useState2 } from "react";
|
|
106
|
+
function usePlaces(query, options = {}) {
|
|
107
|
+
const mapClient = useContext2(MapContext)?.places ?? null;
|
|
108
|
+
const client = options.client ?? mapClient;
|
|
109
|
+
const [items, setItems] = useState2([]);
|
|
110
|
+
const [loading, setLoading] = useState2(false);
|
|
111
|
+
const [error, setError] = useState2(null);
|
|
112
|
+
const nearKey = options.near?.join(",") ?? "";
|
|
113
|
+
useEffect3(() => {
|
|
114
|
+
const normalizedQuery = query.trim();
|
|
115
|
+
if (!client || normalizedQuery.length < 2) {
|
|
116
|
+
setItems([]);
|
|
117
|
+
setLoading(false);
|
|
118
|
+
setError(null);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
let cancelled = false;
|
|
122
|
+
setLoading(true);
|
|
123
|
+
setError(null);
|
|
124
|
+
const timer = setTimeout(async () => {
|
|
125
|
+
try {
|
|
126
|
+
const requestOptions = {};
|
|
127
|
+
if (nearKey) requestOptions.near = nearKey.split(",").map(Number);
|
|
128
|
+
if (options.limit !== void 0) requestOptions.limit = options.limit;
|
|
129
|
+
const response = await client.autocomplete(normalizedQuery, requestOptions);
|
|
130
|
+
if (!cancelled) setItems(response.items);
|
|
131
|
+
} catch (cause) {
|
|
132
|
+
if (!cancelled) setError(cause instanceof Error ? cause : new Error("Kh\xF4ng th\u1EC3 t\u1EA3i g\u1EE3i \xFD"));
|
|
133
|
+
} finally {
|
|
134
|
+
if (!cancelled) setLoading(false);
|
|
135
|
+
}
|
|
136
|
+
}, options.debounceMs ?? 200);
|
|
137
|
+
return () => {
|
|
138
|
+
cancelled = true;
|
|
139
|
+
clearTimeout(timer);
|
|
140
|
+
};
|
|
141
|
+
}, [client, query, nearKey, options.limit, options.debounceMs]);
|
|
142
|
+
return { items, loading, error };
|
|
143
|
+
}
|
|
144
|
+
export {
|
|
145
|
+
MapsLibVNMap,
|
|
146
|
+
Marker,
|
|
147
|
+
useMap,
|
|
148
|
+
usePlaces
|
|
149
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mapslibvn/react",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "React bindings MapsLibVN: <MapsLibVNMap>, <Marker>, useMap, usePlaces",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"THIRD_PARTY_NOTICES.md"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"maplibre-gl": "^6.4.1",
|
|
24
|
+
"react": ">=18"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@mapslibvn/core": "0.4.0",
|
|
28
|
+
"@mapslibvn/web": "0.4.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/react": "^18.3.0",
|
|
32
|
+
"maplibre-gl": "^6.8.0",
|
|
33
|
+
"react": "^18.3.0",
|
|
34
|
+
"tsup": "^8.3.0",
|
|
35
|
+
"typescript": "^5.6.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsup src/index.ts --format esm --dts --clean --target es2022 --external react --external maplibre-gl --external pmtiles",
|
|
39
|
+
"typecheck": "tsc --noEmit"
|
|
40
|
+
}
|
|
41
|
+
}
|