Skip to content

Commit b318a72

Browse files
authored
fix: flp and raw location within 1.1m is considered a match (#276)
1 parent 90daba5 commit b318a72

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Map.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ function MapComponent({
482482

483483
const hasRaw = rawLat !== undefined && rawLng !== undefined;
484484
const hasFlp = flpLat !== undefined && flpLng !== undefined;
485-
const isMatch = hasRaw && hasFlp && rawLat === flpLat && rawLng === flpLng;
485+
486+
const to5 = (num) => (num ? num.toFixed(5) : num); // Within 1.1m is considered a match
487+
const isMatch = hasRaw && hasFlp && to5(rawLat) === to5(flpLat) && to5(rawLng) === to5(flpLng);
486488

487489
const updateMarker = (markerRefName, position, color, zIndex, scale = 2) => {
488490
if (!position) {
@@ -523,7 +525,7 @@ function MapComponent({
523525
};
524526

525527
if (isMatch) {
526-
updateMarker("matchLocation", rawLocation, "#C71585", 8, 3);
528+
updateMarker("matchLocation", flpLocation, "#C71585", 8, 3);
527529
updateMarker("rawLocation", null);
528530
updateMarker("flpLocation", null);
529531
} else {

0 commit comments

Comments
 (0)