asdkjf
This commit is contained in:
@@ -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