BerkeleyMapper 2.0 is a React + Leaflet mapping interface for collections and other tabular geographic datasets. It keeps compatibility with the BerkeleyMapper XML config format while rendering records, layers, and UI behavior in JavaScript.
Instructions for using BerkeleyMapper are found in the wiki
Sample Arctos call:
Sample AmphibiaWeb call:
The app runs as a JavaScript frontend with a small Node server for same-origin proxy endpoints.
Local development:
nvm use
npm install
npm run devProduction build:
npm run buildPreview the built app locally:
npm run previewThe current React app supports:
- load a tab-delimited dataset directly in the browser from a URL
- optionally load a legacy BerkeleyMapper XML config directly in the browser
- parse records and coordinates in JavaScript
- render the dataset in a React UI with a Leaflet map and records table
- render collection logos and metadata from config
- support config-driven field ordering, aliases, and visible-field filtering
- support config-driven marker coloring
- load KML, KMZ, and GeoJSON overlay layers from
gisdata.layer - toggle and zoom to overlay layers from the legend
- proxy remote dataset/config/layer requests through same-origin API endpoints
The app now builds to a static site and can be hosted anywhere that can serve the dist/ directory.
- client routes are static assets built by Vite
- the production Node server exposes
/api/datasetand/api/layer - remote dataset hosts no longer need browser CORS headers when accessed through that server endpoint
Build settings:
Build command: npm run build
Publish directory: distThe JavaScript app currently uses two same-origin endpoints.
Loads a remote tabfile and optional config file server-side, then returns the parsed BerkeleyMapper dataset payload as JSON.
Query parameters:
tabfilerequired, absolute or same-origin URL to a tab-delimited text fileconfigfileoptional, absolute or same-origin URL to a BerkeleyMapper XML config file
Example:
/api/dataset?tabfile=https://raw.githubusercontent.com/BNHM/berkeleymapper/master/examples/arctostest.txt&configfile=https://raw.githubusercontent.com/BNHM/berkeleymapper/master/examples/arctostest.xml
Behavior:
- supports
GETandHEAD - rejects non-HTTP(S) URLs
- returns
400for missing required parameters - returns
502when upstream data cannot be loaded
Fetches a remote overlay source server-side and returns it to the browser with the appropriate content type.
Query parameters:
urlrequired, absolute or same-origin URL to a.kml,.kmz,.geojson, or.jsonlayer source
Example:
/api/layer?url=https://raw.githubusercontent.com/BNHM/berkeleymapper/master/examples/Anaxyrus_canorus.kmz
Behavior:
- supports
GETandHEAD - infers content type for KML, KMZ, GeoJSON, JSON, and XML sources
- rejects non-HTTP(S) URLs
- returns
400for missing required parameters - returns
502when upstream layer content cannot be loaded - detects common human-verification HTML pages and treats them as errors instead of valid layer data
Current config support is tracked in docs/config-file-support.md.
Supported areas currently include:
- metadata and logos
- concepts, field aliases, ordering, and visible columns
- record linkback generation
- GIS layer metadata and overlay loading
Areas still being improved in the JavaScript app include:
- polygon and spatial intersection processing
- shapefile-backed spatial lookups
- the remaining config-driven feature surface and older workflow variants
