Places: Expand GPS coordinates if they represent a point or line #3953

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-09-13 18:07:40 +02:00
parent 32be16f254
commit e808de45e3

View File

@@ -390,6 +390,7 @@ export default {
this.getClusterFeatures(clusterId, -1, (clusterFeatures) => { this.getClusterFeatures(clusterId, -1, (clusterFeatures) => {
let latNorth, lngEast, latSouth, lngWest; let latNorth, lngEast, latSouth, lngWest;
for (const feature of clusterFeatures) { for (const feature of clusterFeatures) {
const [lng, lat] = feature.geometry.coordinates; const [lng, lat] = feature.geometry.coordinates;
if (latNorth === undefined || lat > latNorth) { if (latNorth === undefined || lat > latNorth) {
@@ -406,6 +407,18 @@ export default {
} }
} }
// Expand the GPS coordinates if they represent a point or line:
// https://github.com/photoprism/photoprism/issues/3953
if (latNorth === latSouth) {
latNorth = latNorth + 0.0003;
latSouth = latSouth - 0.0003;
}
if (lngEast === lngWest) {
lngEast = lngEast + 0.0003;
lngWest = lngWest - 0.0003;
}
this.selectClusterByCoords(latNorth, lngEast, latSouth, lngWest); this.selectClusterByCoords(latNorth, lngEast, latSouth, lngWest);
}); });
}, },