@classic-homes/maps-react 0.1.3 → 0.1.5

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, LayerManagerProps, MapTheme, MapStyleSpec } from '@classic-homes/maps-core';
3
+ export { BIKE_LANES, BUILTIN_BASEMAPS, BUILTIN_OVERLAY_LAYERS, BaseMapProps, BasemapApiKeys, BasemapCategory, BasemapDefinition, BasemapProvider, BasemapSwitcherProps, BoundsArray, CATEGORY_META, CITY_LIMITS, CircleLayerProps, ClusterExpandOptions, ClusterFeatureProperties, CoordinateDisplayProps, FLOOD_ZONES, FREE_BASEMAPS, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, GradientStop, HeatmapLayerProps, LayerManagerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, LngLat, LoadGeoJSONOptions, LoadGeoJSONResult, MapBounds, MapClickEventParams, MapHoverEventParams, MapMoveEventParams, MapProps, MapViewport, MarkerClickEventParams, MarkerData, MarkerDragEventParams, MarkerProps, OSM_STANDARD, OverlayApiKeys, OverlayLayerCategory, OverlayLayerDefinition, OverlayLayerState, PARKS, PopupProps, SCHOOL_DISTRICTS, SPORTS_FACILITIES, SourceProps, SymbolLayerProps, THEME_DARK, THEME_LIGHT, TRAILS, TRANSIT_ROUTES, ValidationResult, WATERSHEDS, ZONING_DISTRICTS, calculateBounds, calculateCentroid, combineBounds, countFeaturesByType, createHoverExpression, createInitialLayerStates, createSelectionExpression, darkBasicStyle, darkTheme, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, formatArea, formatCoordinates, formatDistance, generateMapDescription, getAvailableBasemaps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getLayerCategories, getLayerStyleForTheme, getLayersByCategory, getSelectionStyle, groupLayersByCategory, isClusterFeature, isValidBounds, lightBasicStyle, lightTheme, loadGeoJSON, resolveBasemapStyle, resolveLayerSourceUrl, searchLayers, setLayerOpacity, toggleLayerVisibility, 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,6 +120,10 @@ 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
128
  declare const MapContext: React.Context<MapContextValue | null>;
125
129
  /**
@@ -332,6 +336,20 @@ 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
+
346
+ interface LayerManagerComponentProps extends LayerManagerProps {
347
+ }
348
+ /**
349
+ * Layer Manager control for overlay GIS layers
350
+ */
351
+ declare const LayerManager: React.FC<LayerManagerComponentProps>;
352
+
335
353
  /**
336
354
  * Props for the DeckOverlay component
337
355
  */
@@ -420,4 +438,4 @@ declare function useReducedMotion(): boolean;
420
438
  */
421
439
  declare function cn(...inputs: ClassValue[]): string;
422
440
 
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 };
441
+ export { BasemapSwitcher, type BasemapSwitcherComponentProps, CircleLayer, type CircleLayerComponentProps, CoordinateDisplay, type CoordinateDisplayComponentProps, DeckOverlay, type DeckOverlayProps, FillExtrusionLayer, type FillExtrusionLayerComponentProps, FillLayer, type FillLayerComponentProps, HeatmapLayer, type HeatmapLayerComponentProps, LayerManager, type LayerManagerComponentProps, 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, LayerManagerProps, MapTheme, MapStyleSpec } from '@classic-homes/maps-core';
3
+ export { BIKE_LANES, BUILTIN_BASEMAPS, BUILTIN_OVERLAY_LAYERS, BaseMapProps, BasemapApiKeys, BasemapCategory, BasemapDefinition, BasemapProvider, BasemapSwitcherProps, BoundsArray, CATEGORY_META, CITY_LIMITS, CircleLayerProps, ClusterExpandOptions, ClusterFeatureProperties, CoordinateDisplayProps, FLOOD_ZONES, FREE_BASEMAPS, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, GradientStop, HeatmapLayerProps, LayerManagerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, LngLat, LoadGeoJSONOptions, LoadGeoJSONResult, MapBounds, MapClickEventParams, MapHoverEventParams, MapMoveEventParams, MapProps, MapViewport, MarkerClickEventParams, MarkerData, MarkerDragEventParams, MarkerProps, OSM_STANDARD, OverlayApiKeys, OverlayLayerCategory, OverlayLayerDefinition, OverlayLayerState, PARKS, PopupProps, SCHOOL_DISTRICTS, SPORTS_FACILITIES, SourceProps, SymbolLayerProps, THEME_DARK, THEME_LIGHT, TRAILS, TRANSIT_ROUTES, ValidationResult, WATERSHEDS, ZONING_DISTRICTS, calculateBounds, calculateCentroid, combineBounds, countFeaturesByType, createHoverExpression, createInitialLayerStates, createSelectionExpression, darkBasicStyle, darkTheme, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, formatArea, formatCoordinates, formatDistance, generateMapDescription, getAvailableBasemaps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getLayerCategories, getLayerStyleForTheme, getLayersByCategory, getSelectionStyle, groupLayersByCategory, isClusterFeature, isValidBounds, lightBasicStyle, lightTheme, loadGeoJSON, resolveBasemapStyle, resolveLayerSourceUrl, searchLayers, setLayerOpacity, toggleLayerVisibility, 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,6 +120,10 @@ 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
128
  declare const MapContext: React.Context<MapContextValue | null>;
125
129
  /**
@@ -332,6 +336,20 @@ 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
+
346
+ interface LayerManagerComponentProps extends LayerManagerProps {
347
+ }
348
+ /**
349
+ * Layer Manager control for overlay GIS layers
350
+ */
351
+ declare const LayerManager: React.FC<LayerManagerComponentProps>;
352
+
335
353
  /**
336
354
  * Props for the DeckOverlay component
337
355
  */
@@ -420,4 +438,4 @@ declare function useReducedMotion(): boolean;
420
438
  */
421
439
  declare function cn(...inputs: ClassValue[]): string;
422
440
 
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 };
441
+ export { BasemapSwitcher, type BasemapSwitcherComponentProps, CircleLayer, type CircleLayerComponentProps, CoordinateDisplay, type CoordinateDisplayComponentProps, DeckOverlay, type DeckOverlayProps, FillExtrusionLayer, type FillExtrusionLayerComponentProps, FillLayer, type FillLayerComponentProps, HeatmapLayer, type HeatmapLayerComponentProps, LayerManager, type LayerManagerComponentProps, 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 };