feat: Add Leaflet map integration and project coordinates handling

- Updated package.json to include dependencies for Leaflet and Playwright testing.
- Added new images for Leaflet markers and layers.
- Created scripts for generating test data with project coordinates.
- Enhanced ProjectViewPage to display project coordinates and integrated ProjectMap component.
- Modified ProjectForm to include coordinates input field.
- Implemented CustomWMTSMap and EnhancedLeafletMap components for improved map functionality.
- Created ProjectMap component to dynamically render project location on the map.
- Added mapLayers configuration for various base layers including Polish Geoportal.
- Implemented WMTS capabilities handling for dynamic layer loading.
- Updated database initialization to include coordinates column in projects table.
- Modified project creation and update functions to handle coordinates.
- Added utility functions for formatting project status and deadlines.
This commit is contained in:
2025-06-18 12:47:04 +02:00
parent c983ba9882
commit 603634e8a4
21 changed files with 8022 additions and 36 deletions

View File

@@ -15,8 +15,8 @@ export default function ProjectForm({ initialData = null }) {
investment_number: "",
finish_date: "",
wp: "",
contact: "",
notes: "",
contact: "", notes: "",
coordinates: "",
project_type: initialData?.project_type || "design",
// project_status is not included in the form for creation or editing
...initialData,
@@ -94,8 +94,7 @@ export default function ProjectForm({ initialData = null }) {
</select>
</div>
{/* Other fields */}
{[
{/* Other fields */} {[
["project_name", "Nazwa projektu"],
["address", "Lokalizacja"],
["plot", "Działka"],
@@ -104,8 +103,8 @@ export default function ProjectForm({ initialData = null }) {
["city", "Miejscowość"],
["investment_number", "Numer inwestycjny"],
["finish_date", "Termin realizacji"],
["wp", "WP"],
["contact", "Dane kontaktowe"],
["wp", "WP"], ["contact", "Dane kontaktowe"],
["coordinates", "Coordinates"],
["notes", "Notatki"],
].map(([name, label]) => (
<div key={name}>
@@ -116,6 +115,7 @@ export default function ProjectForm({ initialData = null }) {
value={form[name] || ""}
onChange={handleChange}
className="border p-2 w-full"
placeholder={name === "coordinates" ? "e.g., 49.622958,20.629562" : ""}
/>
</div>
))}