@opensystemslab/map 0.3.5 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensystemslab/map",
3
- "version": "0.3.5",
3
+ "version": "0.4.1",
4
4
  "license": "OGL-UK-3.0",
5
5
  "private": false,
6
6
  "repository": {
@@ -18,7 +18,8 @@
18
18
  "scripts": {
19
19
  "dev": "vite",
20
20
  "build": "tsc && vite build && sed 's/src=\".*\"/src=\"map.es.js\"/' index.html > dist/index.html",
21
- "prepublishOnly": "rm -rf dist types && npm run build"
21
+ "prepublishOnly": "rm -rf dist types && npm run build",
22
+ "prepare": "husky install"
22
23
  },
23
24
  "dependencies": {
24
25
  "@turf/union": "^6.5.0",
@@ -30,7 +31,7 @@
30
31
  "devDependencies": {
31
32
  "@types/node": "^16.4.13",
32
33
  "husky": "^7.0.1",
33
- "lint-staged": "^11.1.2",
34
+ "lint-staged": "^12.0.3",
34
35
  "prettier": "^2.3.2",
35
36
  "typescript": "^4.3.5",
36
37
  "vite": "^2.4.4"
@@ -1,8 +1,9 @@
1
1
  import { Draw, Modify, Snap } from "ol/interaction";
2
2
  import { Vector as VectorLayer } from "ol/layer";
3
3
  import { Vector as VectorSource } from "ol/source";
4
+ export declare type DrawPointerEnum = "crosshair" | "dot";
4
5
  export declare const drawingSource: VectorSource<import("ol/geom/Geometry").default>;
5
6
  export declare const drawingLayer: VectorLayer<VectorSource<import("ol/geom/Geometry").default>>;
6
- export declare const draw: Draw;
7
+ export declare function configureDraw(pointerStyle: DrawPointerEnum): Draw;
7
8
  export declare const snap: Snap;
8
- export declare const modify: Modify;
9
+ export declare function configureModify(pointerStyle: DrawPointerEnum): Modify;
package/types/my-map.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from "lit";
2
+ import { DrawPointerEnum } from "./drawing";
2
3
  import { AreaUnitEnum } from "./utils";
3
4
  export declare class MyMap extends LitElement {
4
5
  static styles: import("lit").CSSResultGroup;
@@ -13,6 +14,7 @@ export declare class MyMap extends LitElement {
13
14
  geometry: {};
14
15
  };
15
16
  drawGeojsonDataBuffer: number;
17
+ drawPointer: DrawPointerEnum;
16
18
  showFeaturesAtPoint: boolean;
17
19
  clickFeatures: boolean;
18
20
  featureColor: string;
@@ -28,10 +30,10 @@ export declare class MyMap extends LitElement {
28
30
  disableVectorTiles: boolean;
29
31
  osVectorTilesApiKey: string;
30
32
  osFeaturesApiKey: string;
33
+ osCopyright: string;
31
34
  hideResetControl: boolean;
32
35
  staticMode: boolean;
33
36
  areaUnit: AreaUnitEnum;
34
- ariaLabel: string;
35
37
  showScale: boolean;
36
38
  useScaleBarStyle: boolean;
37
39
  firstUpdated(): void;
@@ -1,5 +1,5 @@
1
1
  import { Tile as TileLayer } from "ol/layer";
2
2
  import VectorTileLayer from "ol/layer/VectorTile";
3
3
  import { XYZ } from "ol/source";
4
- export declare function makeRasterBaseMap(apiKey?: string): TileLayer<XYZ>;
5
- export declare function makeOsVectorTileBaseMap(apiKey: string): VectorTileLayer;
4
+ export declare function makeRasterBaseMap(copyright: string, apiKey?: string): TileLayer<XYZ>;
5
+ export declare function makeOsVectorTileBaseMap(copyright: string, apiKey: string): VectorTileLayer;
@@ -0,0 +1,12 @@
1
+ import { Vector as VectorLayer } from "ol/layer";
2
+ import VectorTileLayer from "ol/layer/VectorTile";
3
+ import VectorSource from "ol/source/Vector";
4
+ export declare const pointsSource: VectorSource<import("ol/geom/Geometry").default>;
5
+ export declare const pointsLayer: VectorLayer<VectorSource<import("ol/geom/Geometry").default>>;
6
+ /**
7
+ * Extract points that are available to snap to when a VectorTileLayer basemap is displayed
8
+ * @param basemap - a VectorTileLayer
9
+ * @param extent - an array of 4 points
10
+ * @returns - a VectorSource populated with points within the extent
11
+ */
12
+ export declare function getSnapPointsFromVectorTiles(basemap: VectorTileLayer, extent: number[]): void;