@ruckc/truss-ol 1.0.0 → 1.1.1

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.
@@ -0,0 +1,25 @@
1
+ import { type Snippet } from 'svelte';
2
+ import 'ol/ol.css';
3
+ import type { Basemap, MapMarker, MapSelection } from './types.js';
4
+ type $$ComponentProps = {
5
+ /** [lon, lat] */
6
+ center?: [number, number];
7
+ zoom?: number;
8
+ basemap?: Basemap;
9
+ markers?: MapMarker[];
10
+ /** GeoJSON FeatureCollection/Feature. Optional `properties.kind` picks the intent color. */
11
+ geojson?: object;
12
+ /** Selected marker id. */
13
+ selected?: string;
14
+ height?: number | string;
15
+ /** Fit the view to markers/features on first load. */
16
+ fitOnLoad?: boolean;
17
+ /** Custom popup body for the selected marker. */
18
+ popup?: Snippet<[marker: MapMarker]>;
19
+ /** Extra controls appended to the toolbar. */
20
+ toolbar?: Snippet;
21
+ onselect?: (s: MapSelection | null) => void;
22
+ };
23
+ declare const Map: import("svelte").Component<$$ComponentProps, {}, "selected" | "center" | "zoom">;
24
+ type Map = ReturnType<typeof Map>;
25
+ export default Map;
@@ -0,0 +1,2 @@
1
+ export { default as Map } from './Map.svelte';
2
+ export type { MapMarker, MarkerKind, Basemap, MapSelection } from './types.js';
@@ -0,0 +1,23 @@
1
+ export type MarkerKind = 'neutral' | 'primary' | 'success' | 'warning' | 'danger';
2
+ export type MapMarker = {
3
+ id: string;
4
+ lon: number;
5
+ lat: number;
6
+ label?: string;
7
+ description?: string;
8
+ kind?: MarkerKind;
9
+ };
10
+ /** Basemap: OpenStreetMap tiles, none (themed graticule — works offline), or any XYZ tile source. */
11
+ export type Basemap = 'osm' | 'none' | {
12
+ url: string;
13
+ attribution?: string;
14
+ maxZoom?: number;
15
+ };
16
+ export type MapSelection = {
17
+ type: 'marker';
18
+ marker: MapMarker;
19
+ } | {
20
+ type: 'feature';
21
+ id?: string | number;
22
+ properties: Record<string, unknown>;
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruckc/truss-ol",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "OpenLayers map styled with Truss UI",
5
5
  "type": "module",
6
6
  "license": "MIT",