Skip to content

Commit

Permalink
CORE-4887 Icon size
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriibudko committed May 22, 2024
1 parent 60c8d26 commit c6e5326
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modules/map/map.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useRef, useEffect } from 'react'
import L from 'leaflet'
import { MarkerClusterGroup } from 'leaflet.markercluster'

Check failure on line 3 in modules/map/map.jsx

View workflow job for this annotation

GitHub Actions / Code quality

'MarkerClusterGroup' is defined but never used

import { getAssetsPath } from 'utils/helpers'

Expand All @@ -8,7 +9,7 @@ const centerPosition = new L.LatLng(50, 10)

const markerIcon = L.icon({
iconUrl: getAssetsPath('/static/images/map/marker.svg'),
iconSize: [32, 32],
iconSize: [18, 18],
iconAnchor: [16, 32],
popupAnchor: [0, -32],
})
Expand All @@ -35,13 +36,19 @@ const CustomMap = ({ locations }) => {
})
}

// const markersGroup = new MarkerClusterGroup({
// chunkedLoading: true,
// icon: markerIcon,
// })

// Create and add markers
const markers = markersData.map((markerData) => {
const { name, href, latitude, longitude } = markerData
const latLng = new L.LatLng(latitude, longitude)
const marker = L.marker(latLng, {
title: name,
icon: markerIcon,
chunkedLoading: true,
}).addTo(mapRef.current)
if (href) {
marker.bindPopup(
Expand All @@ -55,7 +62,8 @@ const CustomMap = ({ locations }) => {
)
} else marker.bindPopup(name)

// marker.bindPopup(name);
// markersGroup.addLayer(marker)
// return markersGroup
return marker
})

Expand Down

0 comments on commit c6e5326

Please sign in to comment.