diff --git a/src/layout/Map/features/geometries/editable/MapEditGeometries.tsx b/src/layout/Map/features/geometries/editable/MapEditGeometries.tsx index ed9cae16fa..e3f56fa878 100644 --- a/src/layout/Map/features/geometries/editable/MapEditGeometries.tsx +++ b/src/layout/Map/features/geometries/editable/MapEditGeometries.tsx @@ -4,7 +4,10 @@ import { EditControl } from 'react-leaflet-draw'; import { geojsonToWKT } from '@terraformer/wkt'; // Import GeoJSON type -import L from 'leaflet'; +import L, { icon } from 'leaflet'; +import Icon from 'leaflet/dist/images/marker-icon.png'; +import RetinaIcon from 'leaflet/dist/images/marker-icon-2x.png'; +import IconShadow from 'leaflet/dist/images/marker-shadow.png'; import { v4 as uuidv4 } from 'uuid'; import type { Feature } from 'geojson'; @@ -16,6 +19,16 @@ import { useMapParsedGeometries } from 'src/layout/Map/features/geometries/fixed import { useDataModelBindingsFor } from 'src/utils/layout/hooks'; import { useItemWhenType } from 'src/utils/layout/useNodeItem'; +export const markerIcon = icon({ + iconUrl: Icon, + iconRetinaUrl: RetinaIcon, + shadowUrl: IconShadow, + iconSize: [25, 41], + iconAnchor: [12, 41], +}); + +L.Marker.prototype.options.icon = markerIcon; + interface FeatureWithId extends Feature { properties: { altinnRowId?: string; diff --git a/yarn.lock b/yarn.lock index 3ca621cd5b..f0df98c607 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16458,7 +16458,6 @@ __metadata: resolution: "systeminformation@npm:5.25.11" bin: systeminformation: lib/cli.js - checksum: 10c0/c4d3ed2836dec306d017df66dded9bc0fea40bd5a277e29e9800f6272992cb084e08b8d2a9159ffdc823e75338c2dc9202b697d86504098fb063c1d8830d34d7 conditions: (os=darwin | os=linux | os=win32 | os=freebsd | os=openbsd | os=netbsd | os=sunos | os=android) languageName: node linkType: hard