This repository implements Enterprise GIS Workbench, GeoJSON Zones & Deck.gl Analytics using Python FastAPI + Vanilla JS/HTML/CSS with 100% modern, zero-deprecation Google Maps Platform APIs.
- Maps JavaScript API (
maps,core):- Loaded via the Dynamic Library Import bootstrap (
google.maps.importLibrary). - Configured with
mapId: "DEMO_MAP_ID"andinternalUsageAttributionIds: ["gmp_git_agentsamples_v1.0.0"]. - GeoJSON boundary rendering via
map.data.addGeoJson(),map.data.setStyle(), andmap.fitBounds().
- Loaded via the Dynamic Library Import bootstrap (
- Markers (
marker):AdvancedMarkerElementandPinElement(usingglyphTextandmarker.append(pin)).
- Places (
places& Places API New REST):- Client-side
PlaceAutocompleteElementlistening to thegmp-selectevent (event.placePrediction.toPlace()+place.fetchFields()). - Server-side FastAPI BFF (
POST /api/places/search) callinghttps://places.googleapis.com/v1/places:searchTextwithX-Goog-Api-KeyandX-Goog-FieldMask.
- Client-side
- Elevation (
elevation& Elevation API REST):- Server-side FastAPI BFF (
POST /api/elevation) callinghttps://maps.googleapis.com/maps/api/elevation/json.
- Server-side FastAPI BFF (
- Spatial Drawing & WebGL Overlays:
terra-draw+terra-draw-google-maps-adapter(modern replacement forgoogle.maps.drawing).deck.glGoogleMapsOverlaywithScatterplotLayerandHexagonLayerguarded by a WebGL2 capability check.
Future coding agents MUST NEVER introduce any of the following deprecated or disabled APIs or insecure patterns:
- NEVER use
google.maps.Marker— useAdvancedMarkerElement. - NEVER use
PinElement.elementorPinElement.glyph— appendPinElementdirectly and useglyphText/glyphSrc. - NEVER use
google.maps.places.Autocomplete,SearchBox,PlacesService, orAutocompleteService— usePlaceAutocompleteElement,AutocompleteSuggestion.fetchAutocompleteSuggestions,Place.searchByText, or Places API (New) via/api/places/search. - NEVER listen to
gmp-placeselect— listen togmp-select. - NEVER use
DirectionsService,DirectionsRenderer, orDistanceMatrixService— useRoute.computeRoutesor Routes API v2 (routes.googleapis.com). - NEVER use
google.maps.drawing— useterra-draw+terra-draw-google-maps-adapter. - NEVER use
google.maps.visualization.HeatmapLayer— use deck.gl layers (HexagonLayer/HeatmapLayer). - NEVER call
places.googleapis.comormaps.googleapis.com/maps/api/elevationdirectly from browserfetch()— route through the FastAPI BFF endpoints. - NEVER use
innerHTML,outerHTML,document.write, orinsertAdjacentHTML— usedocument.createElement(),textContent, andreplaceChildren(). - NEVER hardcode API keys or bind the server to wildcard interfaces; always bind strictly to
127.0.0.1and keepX-Content-Type-Options: nosniffandX-Frame-Options: SAMEORIGINheaders intact.
- Solution:
spatial-intelligence— Enterprise GIS Workbench, GeoJSON Zones & Deck.gl Analytics (Advanced Spatial Analytics & 3D) - Framework:
python-fastapi(Python FastAPI Backend + Interactive Web Frontend) - Transport Mode: Full-Stack Server BFF
- API Key Tier: Billed Google Cloud key required (Elevation API (REST))
- Environment Variable:
GOOGLE_MAPS_API_KEYin.env - Detected JS Libraries:
core,elevation,maps,marker,places - Geo Libraries:
deck.gl,terra-draw - Server
/api/*Proxy Routes:/api/elevation,/api/places/search
- Map & Markers:
static/app.js - Places, Routes & Geo Services:
static/app.js,static/index.html - Backend API Proxy:
main.py - App Entry & Config:
static/index.html
# Install
python3 -c import pathlib, venv; p=pathlib.Path('.venv'); venv.create(p, with_pip=True) if not (p/'bin'/'pip').exists() else None && .venv/bin/pip install -q -r requirements.txt
# Typecheck
.venv/bin/python -m compileall -q -x ^\./?\.venv .
# Build
.venv/bin/python -m compileall -q -x ^\./?\.venv .
# Serve (loopback 127.0.0.1)
.venv/bin/uvicorn main:app --host 127.0.0.1 --port 4177- Parent Solution:
../README.md·../AGENTS.md·../verification_report.md - Catalog Routers:
../../AGENTS.md·../../BY_API.md·../../BY_FRAMEWORK.md·../../INDEX.md - Other Frameworks:
static-vanilla-js,react-vite,nextjs,sveltekit,vue-vite,angular,nodejs-web