did something with markers

This commit is contained in:
PxlLoewe
2025-04-25 17:37:34 -07:00
parent ef93275d9c
commit 19f036d0c3
11 changed files with 57 additions and 8 deletions

View File

@@ -58,6 +58,7 @@ export const calculateAnchor = (
y: rect.top + rect.height / 2,
};
});
const ownMarkerBounds = (ownMarker as HTMLElement).getBoundingClientRect();
const ownMarkerPosition = {
x: ownMarkerBounds.left + ownMarkerBounds.width / 2,
@@ -75,6 +76,12 @@ export const calculateAnchor = (
centerOfOverlappingMarkers.x /= markersPosition.length;
centerOfOverlappingMarkers.y /= markersPosition.length;
if (id == "2") {
console.log("markersInCluser", marksersInCluster);
console.log("ownMarkerPosition", ownMarkerPosition);
console.log("centerOfOverlappingMarkers", centerOfOverlappingMarkers);
}
if (marksersInCluster.length > 1) {
if (centerOfOverlappingMarkers.y < ownMarkerPosition.y) {
if (centerOfOverlappingMarkers.x > ownMarkerPosition.x) {