@opensystemslab/map 1.0.0-alpha.1 → 1.0.0-alpha.10

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,6 @@
1
+ import type { IWindow } from "happy-dom";
2
+ import "./index";
3
+ declare global {
4
+ interface Window extends IWindow {
5
+ }
6
+ }
@@ -5,7 +5,7 @@ import { Vector as VectorSource } from "ol/source";
5
5
  export type DrawTypeEnum = Extract<Type, "Polygon" | "Point" | "Circle">;
6
6
  export type DrawPointerEnum = "crosshair" | "dot";
7
7
  export declare const drawingSource: VectorSource<import("ol/Feature").default<import("ol/geom").Geometry>>;
8
- export declare function configureDrawingLayer(drawType: DrawTypeEnum, drawColor: string, drawMany: boolean): VectorLayer<VectorSource<import("ol/Feature").default<import("ol/geom").Geometry>>>;
8
+ export declare function configureDrawingLayer(drawType: DrawTypeEnum, drawColor: string, drawMany: boolean, hideDrawLabels: boolean): VectorLayer<VectorSource<import("ol/Feature").default<import("ol/geom").Geometry>>, import("ol/Feature").default<import("ol/geom").Geometry>>;
9
9
  export declare function configureDraw(drawType: DrawTypeEnum, drawPointer: DrawPointerEnum, drawColor: string): Draw;
10
10
  export declare const snap: Snap;
11
11
  export declare function configureModify(drawPointer: DrawPointerEnum, drawColor: string): Modify;
@@ -4,6 +4,7 @@ import { DrawPointerEnum, DrawTypeEnum } from "./drawing";
4
4
  import { BasemapEnum } from "./layers";
5
5
  import { ProjectionEnum } from "./projections";
6
6
  import { AreaUnitEnum } from "./utils";
7
+ import { GeoJSONFeatureCollection } from "ol/format/GeoJSON";
7
8
  type MarkerImageEnum = "circle" | "pin";
8
9
  type ResetControlImageEnum = "unicode" | "trash";
9
10
  export declare class MyMap extends LitElement {
@@ -26,7 +27,7 @@ export declare class MyMap extends LitElement {
26
27
  drawPointColor: string;
27
28
  drawGeojsonData: {
28
29
  type: string;
29
- geometry: {};
30
+ features: never[];
30
31
  };
31
32
  drawGeojsonDataCopyright: string;
32
33
  drawGeojsonDataBuffer: number;
@@ -50,11 +51,9 @@ export declare class MyMap extends LitElement {
50
51
  markerLatitude: number;
51
52
  markerLongitude: number;
52
53
  markerColor: string;
53
- geojsonData: {
54
- type: string;
55
- features: never[];
56
- };
54
+ geojsonData: GeoJSONFeatureCollection;
57
55
  showGeojsonDataMarkers: boolean;
56
+ showGeojsonDataLabels: boolean;
58
57
  geojsonDataCopyright: string;
59
58
  geojsonColor: string;
60
59
  geojsonFill: boolean;
@@ -67,11 +66,11 @@ export declare class MyMap extends LitElement {
67
66
  /**
68
67
  * @deprecated - please set singular `osApiKey`
69
68
  */
70
- osVectorTilesApiKey: any;
69
+ osVectorTilesApiKey: string;
71
70
  /**
72
71
  * @deprecated - please set singular `osApiKey`
73
72
  */
74
- osFeaturesApiKey: any;
73
+ osFeaturesApiKey: string;
75
74
  osCopyright: string;
76
75
  osProxyEndpoint: string;
77
76
  /**
@@ -80,12 +79,14 @@ export declare class MyMap extends LitElement {
80
79
  applySatelliteStyle: boolean;
81
80
  mapboxAccessToken: string;
82
81
  hideResetControl: boolean;
82
+ resetViewOnly: boolean;
83
83
  resetControlImage: ResetControlImageEnum;
84
84
  staticMode: boolean;
85
85
  /**
86
86
  * @deprecated - both `area.squareMetres` & `area.hectares` are calculated by default now in applicable `geojsonChange` events
87
87
  */
88
88
  areaUnit: AreaUnitEnum;
89
+ hideDrawLabels: boolean;
89
90
  showScale: boolean;
90
91
  useScaleBarStyle: boolean;
91
92
  showNorthArrow: boolean;
@@ -3,8 +3,10 @@ import VectorTileLayer from "ol/layer/VectorTile";
3
3
  import { OSM, XYZ } from "ol/source";
4
4
  import VectorLayer from "ol/layer/Vector";
5
5
  import VectorSource from "ol/source/Vector";
6
+ import { Feature } from "ol";
7
+ import { Geometry } from "ol/geom";
6
8
  export type BasemapEnum = "OSM" | "MapboxSatellite" | "OSRaster" | "OSVectorTile";
7
9
  export declare function makeDefaultTileLayer(): TileLayer<OSM>;
8
- export declare function makeMapboxSatelliteBasemap(): VectorLayer<VectorSource>;
10
+ export declare function makeMapboxSatelliteBasemap(): VectorLayer<VectorSource<Feature<Geometry>>, Feature<Geometry>>;
9
11
  export declare function makeOSRasterBasemap(apiKey: string, proxyEndpoint: string, copyright: string): TileLayer<XYZ>;
10
12
  export declare function makeOsVectorTileBasemap(apiKey: string, proxyEndpoint: string, copyright: string): VectorTileLayer;
@@ -1,7 +1,7 @@
1
1
  import { Vector as VectorLayer } from "ol/layer";
2
2
  import { Vector as VectorSource } from "ol/source";
3
3
  export declare const outlineSource: VectorSource<import("ol").Feature<import("ol/geom").Geometry>>;
4
- export declare function makeFeatureLayer(color: string, featureFill: boolean): VectorLayer<VectorSource<import("ol").Feature<import("ol/geom").Geometry>>>;
4
+ export declare function makeFeatureLayer(color: string, featureFill: boolean): VectorLayer<VectorSource<import("ol").Feature<import("ol/geom").Geometry>>, import("ol").Feature<import("ol/geom").Geometry>>;
5
5
  /**
6
6
  * Create an OGC XML filter parameter value which will select the TopographicArea
7
7
  * features containing the coordinates of the provided point
@@ -1,8 +1,10 @@
1
+ import { Feature } from "ol";
2
+ import { Geometry } from "ol/geom";
1
3
  import { Vector as VectorLayer } from "ol/layer";
2
4
  import VectorTileLayer from "ol/layer/VectorTile";
3
5
  import VectorSource from "ol/source/Vector";
4
- export declare const pointsSource: VectorSource<never>;
5
- export declare const pointsLayer: VectorLayer<VectorSource<never>>;
6
+ export declare const pointsSource: VectorSource<Feature<Geometry>>;
7
+ export declare const pointsLayer: VectorLayer<VectorSource<Feature<Geometry>>, Feature<Geometry>>;
6
8
  /**
7
9
  * Extract points that are available to snap to when a VectorTileLayer basemap is displayed
8
10
  * @param basemap - a VectorTileLayer
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { MyMap } from "./components/my-map/index";
2
2
  export { AddressAutocomplete } from "./components/address-autocomplete/index";
3
+ export { GeocodeAutocomplete } from "./components/geocode-autocomplete/index";
3
4
  export { PostcodeSearch } from "./components/postcode-search/index";
@@ -1,4 +1,4 @@
1
- type OSServices = "xyz" | "vectorTile" | "vectorTileStyle" | "places" | "features";
1
+ type OSServices = "xyz" | "vectorTile" | "vectorTileStyle" | "places" | "find" | "features";
2
2
  interface ServiceOptions {
3
3
  service: OSServices;
4
4
  apiKey: string;