asdfasdf
This commit is contained in:
@@ -339,16 +339,27 @@ const ApplicationExecutionModal = ({ application, propertyDetails, onClose, onCo
|
|||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<h4 className="font-medium mb-2">Application Area & GPS Track</h4>
|
<h4 className="font-medium mb-2">Application Area & GPS Track</h4>
|
||||||
<div className="h-96 border rounded-lg overflow-hidden">
|
<div className="h-96 border rounded-lg overflow-hidden">
|
||||||
<PropertyMap
|
{sections.length > 0 ? (
|
||||||
property={propertyDetails}
|
<PropertyMap
|
||||||
sections={sections}
|
property={propertyDetails}
|
||||||
selectedSections={sections.map(s => s.id) || []}
|
sections={sections}
|
||||||
mode="execution"
|
selectedSections={sections.map(s => s.id) || []}
|
||||||
gpsTrack={gpsTrack}
|
mode="execution"
|
||||||
currentLocation={currentLocation}
|
gpsTrack={gpsTrack}
|
||||||
center={mapCenter}
|
currentLocation={currentLocation}
|
||||||
zoom={mapCenter ? 16 : 15}
|
center={mapCenter}
|
||||||
/>
|
zoom={mapCenter ? 16 : 15}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<div className="h-full w-full flex items-center justify-center bg-gray-100">
|
||||||
|
<div className="text-center">
|
||||||
|
<div className="text-gray-500 mb-2">Loading map...</div>
|
||||||
|
<div className="text-sm text-gray-400">
|
||||||
|
Sections: {sections.length}, Center: {mapCenter ? 'Set' : 'Not set'}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,17 @@ const PropertyMap = ({
|
|||||||
currentLocation = null,
|
currentLocation = null,
|
||||||
showTrackPoints = true
|
showTrackPoints = true
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
// Debug logging
|
||||||
|
console.log('PropertyMap render:', {
|
||||||
|
center,
|
||||||
|
zoom,
|
||||||
|
sections: sections.length,
|
||||||
|
selectedSections,
|
||||||
|
mode,
|
||||||
|
gpsTrack: gpsTrack.length,
|
||||||
|
currentLocation
|
||||||
|
});
|
||||||
const [isDrawing, setIsDrawing] = useState(false);
|
const [isDrawing, setIsDrawing] = useState(false);
|
||||||
const [currentPolygon, setCurrentPolygon] = useState([]);
|
const [currentPolygon, setCurrentPolygon] = useState([]);
|
||||||
const [selectedSection, setSelectedSection] = useState(null);
|
const [selectedSection, setSelectedSection] = useState(null);
|
||||||
@@ -354,10 +365,10 @@ const PropertyMap = ({
|
|||||||
className="h-full w-full rounded-lg"
|
className="h-full w-full rounded-lg"
|
||||||
ref={mapRef}
|
ref={mapRef}
|
||||||
>
|
>
|
||||||
{/* Use satellite imagery for application planning */}
|
{/* Use OpenStreetMap as fallback for better reliability */}
|
||||||
<TileLayer
|
<TileLayer
|
||||||
attribution='Tiles © Esri — Source: Esri, Maxar, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community'
|
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||||
url="https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"
|
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Drawing handler */}
|
{/* Drawing handler */}
|
||||||
|
|||||||
Reference in New Issue
Block a user