Skip to content

Map drawing, awaitable api.js, tests and type declarations

Choose a tag to compare

@github-actions github-actions released this 10 Nov 22:31
· 48 commits to main since this release
  • tests/ - browser test page for the modules (tests/index.html, open it through any local server or at https://croot.js.org/lib/tests/), run headless in CI on every push and tag.
  • mapdraw.js (new) - draw points, lines and polygons on the map and edit them (drag vertices, insert from segment midpoints, delete by double-click or touch long-press); results are GeoJSON. addDrawControl (tool buttons with hints and Selesai/Hapus titik/Batal for touch), startDrawing, editFeature.
  • api.js - getJSON, postJSON, putJSON and deleteJSON also return a Promise of the same { status, data }, so they can be awaited (responseFunction may be null). The Promise never rejects; network failure is still status: 0.
  • crootjs.d.ts (new) - TypeScript declarations for every module, matched to jsDelivr URLs of any version, for editor autocomplete. Generated by tools/build-types.py.
  • CLAUDE.md, conventions - a mandatory "no AI slop" section for coding agents: no invented APIs, no dead code or fake content, verify in a browser before saying it is done.
  • model3d.js - nodes that are not part of the scene (for example parts left out by exportGLB) are no longer counted in triangles and can no longer be clicked. Found by the new tests.