Enterprise GIS Workbench, GeoJSON Zones & Deck.gl Analytics — Node.js + Express + TypeScript Backend + Interactive Web Frontend (Map, AdvancedMarkerElement, PinElement, PlaceAutocompleteElement, Place)
An enterprise Web GIS spatial analytics workbench centered on New York City (40.73061, -73.98661), built with a Node.js + Express + TypeScript Backend-for-Frontend (BFF) and an interactive ES module web client.
It integrates the Google Maps JavaScript API (setOptions + importLibrary, mapId: 'DEMO_MAP_ID', internalUsageAttributionIds: ['gmp_git_agentsamples_v1.0.0']), a live basemap switcher (roadmap, satellite, hybrid, terrain), GeoJSON district boundary polygons styled by grid capacity metrics with smooth fitBounds() zoom-on-select, a WebGL2-accelerated deck.gl GoogleMapsOverlay (ScatterplotLayer and HexagonLayer across 2,400 NYC infrastructure sensor points with graceful WebGL2 fallback), an interactive Terra Draw polygon toolbar (terra-draw + terra-draw-google-maps-adapter) for custom study-zone filtering, server-proxied Elevation API terrain profiling (/api/elevation), and Places API (New) civic reference hubs (/api/places/search) rendered with AdvancedMarkerElement.
You can run this application immediately without setting up a Google Cloud billing account:
- Open the Maps Demo Key Portal.
- Sign in with any Google account (no billing card required).
- Accept the Maps Demo Project Terms when prompted.
- Click to generate and copy your Demo Key.
Production Note: For production workloads, provision a key in the Google Cloud Console Credentials, enable Maps JavaScript API, Places API (New), and Elevation API, and restrict your key by HTTP referrer / server IP via API Key Security Best Practices and Adding API Key Restrictions. Utilizing Google Maps Platform services in production may incur costs against your Google Cloud billing account.
cp .env.example .env
# Edit .env and set GOOGLE_MAPS_API_KEY=<your_key>
npm install --no-audit --no-fund
npx tsc --noEmit
npm run build
node dist/server.js --host 127.0.0.1 --port 3000Open http://127.0.0.1:3000 in your browser.
- Backend-for-Frontend (
src/server.ts->dist/server.js):- Strictly binds to
127.0.0.1, setsX-Content-Type-Options: nosniffandX-Frame-Options: SAMEORIGIN, and validates all incoming JSON bodies. GET /api/config: Supplies non-secret runtime map defaults and configuration status.GET /api/spatial-data: Serves 8 NYC infrastructure district GeoJSON polygons and 2,400 deterministic sensor telemetry points (src/data/nycSpatialData.ts).POST /api/places/search: Server-side proxy tohttps://places.googleapis.com/v1/places:searchTextwithX-Goog-Api-Keyand explicitX-Goog-FieldMask(places.id,places.displayName,places.formattedAddress,places.location,places.types).POST /api/elevation: Server-side proxy tohttps://maps.googleapis.com/maps/api/elevation/json, projecting onlyresults.elevation,results.location,results.resolution, andstatus.
- Strictly binds to
- Interactive GIS Frontend (
public/index.html,public/styles.css,public/app.js):- Uses
@googlemaps/js-api-loaderv2 (setOptions+importLibrary), bundled locally intodist/assets/vendor.mjsalongsidedeck.glandterra-draw. - Uses safe DOM creation (
document.createElement,textContent,replaceChildren) with zeroinnerHTMLassignments.
- Uses
setOptions({ key: state.config.apiKey, v: 'weekly' });
const [, mapsLib, markerLib] = await Promise.all([
importLibrary('core'),
importLibrary('maps'),
importLibrary('marker'),
importLibrary('places'),
importLibrary('elevation'),
]);
const map = new mapsLib.Map(document.getElementById('map-canvas'), {
center: { lat: 40.73061, lng: -73.98661 },
zoom: 12,
mapId: 'DEMO_MAP_ID',
internalUsageAttributionIds: ['gmp_git_agentsamples_v1.0.0'],
});static-vanilla-jsreact-vitenextjssveltekitvue-viteangularpython-fastapinodejs-web(current implementation)
- Google Maps Platform usage is governed by the Google Maps Platform Terms of Service and Acceptable Use Policy.
- See Maps JavaScript API Documentation, Places API (New) Documentation, and Elevation API Documentation.
- Cost Notice: "Usage of Google Maps Platform products and services may incur costs against your Google Cloud project billing account." Requires a billed Google Cloud key for Elevation API (REST) (a Maps Demo Key covers Maps JS/Places/Routes/Geocoding/Weather prototyping only).
- API Key Restrictions: Restrict production keys by HTTP referrer (client) or IP address (server) and allowed APIs via Add API Key Restrictions.
- License Scope: Google-sourced code snippets are provided "as-is" under the Apache 2.0 License (applies to Google-sourced snippets only, not the full generated project).
- Terms of Service: Subject to the Google Maps Platform Terms of Service, EEA Service Specific Terms, and Prohibited Territories. Do not cache non-
place_idPlaces data or use GMP content for AI/ML training. - Browse Catalog:
../README.md·../AGENTS.md·../../AGENTS.md·../../INDEX.md