{"id":49742244,"url":"https://github.com/zwaarcontrast/ol-graticule","last_synced_at":"2026-05-30T13:00:48.771Z","repository":{"id":356293120,"uuid":"1231842951","full_name":"ZwaarContrast/ol-graticule","owner":"ZwaarContrast","description":"Flexible graticule layer for OpenLayers, with add-ons for projected, MGRS, Dutch RD, WWII MBS, Kriegsmarine Marinequadratkarte, Luftwaffe Gradmeldenetz and Jägermeldenetz, Heeresgitter and Heeresmeldenetz.. ","archived":false,"fork":false,"pushed_at":"2026-05-26T21:51:50.000Z","size":650,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T23:25:05.748Z","etag":null,"topics":["cartography","coordinate-systems","geospatial","graticule","mapping","ol","openlayers","proj4"],"latest_commit_sha":null,"homepage":"https://zwaarcontrast.nl/ol-graticule/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZwaarContrast.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-07T10:43:39.000Z","updated_at":"2026-05-26T21:51:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ZwaarContrast/ol-graticule","commit_stats":null,"previous_names":["zwaarcontrast/ol-graticule"],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/ZwaarContrast/ol-graticule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZwaarContrast%2Fol-graticule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZwaarContrast%2Fol-graticule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZwaarContrast%2Fol-graticule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZwaarContrast%2Fol-graticule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZwaarContrast","download_url":"https://codeload.github.com/ZwaarContrast/ol-graticule/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZwaarContrast%2Fol-graticule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33692997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cartography","coordinate-systems","geospatial","graticule","mapping","ol","openlayers","proj4"],"created_at":"2026-05-09T20:00:58.684Z","updated_at":"2026-05-30T13:00:48.764Z","avatar_url":"https://github.com/ZwaarContrast.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ol-graticule\n\nFlexible graticule (grid overlay) for OpenLayers, with pluggable grid systems.\n\nShip a lat/lon grid on a web map, overlay a national grid (RD, UTM), add a\nhistorical artillery grid, or render an image-pixel grid on top of an IIIF\nviewer, all from the same layer class and a small `GridSystem` interface.\n\n**Live demos:** \u003chttps://zwaarcontrast.nl/ol-graticule/\u003e, bare-bones\ndemo per package.\n\n## Packages\n\n| Package | What it gives you |\n|---|---|\n| [`@zwaarcontrast/ol-graticule`](./packages/ol-graticule) | `UniversalGraticule` layer, `CursorPositionControl`, `PixelGridSystem`, `GeographicGridSystem` (EPSG:4326). No proj4 dependency. |\n| [`@zwaarcontrast/ol-graticule-projected`](./packages/ol-graticule-projected) | `ProjectedGridSystem`, any CRS via proj4. |\n| [`@zwaarcontrast/ol-graticule-modified-british-system`](./packages/ol-graticule-modified-british-system) | Modified British System letter-cell artillery grids for ten WWII theatres (Nord de Guerre, British/Irish Cassini, French Lambert I/II/III, War Office Cassini, Scandinavian Zone 3, Italian Northern/Southern, Iberian Peninsula). |\n| [`@zwaarcontrast/ol-graticule-rd`](./packages/ol-graticule-rd) | Dutch RD Amersfoort grids (EPSG:28991 Old, EPSG:28992 New). Netherlands coverage polygon baked in. |\n| [`@zwaarcontrast/ol-graticule-mgrs`](./packages/ol-graticule-mgrs) | Military Grid Reference System (MGRS / NATO grid) over UTM, with Norway and Svalbard exceptions. |\n| [`@zwaarcontrast/ol-graticule-luftwaffe-planquadrat`](./packages/ol-graticule-luftwaffe-planquadrat) | WWII Luftwaffe Planquadrat reference grids: Gradnetzmeldeverfahren (GNMV) and Jägermeldenetz (JMN). |\n| [`@zwaarcontrast/ol-graticule-heeresgitter`](./packages/ol-graticule-heeresgitter) | WWII Wehrmacht map reference grids: Deutsches Heeresgitter (DHG, Bessel + 6° Gauß-Krüger) and Heeresmeldenetz (HMN) letter cells. |\n| `@zwaarcontrast/ol-graticule-marinequadratkarte` | WWII Kriegsmarine naval grid. *Not yet published*, see [the package's LICENSE.TODO.md](./packages/ol-graticule-marinequadratkarte/LICENSE.TODO.md). |\n\nEach add-on package depends on `@zwaarcontrast/ol-graticule`; install only\nwhat you need.\n\n## Install matrix\n\n| If you want… | Install |\n|---|---|\n| Lat/lon graticule on a web map | `@zwaarcontrast/ol-graticule` |\n| Pixel ruler on an IIIF viewer | `@zwaarcontrast/ol-graticule` |\n| UTM / state plane / custom proj4 CRS | `@zwaarcontrast/ol-graticule` + `@zwaarcontrast/ol-graticule-projected` + `proj4` |\n| MBS artillery grid (any of 10 WWII theatres) | `@zwaarcontrast/ol-graticule` + `@zwaarcontrast/ol-graticule-modified-british-system` (+ `@zwaarcontrast/ol-graticule-projected` + `proj4`) |\n| Dutch RD grid | `@zwaarcontrast/ol-graticule` + `@zwaarcontrast/ol-graticule-rd` (+ `@zwaarcontrast/ol-graticule-projected` + `proj4`) |\n| MGRS / NATO grid | `@zwaarcontrast/ol-graticule` + `@zwaarcontrast/ol-graticule-mgrs` (+ `@zwaarcontrast/ol-graticule-projected` + `proj4`) |\n| Luftwaffe GNMV / JMN | `@zwaarcontrast/ol-graticule` + `@zwaarcontrast/ol-graticule-luftwaffe-planquadrat` |\n| Wehrmacht DHG / HMN | `@zwaarcontrast/ol-graticule` + `@zwaarcontrast/ol-graticule-heeresgitter` (+ `@zwaarcontrast/ol-graticule-projected` + `proj4`) |\n\n`ol` is a peer dependency of every package (\u003e=9 \u003c11).\n\n## Quick example\n\n```ts\nimport Map from 'ol/Map';\nimport View from 'ol/View';\nimport TileLayer from 'ol/layer/Tile';\nimport OSM from 'ol/source/OSM';\nimport {\n  UniversalGraticule,\n  GeographicGridSystem,\n  CursorPositionControl,\n} from '@zwaarcontrast/ol-graticule';\n\nconst gridSystem = new GeographicGridSystem();\n\nconst map = new Map({\n  target: 'map',\n  layers: [\n    new TileLayer({ source: new OSM() }),\n    new UniversalGraticule({ gridSystem, style: { edgeLabel: true } }),\n  ],\n  controls: [new CursorPositionControl({ gridSystem })],\n  view: new View({ center: [0, 0], zoom: 2 }),\n});\n```\n\n## Reverse: parse a typed coordinate\n\nEvery built-in grid system implements an optional `parseCoordinate(text, projection)`\nthat turns a typed reference back into view-projection coords, wire it up\nto a search input to fly the map to a typed location.\n\n```ts\nimport { ParseError } from '@zwaarcontrast/ol-graticule';\n\ntry {\n  const center = gridSystem.parseCoordinate(input.value, map.getView().getProjection());\n  map.getView().animate({ center, duration: 400 });\n} catch (err) {\n  if (err instanceof ParseError) showError(err.reason);\n}\n```\n\nLenient input by design: DMS/DDM/DD with hemisphere markers for\n`GeographicGridSystem`, metric variants for `MetricFormatter`, full MBS and\nKriegsmarine references for those grids. See each package's README for the\nexact accepted forms.\n\n## Custom grid systems\n\nThe `GridSystem` interface has four methods, implement it yourself to draw\nany grid you can describe in code. See [`src/types.ts`](./packages/ol-graticule/src/types.ts).\n\n## Development\n\n```bash\nnpm install\nnpm run build        # topological build of every package in the workspace\nnpm test             # vitest across all packages\nnpm run type-check   # tsc --noEmit everywhere\nnpm run demo:dev     # run the demos site locally (Vite dev server)\nnpm run demo:build   # build the demos site (goes to demos/dist)\n```\n\nDemos deploy to GitHub Pages automatically from `main` via\n`.github/workflows/demos.yml`.\n\nThis repo uses npm workspaces and [changesets](https://github.com/changesets/changesets)\nfor versioning. The published packages (everything except\n`ol-graticule-marinequadratkarte`, see its [LICENSE.TODO.md](./packages/ol-graticule-marinequadratkarte/LICENSE.TODO.md))\nbump in lockstep (`fixed` group) so their versions always match. The\nKriegsmarine package is in the changesets `ignore` list and is marked\n`\"private\": true` in its `package.json`, both as belt-and-suspenders\nsafeguards against accidental publication.\n\n```bash\nnpx changeset          # record a new change\nnpm run version        # apply pending changesets + regenerate root CHANGELOG.md\nnpm run release        # build + publish\n```\n\n## License\n\nMIT, see [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwaarcontrast%2Fol-graticule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzwaarcontrast%2Fol-graticule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwaarcontrast%2Fol-graticule/lists"}