{"id":42201415,"url":"https://github.com/yuzhva/react-leaflet-markercluster","last_synced_at":"2026-01-27T00:26:06.424Z","repository":{"id":37251521,"uuid":"80126686","full_name":"yuzhva/react-leaflet-markercluster","owner":"yuzhva","description":"React wrapper of the official Leaflet.markercluster for react-leaflet","archived":false,"fork":false,"pushed_at":"2025-11-15T10:38:25.000Z","size":6542,"stargazers_count":324,"open_issues_count":13,"forks_count":107,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-12-07T11:57:46.949Z","etag":null,"topics":["leaflet","markercluster","react"],"latest_commit_sha":null,"homepage":"https://yuzhva.github.io/react-leaflet-markercluster/","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/yuzhva.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":"yuzhva","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://send.monobank.ua/2E2TDiNohQ"]}},"created_at":"2017-01-26T15:27:20.000Z","updated_at":"2025-11-20T17:50:41.000Z","dependencies_parsed_at":"2024-12-06T22:23:17.303Z","dependency_job_id":"e612e31c-4dc9-4fff-b263-388562d7b20e","html_url":"https://github.com/yuzhva/react-leaflet-markercluster","commit_stats":{"total_commits":38,"total_committers":9,"mean_commits":4.222222222222222,"dds":"0.39473684210526316","last_synced_commit":"398a2e16479c2073f286af628e3576268fa5753b"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/yuzhva/react-leaflet-markercluster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuzhva%2Freact-leaflet-markercluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuzhva%2Freact-leaflet-markercluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuzhva%2Freact-leaflet-markercluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuzhva%2Freact-leaflet-markercluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuzhva","download_url":"https://codeload.github.com/yuzhva/react-leaflet-markercluster/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuzhva%2Freact-leaflet-markercluster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28792978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["leaflet","markercluster","react"],"created_at":"2026-01-27T00:26:06.319Z","updated_at":"2026-01-27T00:26:06.401Z","avatar_url":"https://github.com/yuzhva.png","language":"JavaScript","funding_links":["https://patreon.com/yuzhva","https://send.monobank.ua/2E2TDiNohQ"],"categories":[],"sub_categories":[],"readme":"# React leaflet markercluster\n\n[![npm](https://img.shields.io/npm/v/react-leaflet-markercluster.svg)](https://www.npmjs.com/package/react-leaflet-markercluster)\n[![Code Climate](https://codeclimate.com/github/YUzhva/react-leaflet-markercluster/badges/gpa.svg)](https://codeclimate.com/github/YUzhva/react-leaflet-markercluster)\n[![npm](https://img.shields.io/npm/dm/react-leaflet-markercluster.svg)](https://www.npmjs.com/package/react-leaflet-markercluster)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=plastic)](#license)\n\nReact wrapper of [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster)\nfor [react-leaflet](https://github.com/PaulLeCam/react-leaflet)\n\n![React leaflet markercluster](./preview.png)\n\n**Examples with the Documentation:** https://yuzhva.github.io/react-leaflet-markercluster/ \u003cbr /\u003e\n**[CodeSandbox Getting Started](https://codesandbox.io/s/react-leaflet-markercluster-getting-started-9binx)**\n\n# Description\n\nIf you are faced with an issue with markers or polygons overlapping during map zooming, or they are\noverlapping because they are close to each other - you probably need to group them. \u003cbr /\u003e\nThat is what you can do with **react-leaflet-markercluster**.\n\nJust grab your markers or [ClusterableRegions](https://github.com/yuzhva/react-leaflet-markercluster/blob/645bcad7b98e0ecf598c99543373aeeb9c8b301f/.storybook/examples/region.jsx#L13-L45) inside `\u003cMarkerClusterGroup /\u003e` component, right after `\u003cTileLayer /\u003e`:\n\n```javascript\nimport MarkerClusterGroup from \"react-leaflet-markercluster\";\n\n\u003cMarkerClusterGroup\u003e\n  \u003cMarker position={[49.8397, 24.0297]} /\u003e\n  \u003cMarker position={[52.2297, 21.0122]} /\u003e\n  \u003cMarker position={[51.5074, -0.0901]} /\u003e\n\u003c/MarkerClusterGroup\u003e;\n```\n\n\u003e **Note: Before getting started, please see these useful guides:**\n\u003e\n\u003e - [Leaflet Quick Start Guide](http://leafletjs.com/examples/quick-start/).\n\u003e - [react-leaflet Installation](https://react-leaflet.js.org/docs/en/installation.html).\n\n# Table of Contents\n\n- [Getting started](#getting-started)\n- [API](#api)\n- [How to run DEV env](#how-to-run-dev-env)\n- [Contributors ✨](#contributors-)\n- [Contributing](#contributing)\n- [License](#license)\n\n# Getting started\n\n**1.** Install package:\n\n```bash\nyarn add react-leaflet-markercluster@next # yarn\nnpm install react-leaflet-markercluster # npm\n```\n\nThe `react-leaflet-markercluster` requires `leaflet.markercluster` as [`peerDependency`](https://docs.npmjs.com/files/package.json#peerdependencies)\n\n(Leaflet and react-leaflet also should be installed)\n\n```bash\nyarn add leaflet.markercluster leaflet react-leaflet # yarn\nnpm install leaflet.markercluster leaflet react-leaflet # npm\n```\n\n**2.** Import **markercluster** and **leaflet** styles:\n\n```javascript\n//sass\n@import '~leaflet/dist/leaflet.css'; \n@import '~react-leaflet-markercluster/styles'; \n\n//cjs\nrequire('~leaflet/dist/leaflet.css');\nrequire('react-leaflet-markercluster/styles'); \n\n//esm\nimport 'leaflet/dist/leaflet.css'\nimport 'react-leaflet-markercluster/styles'\n```\n\nOr include CSS styles directly to the head of HTML file:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/leaflet/dist/leaflet.css\" /\u003e\n\n\u003clink\n  rel=\"stylesheet\"\n  href=\"https://unpkg.com/react-leaflet-markercluster/styles\"\n/\u003e\n```\n\n**3.** Write some simple `react-leaflet` Map:\n\n```javascript\nimport { MapContainer, TileLayer, Marker } from \"react-leaflet\";\n\n\u003cMapContainer\n  className=\"markercluster-map\"\n  center={[51.0, 19.0]}\n  zoom={4}\n  maxZoom={18}\n\u003e\n  \u003cTileLayer\n    url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\n    attribution='\u0026copy; \u003ca href=\"http://osm.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors'\n  /\u003e\n\n  \u003cMarker position={[49.8397, 24.0297]} /\u003e\n  \u003cMarker position={[52.2297, 21.0122]} /\u003e\n  \u003cMarker position={[51.5074, -0.0901]} /\u003e\n\u003c/MapContainer\u003e;\n```\n\n**NOTE:** Remember to add map styles `.markercluster-map { height: 90vh; }`.\n\n**4.** Just put your markers or [ClusterableRegions](https://github.com/yuzhva/react-leaflet-markercluster/blob/645bcad7b98e0ecf598c99543373aeeb9c8b301f/.storybook/examples/region.jsx#L13-L45) inside `\u003cMarkerClusterGroup /\u003e` component, right after `\u003cTileLayer /\u003e`:\n\n```javascript\nimport MarkerClusterGroup from \"react-leaflet-markercluster\";\n\n\u003cMarkerClusterGroup\u003e\n  \u003cMarker position={[49.8397, 24.0297]} /\u003e\n  \u003cMarker position={[52.2297, 21.0122]} /\u003e\n  \u003cMarker position={[51.5074, -0.0901]} /\u003e\n\u003c/MarkerClusterGroup\u003e;\n```\n\n[More examples with the Documentation](https://yuzhva.github.io/react-leaflet-markercluster/) \u003cbr /\u003e\n[CodeSandbox Getting Started](https://codesandbox.io/s/react-leaflet-markercluster-getting-started-9binx)\n\n# API\n\nJust pass whatever option you need from [All Leaflet.markercluster Options](https://github.com/Leaflet/Leaflet.markercluster#all-options) to `MarkerClusterGroup` as `prop`.\n\nFor example:\n\n```javascript\n\u003cMarkerClusterGroup showCoverageOnHover={false} /\u003e\n```\n\nor:\n\n```javascript\nconst createClusterCustomIcon = function (cluster) {\n  return L.divIcon({\n    html: `\u003cspan\u003e${cluster.getChildCount()}\u003c/span\u003e`,\n    className: 'marker-cluster-custom',\n    iconSize: L.point(40, 40, true),\n  });\n}\n\n\u003cMarkerClusterGroup iconCreateFunction={createClusterCustomIcon} /\u003e\n```\n\nP.S: Examples for v1 are available at [CHANGELOG.md](./CHANGELOG.md#v118)\n\n### Event listeners\n\nYou are able to add any listener, supported by Leaflet, with simple `on` property prefix.\n\n# How to run DEV env\n\n**1.** Clone the repo:\n\n```bash\ngit clone https://github.com/YUzhva/react-leaflet-markercluster.git\n```\n\n**2.** Install all dependencies:\n\n```bash\nyarn install --no-lockfile # yarn\nnpm install # npm\n```\n\n**3.** Start the server:\n\n```bash\nyarn dev # yarn\nnpm run dev # npm\n```\n\n**4.** After starting the server, storybook should automatically open the following address:\n\n```\nhttp://localhost:8080/\n```\n\n# Contributors ✨\n\nThanks goes to these wonderful people:\n\u003ca href=\"https://github.com/yuzhva/react-leaflet-markercluster/graphs/contributors\"\u003e\n\u003cimg src=\"https://contributors-img.web.app/image?repo=yuzhva/react-leaflet-markercluster\" /\u003e\n\u003c/a\u003e\nAvatars rendered by [contributors-img](https://contributors-img.web.app).\n\n**Special thanks to:**\n\n- [@webcarrot](https://github.com/webcarrot) for [react-leaflet v2 support](https://github.com/yuzhva/react-leaflet-markercluster/issues/71#issuecomment-403071677)\n- [@CodeCutterUK](https://github.com/CodeCutterUK) for [react-leaflet v3 support](https://github.com/yuzhva/react-leaflet-markercluster/pull/124)\n\n# Contributing\n\nAll sources are placed in the `./src` folder:\n\n**1.** Fork the repo.\n\n**2.** Edit `react-leaflet-markercluster.js` plugin or `style.scss` style files.\n\n**3.** Commit your changes and open Pull Request.\n\n\u003c!--Release instructions https://github.com/yuzhva/react-leaflet-markercluster/pull/210#issuecomment-2447972111 --\u003e\n\n:beer: **Thank you for contribution** :beer:\n\n# UMD\n\nUMD builds are available on [unpkg](https://unpkg.com/):\n\n```html\n\u003c!-- unpkg, production code (minified) --\u003e\n\u003cscript src=\"https://unpkg.com/react-leaflet-markercluster/dist/index.js\"\u003e\u003c/script\u003e\n\u003c!-- unpkg, development code --\u003e\n\u003cscript src=\"https://unpkg.com/react-leaflet-markercluster/src/react-leaflet-markercluster.js\"\u003e\u003c/script\u003e\n\n\u003c!-- unpkg, production styles (minified) --\u003e\n\u003clink\n  rel=\"stylesheet\"\n  type=\"text/css\"\n  href=\"https://unpkg.com/react-leaflet-markercluster/styles\"\n/\u003e\n\u003c!-- unpkg, development styles --\u003e\n\u003clink\n  rel=\"stylesheet\"\n  type=\"text/css\"\n  href=\"https://unpkg.com/react-leaflet-markercluster/src/styles.scss\"\n/\u003e\n```\n\n# License\n\nMIT License, see [LICENSE](https://github.com/YUzhva/react-leaflet-markercluster/blob/master/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuzhva%2Freact-leaflet-markercluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuzhva%2Freact-leaflet-markercluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuzhva%2Freact-leaflet-markercluster/lists"}