asdkjf
This commit is contained in:
@@ -197,8 +197,8 @@ router.get('/', async (req, res, next) => {
|
||||
et.name as type_name, ec.name as category_name,
|
||||
ue.created_at, ue.updated_at
|
||||
FROM user_equipment ue
|
||||
JOIN equipment_types et ON ue.equipment_type_id = et.id
|
||||
JOIN equipment_categories ec ON et.category_id = ec.id
|
||||
LEFT JOIN equipment_types et ON ue.equipment_type_id = et.id
|
||||
LEFT JOIN equipment_categories ec ON COALESCE(et.category_id, ue.category_id) = ec.id
|
||||
WHERE ue.user_id = $1 AND (ec.name = 'Nozzle' OR ec.name ILIKE '%nozzle%' OR ue.orifice_size IS NOT NULL)
|
||||
ORDER BY ue.manufacturer, ue.custom_name`,
|
||||
[req.user.id]
|
||||
|
||||
@@ -365,8 +365,13 @@ const PropertyMap = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
// Your coordinates are already in [lng, lat] format, so we need to swap them for Leaflet
|
||||
const coordinates = polygonData.coordinates[0].map(([lng, lat]) => [lat, lng]);
|
||||
// Check the actual coordinate format in your logs
|
||||
console.log('Raw polygon coordinates:', polygonData.coordinates[0]);
|
||||
const coordinates = polygonData.coordinates[0].map(([first, second]) => {
|
||||
console.log('Coordinate pair:', [first, second]);
|
||||
// Based on your console logs, coordinates appear to be [lng, lat], so swap them
|
||||
return [second, first]; // [lat, lng] for Leaflet
|
||||
});
|
||||
|
||||
const isInternallySelected = selectedSection?.id === section.id;
|
||||
const isExternallySelected = selectedSections.includes(section.id);
|
||||
@@ -390,24 +395,6 @@ const PropertyMap = ({
|
||||
);
|
||||
})}
|
||||
|
||||
{/* Debug: Add a test polygon to see if polygons work at all */}
|
||||
{property?.latitude && property?.longitude && (
|
||||
<Polygon
|
||||
positions={[
|
||||
[property.latitude + 0.001, property.longitude + 0.001],
|
||||
[property.latitude + 0.001, property.longitude - 0.001],
|
||||
[property.latitude - 0.001, property.longitude - 0.001],
|
||||
[property.latitude - 0.001, property.longitude + 0.001]
|
||||
]}
|
||||
pathOptions={{
|
||||
fillColor: 'red',
|
||||
fillOpacity: 0.8,
|
||||
color: 'red',
|
||||
weight: 3,
|
||||
opacity: 1,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Current polygon being drawn */}
|
||||
{currentPolygon.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user