A comprehensive web-based Geographic Information System (GIS) application for managing and visualizing infrastructure projects. Built with vanilla HTML, CSS, and JavaScript - no backend required!
- OpenStreetMap Integration: Display projects on an interactive Leaflet map
- Custom Markers: Color-coded markers based on project status
- Marker Clustering: Automatic clustering for better performance with many projects
- Add Project on Map: Click directly on map to add new projects with automatic coordinate capture
- Search & Filter: Search projects by name, location, or contractor
- Layer Controls: Toggle project types visibility
- Interactive Popups: Click markers to view project details with edit capabilities
- Temporary Layers: Load GeoJSON/Shapefile layers for quick visualization without database import
- GeoJSON/Shapefile Import: Import spatial data directly into the database
- GeoJSON Export: Export all projects as GeoJSON format
- Data Grid: Comprehensive table view of all projects
- CRUD Operations: Create, Read, Update, and Delete projects
- Dynamic Project Types: Automatically reads project types from imported data (no predefined categories)
- Advanced Filtering: Filter by type, status, date range, location, and contractor
- Sorting: Sort by any column (ascending/descending)
- Pagination: Navigate through large datasets (20 rows per page)
- Import Data: Import from CSV or Excel files with automatic type detection
- Export Data: Export to Excel, CSV, or GeoJSON formats
- Create Reports: Generate detailed project reports
- Rich Text Editor: Write formatted descriptions
- Related Projects: Link multiple projects to a report
- Attachments: Upload and manage images and PDFs (up to 10MB each)
- PDF Export: Export reports to professional PDF documents
- Auto-save: Automatic draft saving every 30 seconds
- Download all files to a folder
- Open
index.htmlin a modern web browser - That's it! The app runs entirely in your browser
webGIS v1/
βββ index.html # Main HTML structure
βββ styles.css # All styling and responsive design
βββ app.js # Main application controller
βββ data-manager.js # Data storage and localStorage operations
βββ map-handler.js # Leaflet map integration
βββ table-handler.js # Database table operations
βββ report-handler.js # Report management
βββ utils.js # Utility functions
βββ README.md # This file
Works on all modern browsers:
- β Chrome/Edge (Recommended)
- β Firefox
- β Safari
- β Opera
Requires JavaScript enabled and supports ES6+.
All data is stored locally in your browser using localStorage:
- Projects: Infrastructure project details
- Reports: Report content, attachments, and metadata
- Persistence: Data persists across browser sessions
- Capacity: Typically 5-10MB (browser dependent)
Use the App Info dialog (Ctrl/Cmd + I) to:
- Backup: Export all data to JSON file
- Restore: Import data from backup file
- Clear: Delete all data (with confirmation)
Three main views accessible via tab navigation:
- Map View: Interactive map with project markers
- Database: Table view with filtering and CRUD operations
- Reports: Report management with PDF export
Ctrl/Cmd + N: New Project (in Database view)Ctrl/Cmd + I: Show App InfoEscape: Close Modal dialogs
Each project contains:
{
id: "unique-uuid",
projectName: "Highway Extension Project",
projectType: "Road", // Can be ANY custom category - not limited to predefined types
location: "Downtown District, City Name",
latitude: -6.2088,
longitude: 106.8456,
status: "Planning|In Progress|Completed|On Hold|Cancelled",
startDate: "2024-01-15",
finishDate: "2025-06-30",
contractor: "ABC Construction Ltd"
}Note: Project types are now fully dynamic - you can use any category name you want! The system automatically:
- Reads types from imported CSV/Excel files
- Suggests existing types when adding new projects (using HTML5 datalist)
- Updates filter dropdowns with all unique types
- Updates map layer controls with all types
Each report contains:
{
id: "unique-uuid",
title: "Monthly Progress Report",
date: "2024-10-28",
author: "John Doe",
description: "Detailed description...",
relatedProjects: ["project-id-1", "project-id-2"],
attachments: [
{
id: "attachment-id",
name: "photo.jpg",
type: "image/jpeg",
data: "base64-encoded-data",
size: 123456
}
],
createdAt: "2024-10-28T10:30:00Z"
}- Base Map: OpenStreetMap tiles
- Marker Colors:
- π’ Green: Completed
- π΅ Blue: In Progress
- π‘ Yellow: Planning
- π΄ Red: On Hold
- β« Gray: Cancelled
- Clustering: Automatically groups nearby markers
- Search: Real-time search with 300ms debounce
- Validation: All fields validated before saving
- Filter Panel: Collapsible filter section
- Multi-select: Hold Ctrl/Cmd for multiple selections
- Export Options: Excel, CSV, or GeoJSON
- Import Support: CSV and Excel (.xlsx, .xls)
- Sidebar Navigation: Browse all reports
- Rich Content: Multi-line descriptions
- Project Links: Associate multiple projects
- File Attachments: Images and PDFs
- PDF Generation: Simple PDF report export
- Leaflet 1.9.4: Interactive maps
- Leaflet.markercluster 1.5.3: Marker clustering
- SheetJS (xlsx) 0.18.5: Excel import/export
- shpjs 4.0.4: Shapefile to GeoJSON conversion
- jsPDF 2.5.1: PDF generation
- Font Awesome 6.4.0: Icons
- Debounced search inputs (300ms)
- Document fragments for large lists
- Event delegation for dynamic elements
- Lazy map initialization
- Marker clustering for performance
- No Server: Everything runs locally in your browser
- No Tracking: No analytics or external tracking
- Privacy: Your data never leaves your device
- XSS Protection: All user input is escaped
- File Size Limits: 10MB per attachment
- Check internet connection (map tiles require online access)
- Ensure browser allows third-party resources
- Check browser console for errors
- Delete old projects or reports
- Remove large attachments
- Export data and clear storage
- Typical storage: 5-10MB depending on browser
- Ensure CSV/Excel has correct column names
- Check data format matches schema
- Validate coordinates (lat: -90 to 90, lng: -180 to 180)
- Ensure dates are in YYYY-MM-DD format
- Import: Simply include any category name in the
projectTypecolumn of your CSV/Excel file - Manual Entry: Type any category name when adding a project - existing types will be suggested
- Autocomplete: The form shows a dropdown of existing types, but you can type new ones
- Filters: Filter dropdowns automatically update with all unique types
- Map Controls: Layer toggles dynamically show all project types
Example Custom Types:
- Aviation, Railway, Healthcare, Renewable Energy
- Maritime, Education, Environmental, Technology
- Or ANY category that fits your projects!
The Temporary Layers feature allows visualization of spatial data without database import:
When to Use:
- Quick data exploration before importing
- Comparing external datasets with your projects
- Loading reference layers (boundaries, contours, etc.)
- Viewing spatial data that doesn't need to be in the database
How to Use:
- Click "Load Temporary Layer" in the Map Data section
- Select a GeoJSON or Shapefile (.shp/.zip)
- Layer appears on map with purple styling
- Layers persist across page refreshes (saved in localStorage)
- Manage layers in the "Temporary Layers" panel:
- Toggle visibility (eye icon)
- Remove individual layers (trash icon)
- Clear all temporary layers
Key Differences:
- Persistent: Saved in localStorage, restored on page refresh
- Separate Storage: Not in the project database
- Not in Tables: Won't appear in database view
- Not in Reports: Excluded from reports and analytics
- View Only: Cannot edit or delete features
- Purple Style: Distinct dashed styling
Edit CSS variables in styles.css:
:root {
--primary: #2563eb;
--success: #10b981;
--warning: #f59e0b;
--danger: #ef4444;
--background: #f9fafb;
--text: #1f2937;
}Edit initial coordinates in map-handler.js:
map = L.map('map').setView([-6.200, 106.816], 11);Edit pagination in table-handler.js:
const rowsPerPage = 20; // Change to your preference- Project Name: 3-100 characters (required)
- Project Type: Any non-empty text up to 50 characters (required) - accepts custom categories!
- Location: 5-200 characters (required)
- Latitude: -90 to 90 (required)
- Longitude: -180 to 180 (required)
- Status: Must be from predefined list (required)
- Start Date: Valid date (required)
- Finish Date: Must be after start date (optional)
- Contractor: 2-100 characters (required)
- Title: 3+ characters (required)
- Date: Valid date (required)
- Author: 2+ characters (required)
- Description: 10+ characters (required)
- Related Projects: Optional
- Attachments: Max 10MB per file
The application works offline after initial load:
- β View existing data
- β Add/edit/delete projects
- β Create reports
- β Export data
- β Map tiles (requires internet)
- β External libraries (cached after first load)
Potential improvements:
- Drawing tools for polygon/line features
- Advanced spatial queries
- Custom map styles
- Multi-user collaboration
- Backend API integration
- Mobile app (PWA)
- Real-time data sync
- Advanced analytics dashboard
This project is provided as-is for educational and commercial use.
Built with:
- Leaflet.js - Interactive maps
- OpenStreetMap - Map tiles
- SheetJS - Excel processing
- jsPDF - PDF generation
- Font Awesome - Icons
For issues or questions:
- Check browser console for errors
- Verify all files are in the same directory
- Ensure using a modern browser
- Clear browser cache and reload
- Start with Map View: Get an overview of all projects
- Use Filters: Narrow down data in database view
- Export Regularly: Backup your data periodically
- Mobile Access: Responsive design works on phones/tablets
- Keyboard Shortcuts: Speed up your workflow
- Monitor Storage: Keep an eye on localStorage usage
To update the application:
- Export your data (backup)
- Replace files with new versions
- Open in browser
- Import your data (restore)
Version: 1.1
Last Updated: October 28, 2025
Status: Production Ready β
Enjoy using WebGIS BY 13wejay! πΊοΈ