fix(map): remove coordinate swap, properly format basePath filter with quoting

Revert coordinate transformation (PhotoPrism already returns correct [lng,lat] format).
Fix basePath filter query string to properly quote paths with special characters
and add wildcard suffix using same quoteIfNeeded logic as filters store.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 21:08:04 +02:00
parent 400b215036
commit 52ab3b6840
2 changed files with 9 additions and 18 deletions

View File

@@ -590,23 +590,6 @@ export async function listGeo(q = ''): Promise<PpGeoCollection> {
params: { count: 50000, q: q || undefined }
});
// PhotoPrism's geo endpoint returns coordinates as [lat, lng] but GeoJSON
// (and MapLibre) expect [lng, lat]. Swap the coordinates in each feature.
if (data.features) {
for (const feature of data.features) {
if (feature.geometry.type === 'Point' && Array.isArray(feature.geometry.coordinates)) {
const [lat, lng] = feature.geometry.coordinates;
feature.geometry.coordinates = [lng, lat];
}
}
}
// Also swap bbox if present: [minLat, minLng, maxLat, maxLng] → [minLng, minLat, maxLng, maxLat]
if (data.bbox && data.bbox.length === 4) {
const [minLat, minLng, maxLat, maxLng] = data.bbox;
data.bbox = [minLng, minLat, maxLng, maxLat];
}
return data;
}