Map Development Prompts
This page documents the prompts used to create the interactive map application.
Initial Status Check
Prompt:
Result: Claude analyzed the existing project structure and reported on:
index.html- MapLibre versionjs/app.js- JavaScript implementationcss/style.css- Stylingdata/units.geojson- Polygon boundariesdata/offices.geojson- Point locations
Starting the Development Server
Prompt:
Result: Started Python HTTP server. When port 8080 was occupied:
Follow-up Prompt:
Result: Port 8081 also occupied, server started on port 8082.
WebGL Error Resolution
Context: MapLibre failed with WebGL context creation error on remote VM.
Error Message:
Failed to initialize WebGL: Could not create a WebGL context,
GL_RENDERER = ANGLE (Mesa, llvmpipe...), Sandboxed = no
Prompt:
Context: User confirmed they needed a non-WebGL solution.
Leaflet Version Creation
Prompt:
Result: Claude created:
index-leaflet.html- HTML using Leaflet instead of MapLibrejs/app-leaflet.js- Leaflet JavaScript implementation
Key features of the Leaflet version:
- Canvas rendering (
preferCanvas: true) - No WebGL dependency
- OpenStreetMap tiles
- Same UI/UX as MapLibre version
Layer Ordering Fix
Prompt:
move the regional polygons to the bottom of the rendering so I can click
on the smaller national forest units inside of them
Result: Claude modified js/app-leaflet.js to:
- Separate features into
regionFeaturesandunitFeatures - Render regional boundaries first (bottom layer)
- Render smaller units second (top layer)
- Apply different styling to regions:
- 25% opacity (more transparent)
- Dashed outline
- Thinner stroke
Code Change:
// Types that should be rendered on bottom (large regions)
const REGION_TYPES = ['Regional Office'];
// Add regions layer FIRST (renders on bottom)
regionsLayer = L.geoJSON(regionFeatures, {
style: (feature) => ({
...getPolygonStyle(feature),
fillOpacity: 0.25,
weight: 1,
dashArray: '5, 5'
}),
// ...
}).addTo(map);
// Add units layer SECOND (renders on top)
unitsLayer = L.geoJSON(unitFeatures, {
// ...
}).addTo(map);
Key Implementation Details
Map Configuration
const MAP_CONFIG = {
center: [40, -110], // Centered on western US
zoom: 4,
minZoom: 2,
maxZoom: 18
};
Agency Color Scheme
const AGENCY_COLORS = {
'USFS': {
'National Forest': '#228B22',
'Regional Office': '#006400',
default: '#228B22'
},
'BLM': { default: '#DAA520' },
'NPS': { default: '#8B4513' },
'BIA': { default: '#800080' },
'Tribal': { default: '#800080' }
};
Interactive Features
- Click handlers on polygons and markers
- Hover effects with style changes
- Popup generation with unit details
- Sidebar selection synchronization
- Mobile-responsive toggle