@classic-homes/maps-react 0.1.2 → 0.1.4

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.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import { MapProps, SourceProps, MarkerProps, PopupProps, BaseLayerProps, FeatureClickEventParams, FeatureHoverEventParams, FillLayerProps, LineLayerProps, CircleLayerProps, SymbolLayerProps, FillExtrusionLayerProps, HeatmapLayerProps, LegendProps, LegendGroupProps, CoordinateDisplayProps, MapTheme, MapStyleSpec } from '@classic-homes/maps-core';
3
- export { BaseMapProps, BoundsArray, CircleLayerProps, ClusterExpandOptions, ClusterFeatureProperties, CoordinateDisplayProps, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, LngLat, LoadGeoJSONOptions, LoadGeoJSONResult, MapBounds, MapClickEventParams, MapHoverEventParams, MapMoveEventParams, MapProps, MapViewport, MarkerClickEventParams, MarkerData, MarkerDragEventParams, MarkerProps, PopupProps, SourceProps, SymbolLayerProps, THEME_DARK, THEME_LIGHT, ValidationResult, calculateBounds, calculateCentroid, combineBounds, countFeaturesByType, createHoverExpression, createSelectionExpression, darkBasicStyle, darkTheme, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, formatArea, formatCoordinates, formatDistance, generateMapDescription, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getSelectionStyle, isClusterFeature, isValidBounds, lightBasicStyle, lightTheme, loadGeoJSON, validateGeoJSON } from '@classic-homes/maps-core';
4
- import maplibregl, { Map as Map$1 } from 'maplibre-gl';
2
+ import { MapProps, SourceProps, MarkerProps, PopupProps, BaseLayerProps, FeatureClickEventParams, FeatureHoverEventParams, FillLayerProps, LineLayerProps, CircleLayerProps, SymbolLayerProps, FillExtrusionLayerProps, HeatmapLayerProps, LegendProps, LegendGroupProps, CoordinateDisplayProps, BasemapSwitcherProps, MapTheme, MapStyleSpec } from '@classic-homes/maps-core';
3
+ export { BUILTIN_BASEMAPS, BaseMapProps, BasemapApiKeys, BasemapCategory, BasemapDefinition, BasemapProvider, BasemapSwitcherProps, BoundsArray, CircleLayerProps, ClusterExpandOptions, ClusterFeatureProperties, CoordinateDisplayProps, FREE_BASEMAPS, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, LngLat, LoadGeoJSONOptions, LoadGeoJSONResult, MapBounds, MapClickEventParams, MapHoverEventParams, MapMoveEventParams, MapProps, MapViewport, MarkerClickEventParams, MarkerData, MarkerDragEventParams, MarkerProps, OSM_STANDARD, PopupProps, SourceProps, SymbolLayerProps, THEME_DARK, THEME_LIGHT, ValidationResult, calculateBounds, calculateCentroid, combineBounds, countFeaturesByType, createHoverExpression, createSelectionExpression, darkBasicStyle, darkTheme, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, formatArea, formatCoordinates, formatDistance, generateMapDescription, getAvailableBasemaps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getSelectionStyle, isClusterFeature, isValidBounds, lightBasicStyle, lightTheme, loadGeoJSON, resolveBasemapStyle, validateGeoJSON } from '@classic-homes/maps-core';
4
+ import maplibregl, { Map as Map$1, StyleSpecification } from 'maplibre-gl';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
6
6
  import { VariantProps } from 'class-variance-authority';
7
7
  import { ClassValue } from 'clsx';
@@ -120,8 +120,12 @@ interface MapContextValue {
120
120
  unregisterControl?: (id: string, position: string) => void;
121
121
  /** Get the vertical offset for a control */
122
122
  getCustomControlOffset?: (id: string, position: string) => number;
123
+ /** Counter incremented on each style.load event, used to re-initialize sources/layers */
124
+ styleVersion: number;
125
+ /** Set the map style programmatically (e.g. basemap switching) */
126
+ setMapStyle?: (style: string | StyleSpecification) => void;
123
127
  }
124
- declare const MapContext: React.Context<MapContextValue>;
128
+ declare const MapContext: React.Context<MapContextValue | null>;
125
129
  /**
126
130
  * Hook to access the MapLibre map instance from context
127
131
  */
@@ -332,6 +336,13 @@ interface CoordinateDisplayComponentProps extends CoordinateDisplayProps {
332
336
  */
333
337
  declare const CoordinateDisplay: React.FC<CoordinateDisplayComponentProps>;
334
338
 
339
+ interface BasemapSwitcherComponentProps extends BasemapSwitcherProps {
340
+ }
341
+ /**
342
+ * Basemap switcher control with thumbnail grid flyout
343
+ */
344
+ declare const BasemapSwitcher: React.FC<BasemapSwitcherComponentProps>;
345
+
335
346
  /**
336
347
  * Props for the DeckOverlay component
337
348
  */
@@ -420,4 +431,4 @@ declare function useReducedMotion(): boolean;
420
431
  */
421
432
  declare function cn(...inputs: ClassValue[]): string;
422
433
 
423
- export { CircleLayer, type CircleLayerComponentProps, CoordinateDisplay, type CoordinateDisplayComponentProps, DeckOverlay, type DeckOverlayProps, FillExtrusionLayer, type FillExtrusionLayerComponentProps, FillLayer, type FillLayerComponentProps, HeatmapLayer, type HeatmapLayerComponentProps, Legend, type LegendComponentProps, LegendGroup, type LegendGroupComponentProps, LineLayer, type LineLayerComponentProps, Map, type MapComponentProps, MapContainer, type MapContainerProps, MapContext, type MapContextValue, MapEmpty, type MapEmptyProps, MapError, type MapErrorProps, MapSkeleton, type MapSkeletonProps, Marker, type MarkerComponentProps, Popup, PopupCard, type PopupCardProps, type PopupComponentProps, PopupContent, type PopupContentProps, PopupFooter, type PopupFooterProps, PopupHeader, type PopupHeaderProps, type ReactFeatureClickEventParams, type ReactFeatureHoverEventParams, Source, type SourceComponentProps, SymbolLayer, type SymbolLayerComponentProps, type UseLayerOptions, cn, useLayer, useMap, useMapInstance, useMapTheme, useReducedMotion };
434
+ export { BasemapSwitcher, type BasemapSwitcherComponentProps, CircleLayer, type CircleLayerComponentProps, CoordinateDisplay, type CoordinateDisplayComponentProps, DeckOverlay, type DeckOverlayProps, FillExtrusionLayer, type FillExtrusionLayerComponentProps, FillLayer, type FillLayerComponentProps, HeatmapLayer, type HeatmapLayerComponentProps, Legend, type LegendComponentProps, LegendGroup, type LegendGroupComponentProps, LineLayer, type LineLayerComponentProps, Map, type MapComponentProps, MapContainer, type MapContainerProps, MapContext, type MapContextValue, MapEmpty, type MapEmptyProps, MapError, type MapErrorProps, MapSkeleton, type MapSkeletonProps, Marker, type MarkerComponentProps, Popup, PopupCard, type PopupCardProps, type PopupComponentProps, PopupContent, type PopupContentProps, PopupFooter, type PopupFooterProps, PopupHeader, type PopupHeaderProps, type ReactFeatureClickEventParams, type ReactFeatureHoverEventParams, Source, type SourceComponentProps, SymbolLayer, type SymbolLayerComponentProps, type UseLayerOptions, cn, useLayer, useMap, useMapInstance, useMapTheme, useReducedMotion };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import { MapProps, SourceProps, MarkerProps, PopupProps, BaseLayerProps, FeatureClickEventParams, FeatureHoverEventParams, FillLayerProps, LineLayerProps, CircleLayerProps, SymbolLayerProps, FillExtrusionLayerProps, HeatmapLayerProps, LegendProps, LegendGroupProps, CoordinateDisplayProps, MapTheme, MapStyleSpec } from '@classic-homes/maps-core';
3
- export { BaseMapProps, BoundsArray, CircleLayerProps, ClusterExpandOptions, ClusterFeatureProperties, CoordinateDisplayProps, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, LngLat, LoadGeoJSONOptions, LoadGeoJSONResult, MapBounds, MapClickEventParams, MapHoverEventParams, MapMoveEventParams, MapProps, MapViewport, MarkerClickEventParams, MarkerData, MarkerDragEventParams, MarkerProps, PopupProps, SourceProps, SymbolLayerProps, THEME_DARK, THEME_LIGHT, ValidationResult, calculateBounds, calculateCentroid, combineBounds, countFeaturesByType, createHoverExpression, createSelectionExpression, darkBasicStyle, darkTheme, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, formatArea, formatCoordinates, formatDistance, generateMapDescription, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getSelectionStyle, isClusterFeature, isValidBounds, lightBasicStyle, lightTheme, loadGeoJSON, validateGeoJSON } from '@classic-homes/maps-core';
4
- import maplibregl, { Map as Map$1 } from 'maplibre-gl';
2
+ import { MapProps, SourceProps, MarkerProps, PopupProps, BaseLayerProps, FeatureClickEventParams, FeatureHoverEventParams, FillLayerProps, LineLayerProps, CircleLayerProps, SymbolLayerProps, FillExtrusionLayerProps, HeatmapLayerProps, LegendProps, LegendGroupProps, CoordinateDisplayProps, BasemapSwitcherProps, MapTheme, MapStyleSpec } from '@classic-homes/maps-core';
3
+ export { BUILTIN_BASEMAPS, BaseMapProps, BasemapApiKeys, BasemapCategory, BasemapDefinition, BasemapProvider, BasemapSwitcherProps, BoundsArray, CircleLayerProps, ClusterExpandOptions, ClusterFeatureProperties, CoordinateDisplayProps, FREE_BASEMAPS, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, LngLat, LoadGeoJSONOptions, LoadGeoJSONResult, MapBounds, MapClickEventParams, MapHoverEventParams, MapMoveEventParams, MapProps, MapViewport, MarkerClickEventParams, MarkerData, MarkerDragEventParams, MarkerProps, OSM_STANDARD, PopupProps, SourceProps, SymbolLayerProps, THEME_DARK, THEME_LIGHT, ValidationResult, calculateBounds, calculateCentroid, combineBounds, countFeaturesByType, createHoverExpression, createSelectionExpression, darkBasicStyle, darkTheme, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, formatArea, formatCoordinates, formatDistance, generateMapDescription, getAvailableBasemaps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getSelectionStyle, isClusterFeature, isValidBounds, lightBasicStyle, lightTheme, loadGeoJSON, resolveBasemapStyle, validateGeoJSON } from '@classic-homes/maps-core';
4
+ import maplibregl, { Map as Map$1, StyleSpecification } from 'maplibre-gl';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
6
6
  import { VariantProps } from 'class-variance-authority';
7
7
  import { ClassValue } from 'clsx';
@@ -120,8 +120,12 @@ interface MapContextValue {
120
120
  unregisterControl?: (id: string, position: string) => void;
121
121
  /** Get the vertical offset for a control */
122
122
  getCustomControlOffset?: (id: string, position: string) => number;
123
+ /** Counter incremented on each style.load event, used to re-initialize sources/layers */
124
+ styleVersion: number;
125
+ /** Set the map style programmatically (e.g. basemap switching) */
126
+ setMapStyle?: (style: string | StyleSpecification) => void;
123
127
  }
124
- declare const MapContext: React.Context<MapContextValue>;
128
+ declare const MapContext: React.Context<MapContextValue | null>;
125
129
  /**
126
130
  * Hook to access the MapLibre map instance from context
127
131
  */
@@ -332,6 +336,13 @@ interface CoordinateDisplayComponentProps extends CoordinateDisplayProps {
332
336
  */
333
337
  declare const CoordinateDisplay: React.FC<CoordinateDisplayComponentProps>;
334
338
 
339
+ interface BasemapSwitcherComponentProps extends BasemapSwitcherProps {
340
+ }
341
+ /**
342
+ * Basemap switcher control with thumbnail grid flyout
343
+ */
344
+ declare const BasemapSwitcher: React.FC<BasemapSwitcherComponentProps>;
345
+
335
346
  /**
336
347
  * Props for the DeckOverlay component
337
348
  */
@@ -420,4 +431,4 @@ declare function useReducedMotion(): boolean;
420
431
  */
421
432
  declare function cn(...inputs: ClassValue[]): string;
422
433
 
423
- export { CircleLayer, type CircleLayerComponentProps, CoordinateDisplay, type CoordinateDisplayComponentProps, DeckOverlay, type DeckOverlayProps, FillExtrusionLayer, type FillExtrusionLayerComponentProps, FillLayer, type FillLayerComponentProps, HeatmapLayer, type HeatmapLayerComponentProps, Legend, type LegendComponentProps, LegendGroup, type LegendGroupComponentProps, LineLayer, type LineLayerComponentProps, Map, type MapComponentProps, MapContainer, type MapContainerProps, MapContext, type MapContextValue, MapEmpty, type MapEmptyProps, MapError, type MapErrorProps, MapSkeleton, type MapSkeletonProps, Marker, type MarkerComponentProps, Popup, PopupCard, type PopupCardProps, type PopupComponentProps, PopupContent, type PopupContentProps, PopupFooter, type PopupFooterProps, PopupHeader, type PopupHeaderProps, type ReactFeatureClickEventParams, type ReactFeatureHoverEventParams, Source, type SourceComponentProps, SymbolLayer, type SymbolLayerComponentProps, type UseLayerOptions, cn, useLayer, useMap, useMapInstance, useMapTheme, useReducedMotion };
434
+ export { BasemapSwitcher, type BasemapSwitcherComponentProps, CircleLayer, type CircleLayerComponentProps, CoordinateDisplay, type CoordinateDisplayComponentProps, DeckOverlay, type DeckOverlayProps, FillExtrusionLayer, type FillExtrusionLayerComponentProps, FillLayer, type FillLayerComponentProps, HeatmapLayer, type HeatmapLayerComponentProps, Legend, type LegendComponentProps, LegendGroup, type LegendGroupComponentProps, LineLayer, type LineLayerComponentProps, Map, type MapComponentProps, MapContainer, type MapContainerProps, MapContext, type MapContextValue, MapEmpty, type MapEmptyProps, MapError, type MapErrorProps, MapSkeleton, type MapSkeletonProps, Marker, type MarkerComponentProps, Popup, PopupCard, type PopupCardProps, type PopupComponentProps, PopupContent, type PopupContentProps, PopupFooter, type PopupFooterProps, PopupHeader, type PopupHeaderProps, type ReactFeatureClickEventParams, type ReactFeatureHoverEventParams, Source, type SourceComponentProps, SymbolLayer, type SymbolLayerComponentProps, type UseLayerOptions, cn, useLayer, useMap, useMapInstance, useMapTheme, useReducedMotion };