@dacostafilipe/react-geoportail 0.1.8 → 0.2.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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # react-geoportail
2
2
 
3
- > **Disclaimer:** This is an **unofficial, community-built** React package. It is not affiliated with, endorsed by, or supported by the [Geoportail Luxembourg](https://www.geoportail.lu) team or the Administration du Cadastre et de la Topographie (ACT). For the official API, see [apiv3.geoportail.lu](https://apiv3.geoportail.lu/proj/1.0/build/apidoc/).
3
+ > **Disclaimer:** This is an **unofficial, community-built** React package. It is not affiliated with, endorsed by, or supported by the [Geoportail Luxembourg](https://www.geoportail.lu) team or the Administration du Cadastre et de la Topographie (ACT). For the official API, see [apiv4.geoportail.lu](https://apiv4.geoportail.lu/proj/1.0/build/apidoc/).
4
4
 
5
- An unofficial React SDK for the [Geoportail Luxembourg v3 API](https://apiv3.geoportail.lu/proj/1.0/build/apidoc/). Provides a map component and hooks for geocoding, all typed with TypeScript.
5
+ An unofficial React SDK for the [Geoportail Luxembourg v4 API](https://apiv4.geoportail.lu/proj/1.0/build/apidoc/). Provides a map component and hooks for geocoding, all typed with TypeScript.
6
6
 
7
7
  ## Features
8
8
 
@@ -26,9 +26,16 @@ npm install @dacostafilipe/react-geoportail
26
26
 
27
27
  No manual `<script>` or `<link>` tags are needed. The package loads the required Geoportail assets directly at runtime:
28
28
 
29
- - `https://apiv3.geoportail.lu/static-ngeo/build/apiv3.css`
30
- - `https://apiv3.geoportail.lu/static-ngeo/build/vendor.js`
31
- - `https://apiv3.geoportail.lu/static-ngeo/build/apiv3.js`
29
+ - `https://apiv4.geoportail.lu/static-ngeo/build/apiv4.css`
30
+ - `https://apiv4.geoportail.lu/static-ngeo/build/ol.js`
31
+ - `https://apiv4.geoportail.lu/static-ngeo/build/proj4.js`
32
+ - `https://apiv4.geoportail.lu/static-ngeo/build/auto-complete.min.js`
33
+ - `https://apiv4.geoportail.lu/static-ngeo/build/apiv4.js`
34
+
35
+ These are the same assets the official `apiv4loader.js` pulls in — that loader
36
+ uses `document.write`, so it cannot be injected at runtime and the package
37
+ loads the assets itself instead (including the LUREF/EPSG:2169 projection
38
+ registration the loader performs).
32
39
 
33
40
  ## Quick start
34
41
 
@@ -214,7 +221,7 @@ search({ num: '1', street: 'rue du Fort Thüngen', zip: '1499', locality: 'Luxem
214
221
 
215
222
  ```ts
216
223
  interface GeocodeResultItem {
217
- latLon: LatLon; // WGS84 { lat, lon }
224
+ latLon: LatLon; // WGS84 { lat, lon }, as returned by the API
218
225
  easting: number; // EPSG:2169
219
226
  northing: number; // EPSG:2169
220
227
  accuracy: number;
@@ -267,9 +274,9 @@ The demo app (`src/demo/main.tsx`) shows all three features together: map with c
267
274
 
268
275
  ## API reference
269
276
 
270
- - [Geoportail Luxembourg API v3 JSDoc](https://apiv3.geoportail.lu/proj/1.0/build/apidoc/)
277
+ - [Geoportail Luxembourg API v4 JSDoc](https://apiv4.geoportail.lu/proj/1.0/build/apidoc/)
271
278
  - [REST API wiki](https://wiki.geoportail.lu/doku.php?id=en:api:rest)
272
- - [Official API examples](https://apiv3.geoportail.lu/proj/1.0/build/apidoc/examples/)
279
+ - [Official API examples](https://apiv4.geoportail.lu/proj/1.0/build/apidoc/examples/)
273
280
 
274
281
  ## License
275
282
 
@@ -20,7 +20,9 @@ export type ReverseGeocodeState = {
20
20
  /**
21
21
  * Hook for reverse geocoding: convert a WGS84 lat/lon to a Luxembourg address.
22
22
  *
23
- * Uses the Geoportail REST reverse geocode endpoint — no API key required.
23
+ * Uses the Geoportail v4 REST reverse geocode endpoint — no API key required.
24
+ * The endpoint accepts either `lat`/`lon` (WGS84) or `easting`/`northing`
25
+ * (LUREF); we send WGS84 so no client-side reprojection is needed.
24
26
  *
25
27
  * @example
26
28
  * const { state, lookup } = useReverseGeocode();