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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user