[Angular] Migrate marks-site area drawing off google.maps.drawing.DrawingManager (Terra Draw) and unpin @types/google.maps / v=3.64 #1162

Open
opened 2026-10-02 04:44:19 +00:00 by spikerj · 0 comments
Owner

Why

Google removed the Maps JS Drawing Library — it is "no longer available in the Maps JavaScript API as of version 3.65" (May 2026). Our marks-site map only still draws because:

  • the runtime loader pins v=3.64&libraries=marker,drawing (projects/spikersoft/src/app/_services/marks-site/google-maps-loader.service.ts:19, see #236 comment), and Google retires pinned versions ~12 months after release → hard deadline ≈ mid-2027;
  • @types/google.maps is exact-pinned at 3.64.1 (commit c1c48f60) because from 3.65 DrawingManager is an empty class (setMap/setDrawingMode/options/events gone). 3.66.4 (latest) is the same.

Google's migration recommendation is Terra Draw (terra-draw + terra-draw-google-maps-adapter).

Side effect today: @angular/google-maps 22.x already depends on @types/google.maps ^3.65.1, so the lockfile carries two copies (3.64.1 root, 3.65.x nested) — fragile.

Markers are fine: we already use Advanced Markers (MapAdvancedMarker, PinElement, mapId), no legacy google.maps.Marker.

What changes for us

  • marks-drawing.service.ts (DrawingManager at ~L17, 28, 67-68, 95, 109, 149, 167) → Terra Draw rectangle / circle / polygon modes, port the blue fill/stroke styles, keep editable/draggable.
  • overlaycomplete handler → Terra Draw emits GeoJSON features, not google.maps.Rectangle/Circle/Polygon:
    • filterMarkersByDrawnAreas in marks-marker.service.ts (uses geometry.poly / spherical on overlays)
    • the instanceof google.maps.Rectangle → setSelectedAreaBounds branch
    • getDrawnOverlays() in marks-map.component.ts (~L336)

Acceptance criteria

  • Drawing rectangle / circle / polygon and marker filtering work as today (specs updated)
  • Loader drops drawing from libraries= and drops the v=3.64 pin; #236 comment removed
  • @types/google.maps unpinned to ^3.66; only one copy in pnpm-lock.yaml

Size: M (~2-3 days).

Links: Unrelated to #1165; can land any time.


Filed from the 2026-10-02 spikersoft-angular pnpm outdated changelog review.

## Why Google removed the Maps JS **Drawing Library** — it is "no longer available in the Maps JavaScript API as of version 3.65" (May 2026). Our marks-site map only still draws because: - the runtime loader pins `v=3.64&libraries=marker,drawing` (`projects/spikersoft/src/app/_services/marks-site/google-maps-loader.service.ts:19`, see #236 comment), and Google retires pinned versions ~12 months after release → **hard deadline ≈ mid-2027**; - `@types/google.maps` is exact-pinned at **3.64.1** (commit c1c48f60) because from 3.65 `DrawingManager` is an empty class (`setMap`/`setDrawingMode`/options/events gone). 3.66.4 (latest) is the same. Google's migration recommendation is **Terra Draw** (`terra-draw` + `terra-draw-google-maps-adapter`). Side effect today: `@angular/google-maps` 22.x already depends on `@types/google.maps ^3.65.1`, so the lockfile carries two copies (3.64.1 root, 3.65.x nested) — fragile. Markers are fine: we already use Advanced Markers (`MapAdvancedMarker`, `PinElement`, `mapId`), no legacy `google.maps.Marker`. ## What changes for us - `marks-drawing.service.ts` (DrawingManager at ~L17, 28, 67-68, 95, 109, 149, 167) → Terra Draw rectangle / circle / polygon modes, port the blue fill/stroke styles, keep editable/draggable. - `overlaycomplete` handler → Terra Draw emits GeoJSON features, not `google.maps.Rectangle/Circle/Polygon`: - `filterMarkersByDrawnAreas` in `marks-marker.service.ts` (uses `geometry.poly` / `spherical` on overlays) - the `instanceof google.maps.Rectangle` → `setSelectedAreaBounds` branch - `getDrawnOverlays()` in `marks-map.component.ts` (~L336) ## Acceptance criteria - [ ] Drawing rectangle / circle / polygon and marker filtering work as today (specs updated) - [ ] Loader drops `drawing` from `libraries=` and drops the `v=3.64` pin; #236 comment removed - [ ] `@types/google.maps` unpinned to `^3.66`; only one copy in `pnpm-lock.yaml` Size: **M** (~2-3 days). **Links:** Unrelated to #1165; can land any time. --- _Filed from the 2026-10-02 spikersoft-angular `pnpm outdated` changelog review._
spikerj added the enhancement label 2026-10-02 04:44:19 +00:00
Sign in to join this conversation.