@classic-homes/maps-react 0.2.6 → 0.2.7

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/dist/index.cjs CHANGED
@@ -440,8 +440,10 @@ var Map2 = React26__namespace.forwardRef(
440
440
  attributionControl: attributionControl ? { customAttribution } : false
441
441
  });
442
442
  mapRef.current = map;
443
- map.on("style.load", () => {
444
- setStyleVersion((v) => v + 1);
443
+ map.on("data", (e) => {
444
+ if (e.dataType === "style") {
445
+ setStyleVersion((v) => v + 1);
446
+ }
445
447
  });
446
448
  if (navigationControl) {
447
449
  map.addControl(
package/dist/index.d.cts CHANGED
@@ -108,7 +108,7 @@ interface MapContextValue {
108
108
  map: Map$1 | null;
109
109
  /** Whether the map has loaded */
110
110
  loaded: boolean;
111
- /** Counter incremented on each style.load event, used to re-initialize sources/layers */
111
+ /** Counter incremented on each style change (via data event), used to re-initialize sources/layers */
112
112
  styleVersion: number;
113
113
  /** Set the map style programmatically (e.g. basemap switching) */
114
114
  setMapStyle?: (style: string | StyleSpecification) => void;
package/dist/index.d.ts CHANGED
@@ -108,7 +108,7 @@ interface MapContextValue {
108
108
  map: Map$1 | null;
109
109
  /** Whether the map has loaded */
110
110
  loaded: boolean;
111
- /** Counter incremented on each style.load event, used to re-initialize sources/layers */
111
+ /** Counter incremented on each style change (via data event), used to re-initialize sources/layers */
112
112
  styleVersion: number;
113
113
  /** Set the map style programmatically (e.g. basemap switching) */
114
114
  setMapStyle?: (style: string | StyleSpecification) => void;
package/dist/index.js CHANGED
@@ -416,8 +416,10 @@ var Map2 = React26.forwardRef(
416
416
  attributionControl: attributionControl ? { customAttribution } : false
417
417
  });
418
418
  mapRef.current = map;
419
- map.on("style.load", () => {
420
- setStyleVersion((v) => v + 1);
419
+ map.on("data", (e) => {
420
+ if (e.dataType === "style") {
421
+ setStyleVersion((v) => v + 1);
422
+ }
421
423
  });
422
424
  if (navigationControl) {
423
425
  map.addControl(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/maps-react",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "React MapLibre components for Classic Theme",
5
5
  "keywords": [
6
6
  "maps",