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

@@ -0,0 +1,21 @@
import db from '../src/lib/db.js';
// Create another test project with coordinates in a different location
const project = db.prepare(`
INSERT INTO projects (
contract_id, project_name, project_number, address, city, coordinates,
project_type, project_status
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
`).run(
3, // Using the existing contract
'Test Project in Warsaw',
'2/TEST/2025',
'Warsaw Center, Poland',
'Warsaw',
'52.2297,21.0122', // Warsaw coordinates
'construction',
'in_progress_construction'
);
console.log('Additional test project created!');
console.log('Project ID:', project.lastInsertRowid);