This commit is contained in:
Jake Kasper
2025-08-23 12:56:13 -04:00
parent 58dc2c83b1
commit 65885dfc87
2 changed files with 9 additions and 22 deletions

View File

@@ -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 && (