Skip to content

Commit

Permalink
build(deps): bump ol from 9.1.0 to 9.2.4 (#490)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dafydd Llŷr Pearson <[email protected]>
  • Loading branch information
dependabot[bot] and DafyddLlyr authored Dec 4, 2024
1 parent 1c16df1 commit 3648575
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pitsby
types
*.local
*.log
/.vscode
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"govuk-frontend": "^5.7.1",
"jspdf": "^2.5.2",
"lit": "^3.0.1",
"ol": "^9.1.0",
"ol": "^9.2.4",
"ol-ext": "^4.0.21",
"ol-mapbox-style": "^12.3.5",
"postcode": "^5.1.0",
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/components/my-map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { defaults as defaultControls, ScaleLine } from "ol/control";
import { FeatureLike } from "ol/Feature";
import { GeoJSON } from "ol/format";
import { GeoJSONFeature } from "ol/format/GeoJSON";
import { Point } from "ol/geom";
import { Geometry, Point } from "ol/geom";
import { Feature } from "ol/index";
import { defaults as defaultInteractions } from "ol/interaction";
import { Vector as VectorLayer } from "ol/layer";
Expand Down Expand Up @@ -59,6 +59,7 @@ import {
hexToRgba,
makeGeoJSON,
} from "./utils";
import RenderFeature from "ol/render/Feature";

type MarkerImageEnum = "circle" | "pin";
type ResetControlImageEnum = "unicode" | "trash";
Expand Down Expand Up @@ -291,9 +292,9 @@ export class MyMap extends LitElement {
const isUsingOS = Boolean(this.osApiKey || this.osProxyEndpoint);

const basemapLayers: BaseLayer[] = [];
let osVectorTileBasemap: VectorTileLayer | undefined,
let osVectorTileBasemap: VectorTileLayer<RenderFeature> | undefined,
osRasterBasemap: TileLayer<XYZ> | undefined,
mapboxSatelliteBasemap: VectorLayer<VectorSource> | undefined;
mapboxSatelliteBasemap: VectorLayer<Feature<Geometry>> | undefined;

if (this.basemap === "OSVectorTile" && isUsingOS) {
osVectorTileBasemap = makeOsVectorTileBasemap(
Expand Down
7 changes: 5 additions & 2 deletions src/components/my-map/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import VectorTileSource from "ol/source/VectorTile";
import { getServiceURL } from "../../lib/ordnanceSurvey";
import VectorLayer from "ol/layer/Vector";
import VectorSource from "ol/source/Vector";
import { Feature } from "ol";
import { Geometry } from "ol/geom";
import RenderFeature from "ol/render/Feature";

export type BasemapEnum =
| "OSM"
Expand All @@ -26,7 +29,7 @@ export function makeDefaultTileLayer(): TileLayer<OSM> {
return layer;
}

export function makeMapboxSatelliteBasemap(): VectorLayer<VectorSource> {
export function makeMapboxSatelliteBasemap(): VectorLayer<Feature<Geometry>> {
// Layer is empty besides attribution, style is "applied" after instantiating map in index.ts
const layer = new VectorLayer({
source: new VectorSource({
Expand Down Expand Up @@ -64,7 +67,7 @@ export function makeOsVectorTileBasemap(
apiKey: string,
proxyEndpoint: string,
copyright: string,
): VectorTileLayer {
): VectorTileLayer<RenderFeature> {
const vectorTileServiceUrl = getServiceURL({
service: "vectorTile",
apiKey,
Expand Down
6 changes: 4 additions & 2 deletions src/components/my-map/snapping.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Feature } from "ol";
import { Geometry } from "ol/geom";
import Point from "ol/geom/Point";
import { Vector as VectorLayer } from "ol/layer";
import VectorTileLayer from "ol/layer/VectorTile";
import RenderFeature from "ol/render/Feature";
import VectorSource from "ol/source/Vector";
import { Fill, Style } from "ol/style";
import CircleStyle from "ol/style/Circle";
import { splitEvery } from "rambda";

export const pointsSource = new VectorSource({
export const pointsSource = new VectorSource<Feature<Geometry>>({
features: [],
wrapX: false,
});
Expand All @@ -34,7 +36,7 @@ export const pointsLayer = new VectorLayer({
* @returns - a VectorSource populated with points within the extent
*/
export function getSnapPointsFromVectorTiles(
basemap: VectorTileLayer,
basemap: VectorTileLayer<RenderFeature>,
extent: number[],
) {
const points =
Expand Down

0 comments on commit 3648575

Please sign in to comment.