{"id":28576928,"url":"https://github.com/maptiler/maplibre-grid","last_synced_at":"2025-06-11T00:08:14.919Z","repository":{"id":77966585,"uuid":"341707251","full_name":"maptiler/maplibre-grid","owner":"maptiler","description":"Grid / graticule plugin for MapLibre GL JS / Mapbox GL JS","archived":false,"fork":false,"pushed_at":"2024-05-11T20:37:40.000Z","size":284,"stargazers_count":28,"open_issues_count":9,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-02T07:08:33.300Z","etag":null,"topics":["mapbox-gl-js","maplibre","maplibre-gl-js","plugin"],"latest_commit_sha":null,"homepage":"https://labs.maptiler.com/maplibre-grid/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maptiler.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}},"created_at":"2021-02-23T22:24:33.000Z","updated_at":"2025-05-19T23:49:18.000Z","dependencies_parsed_at":"2024-10-23T02:50:48.209Z","dependency_job_id":null,"html_url":"https://github.com/maptiler/maplibre-grid","commit_stats":{"total_commits":5,"total_committers":3,"mean_commits":"1.6666666666666667","dds":0.4,"last_synced_commit":"c712d80007f4a4d1b771795b9299ab372af2b5cb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaplibre-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaplibre-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaplibre-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaplibre-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maptiler","download_url":"https://codeload.github.com/maptiler/maplibre-grid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fmaplibre-grid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172987,"owners_count":22816560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["mapbox-gl-js","maplibre","maplibre-gl-js","plugin"],"created_at":"2025-06-11T00:08:13.982Z","updated_at":"2025-06-11T00:08:14.908Z","avatar_url":"https://github.com/maptiler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# maplibre-grid\n\nGrid / graticule plugin for [MapLibre GL JS](https://docs.maptiler.com/maplibre-gl-js/get-started/) / Mapbox GL JS\n\n[Demo](https://labs.maptiler.com/maplibre-grid/)\n\n\u003cimg src=\"docs/screenshot@2x.jpg\" alt=\"Screenshot\" width=\"640\" height=\"320\"\u003e\n\n## Install\n\n```\nnpm install maplibre-gl maplibre-grid\n```\n\nor\n\n```\n\u003cscript src=\"https://unpkg.com/maplibre-gl@1.13.0-rc.5/dist/maplibre-gl.js\"\u003e\u003c/script\u003e\n\u003clink href=\"https://unpkg.com/maplibre-gl@1.13.0-rc.5/dist/maplibre-gl.css\" rel=\"stylesheet\"\u003e\n\u003cscript src=\"https://unpkg.com/maplibre-grid@1.0.0/dist/maplibre-grid.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n```\nimport Maplibre from 'maplibre-gl';\nimport * as MaplibreGrid from 'maplibre-grid';\n```\n\n### API\n\n```\nexport interface GridConfig {\n  gridWidth: number;\n  gridHeight: number;\n  units: Units;\n  minZoom?: number;\n  maxZoom?: number;\n  paint?: maplibregl.LinePaint;\n}\n\nconst grid = new MaplibreGrid.Grid(config: GridConfig);\n```\n\n- `gridWidth` - number, **required**\n- `gridHeight` - number, **required**\n- `units` - 'degrees' | 'radians' | 'miles' | 'kilometers', grid width/height units, **required**\n- `minZoom` - number, min zoom to display the grid\n- `maxZoom` - number, max zoom to display the grid\n- `paint` - maplibregl.LinePaint, layer line paint properties\n\nMultiple grids can be added to display major and minor grid together, or different grids depending on zoom level.\n\n### Basic\n\n```\nconst grid = new MaplibreGrid.Grid({\n  gridWidth: 10,\n  gridHeight: 10,\n  units: 'degrees',\n  paint: {\n    'line-opacity': 0.2\n  }\n});\nmap.addControl(grid);\n```\n\n### Multiple grids\n\n```\nconst grid1 = new MaplibreGrid.Grid({\n  gridWidth: 10,\n  gridHeight: 10,\n  units: 'degrees',\n  paint: {\n    'line-opacity': 0.2\n  }\n});\nmap.addControl(grid1);\n\nconst grid2 = new MaplibreGrid.Grid({\n  gridWidth: 5,\n  gridHeight: 5,\n  units: 'degrees',\n  paint: {\n    'line-opacity': 0.2\n  }\n});\nmap.addControl(grid2);\n```\n### Click event\n\n```\nmap.on(MaplibreGrid.GRID_CLICK_EVENT, event =\u003e {\n  console.log(event.bbox);\n});\n```\n\nClick event can be used to implement grid cell selection. Create a polygon feature from `event.bbox`, and add it to your custom layer. See [demo](https://labs.maptiler.com/maplibre-grid/) for details.\n\n### Destroy\n\n```\nmap.removeControl(grid);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptiler%2Fmaplibre-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaptiler%2Fmaplibre-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptiler%2Fmaplibre-grid/lists"}