{"id":27265387,"url":"https://github.com/vickyliin/leaflet.gridheat","last_synced_at":"2025-04-11T07:47:48.164Z","repository":{"id":69943402,"uuid":"104177914","full_name":"vickyliin/Leaflet.gridHeat","owner":"vickyliin","description":"A heatmap plugin with data stored in tiles.","archived":false,"fork":false,"pushed_at":"2017-09-29T05:41:48.000Z","size":20,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-02T10:11:38.484Z","etag":null,"topics":["ajax","heat","heatmap","leaflet","leaflet-layer","leaflet-plugin","tile"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/vickyliin.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2017-09-20T06:56:02.000Z","updated_at":"2024-05-25T05:10:59.000Z","dependencies_parsed_at":"2023-02-22T00:00:25.133Z","dependency_job_id":null,"html_url":"https://github.com/vickyliin/Leaflet.gridHeat","commit_stats":{"total_commits":27,"total_committers":4,"mean_commits":6.75,"dds":"0.33333333333333337","last_synced_commit":"52f3bd4362f8a07ac6ee0c75724cb50a2625c5c9"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickyliin%2FLeaflet.gridHeat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickyliin%2FLeaflet.gridHeat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickyliin%2FLeaflet.gridHeat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickyliin%2FLeaflet.gridHeat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vickyliin","download_url":"https://codeload.github.com/vickyliin/Leaflet.gridHeat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248359536,"owners_count":21090542,"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":["ajax","heat","heatmap","leaflet","leaflet-layer","leaflet-plugin","tile"],"created_at":"2025-04-11T07:47:47.375Z","updated_at":"2025-04-11T07:47:48.156Z","avatar_url":"https://github.com/vickyliin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaflet.gridHeat\n\nA heatmap plugin with data stored in tiles to get rid of large amount data transfer. Built on top of [Leaflet.heat](https://github.com/Leaflet/Leaflet.heat).\n\n## Demo\n\n- [Codepen](https://codepen.io/vickyliin/pen/qPqvBd)\n\n  This is a demo of randomly generated data. Data points are generated as tiles loaded, so it is expected for the heatmap changes each time you zoom/move the map.\n\n## Installation\n\nYou can import the script after leaflet in your html file:\n```html\n\u003cscript src=\"https://unpkg.com/leaflet@1.2.0/dist/leaflet.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/leaflet.gridheat@latest/dist/leaflet.gridHeat.min.js\"\u003e\u003c/script\u003e\n```\n\nOr use npm\n```\nnpm install leaflet.gridheat leaflet --save\n```\n\nAnd import/require it after leaflet\n\n```javascript\nconst L = require('leaflet')\nrequire('leaflet.gridheat')\n```\n\n```javascript\nimport L from 'leaflet'\nimport 'leaflet.gridheat'\n```\n\n## Usage\n\n```javascript\nL.gridHeat(options).addTo(yourMap)\n```\n\nor use url template just as tile layers:\n```javascript\nlet url = 'http://your.data.provider/{x}/{y}/{z}'\nL.gridHeat(url, options).addTo(yourMap)\n```\n\n## Reference\n\n### url\n\nData in `options` and `x`, `y`, `z` of tile's xyz-coordinate would be passed to url template, eg.\n\n```javascript\nlet url = 'http://your.data.provider/{x}/{y}/{z}?{someParamKey}={itsValue}'\nlet options = {\n  someParamKey: 'key',\n  itsValue: 'value'\n}\n// the url generated would be like:\n// http://your.data.provider/229/101/8?key=value\n```\n\n### options\n\nAll [Leaflet.heat](https://github.com/Leaflet/Leaflet.heat) options are available.\n\n| Name                   | Type           | Default | Description                                   |\n|------------------------|----------------|---------|-----------------------------------------------|\n| options.updateInterval | Number         | 800     | Debounce time of update in ms.                |\n| options.responseType   | String         | json    | Ajax response type when using `url`.          |\n| options.ajax           | Function       | ...     | A function to load tile data from server.     |\n\n#### options.ajax\n\nA function to load tile data from server.\n\n##### default\n\nA function that gets data from `url`.\n\n##### ajax(params)\n\n| Name                | Type           | Description                   |\n|---------------------|----------------|-------------------------------|\n| params.latLngBounds | L.LatLngBounds | LatLngBounds of the tile.     |\n| params.coords       | L.Point        | xyz-coordinate of the tile.   |\n\n##### return\n\nList of **latLngs** to show **or** a promise resolving latLngs.  \nFor the format of latLngs, please refer to [Leaflet.heat](https://github.com/Leaflet/Leaflet.heat).\n\n### GridHeat\n\n`L.gridHeat` is just an alias of `new L.LayerGroup.GridHeat`, which is an extension of `L.LayerGroup`:\n\n| Name                | Type                 | Description                                                     |\n|---------------------|----------------------|-----------------------------------------------------------------|\n| gridHeat.heatLayer  | L.HeatLayer          | The heat layer displaying data.                                 |\n| gridHeat.dataLayer  | L.GridLayer.AjaxData | A layer with data stored in tiles, extended from `L.GridLayer`. |\n\nOne can accesses and manipulates the layers directly by these APIs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvickyliin%2Fleaflet.gridheat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvickyliin%2Fleaflet.gridheat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvickyliin%2Fleaflet.gridheat/lists"}