A simple, serverless GeoJSON viewer that runs entirely in your browser.
Layercake is a lightweight web application that allows you to visualize and interact with GeoJSON files directly in your browser without requiring any server-side processing. It's designed to be simple, fast, and privacy-focused - your data never leaves your computer.
We created Layercake to solve common challenges when working with geospatial data:
- Quick Visualization: Instantly view GeoJSON files without installing GIS software
- Easy Comparison: Load multiple layers and compare different datasets
- No Server Required: Works entirely client-side, preserving data privacy
- Accessibility: Available to anyone with a web browser, no technical setup needed
- Load multiple GeoJSON files via file upload or drag-and-drop
- Interactive map with pan and zoom capabilities
- Style customization (colors, point sizes, line widths)
- Layer management with visibility toggles
- Feature information display on click
- Multiple basemap options (OpenStreetMap, Satellite, Dark, Topographic)
- Feature count tracking
- Copy feature properties as JSON
- Responsive design that works on desktop and mobile devices
- Table View: Browse and search feature properties in a tabular format
- Feature Selection: Select features in the table and highlight them on the map
- Import/Export: Import GeoJSON from text, clipboard, or URL; export selected layers
- Large File Handling: Smart handling of large files with sampling options
- Dark/Light Mode: Toggle between dark and light themes
- Layer Editing: Rename layers, adjust styling, and view layer statistics
- Feature Details: Examine individual features with detailed property views
- Copy to New Layer: Create new layers from selected features
- Smart Filtering: Filter features by layer or search across all properties
- Layer Duplication: Create copies of existing layers
- Context Menu: Right-click on features in the table for additional options
The repository includes several example GeoJSON files in the examples directory that you can use to test Layercake:
africa.geojson- Boundary data for the African continentne_10m_reefs.geojson- Global reef locations at 1:10m scalene_50m_populated_places.geojson- Major populated places around the worldne_50m_urban_areas.geojson- Urban area boundaries at 1:50m scale
These files are from public domain sources:
- Africa data from geojson-regions
- Natural Earth data from geojson.xyz
-
Load Data:
- Click "Select file(s)" to upload GeoJSON files
- Or drag and drop GeoJSON files directly onto the map
- Try with the example files in the
examplesdirectory
-
Manage Layers:
- Toggle layer visibility with the checkbox
- Change layer colors with the color picker
- Adjust point sizes and line widths with sliders
- Click layer names to zoom to that layer
- Click the pencil icon to edit layer properties
- Remove individual layers with the × button
- Use the "Reset Map" button to remove all layers
-
Change Basemap:
- Select different map styles from the "Base Map" dropdown
-
View Feature Information:
- Click on any feature to see its properties
- Use the "Copy Properties" button to copy data as JSON
-
Theme Toggle:
- Switch between dark and light modes using the toggle in the top-right corner
-
Browse Features:
- View all features in a tabular format
- Filter by layer using the dropdown
- Search across all properties
- Click on rows to highlight features on the map
- Right-click on rows to access the context menu
-
Select Features:
- Use checkboxes to select individual features
- Use "Select All" or "Select None" buttons
- Click "Map Selected" to highlight selected features on the map
- Click "Copy to New Layer" to create a new layer from selected features
-
Reset Filters:
- Clear all search and layer filters with the "Reset Filters" button
-
Import GeoJSON:
- Paste GeoJSON text directly
- Import from clipboard
- Fetch from a URL
- Upload files via drag and drop
-
Export GeoJSON:
- Select layers to export
- Choose between merged or separate files
- Toggle pretty printing for formatted JSON
- Copy to clipboard or download as files
- Virtualized table for handling large datasets efficiently
- Smart sampling for extremely large files
- Warning dialogs for potentially problematic files
- Optimized rendering for smooth performance
- Memory-efficient handling of large feature collections
Layercake was built using:
- HTML/CSS/JavaScript: Core web technologies for the interface
- Leaflet.js: Open-source JavaScript library for interactive maps
- No build process: Single HTML file with embedded CSS and JavaScript for maximum portability
The application is designed to be lightweight and dependency-free, making it easy to host anywhere or run locally.
Simply open layercake.html in any modern web browser. No installation, server, or internet connection required (except for loading basemaps).
Want to help make Layercake better? Check out our development roadmap and pick something that looks interesting.
No need to be an expert - we welcome contributions from everyone.
This project is licensed under the MIT License - see the LICENSE file for details.