{"id":20854379,"url":"https://github.com/w8r/leaflet-area-select","last_synced_at":"2025-04-05T16:05:45.032Z","repository":{"id":38291099,"uuid":"44108541","full_name":"w8r/leaflet-area-select","owner":"w8r","description":"Control to just select an area and provide bbox for it","archived":false,"fork":false,"pushed_at":"2024-10-02T09:13:29.000Z","size":1467,"stargazers_count":35,"open_issues_count":11,"forks_count":16,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T15:05:49.794Z","etag":null,"topics":["area","leaflet","leaflet-plugins","select"],"latest_commit_sha":null,"homepage":"https://w8r.github.io/leaflet-area-select/","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/w8r.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"w8r","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2015-10-12T13:18:17.000Z","updated_at":"2024-10-02T09:13:33.000Z","dependencies_parsed_at":"2024-11-18T09:10:32.931Z","dependency_job_id":null,"html_url":"https://github.com/w8r/leaflet-area-select","commit_stats":{"total_commits":77,"total_committers":4,"mean_commits":19.25,"dds":"0.36363636363636365","last_synced_commit":"4ebafe3b2d718f7412c00583e8c05796f89821a5"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w8r%2Fleaflet-area-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w8r%2Fleaflet-area-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w8r%2Fleaflet-area-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w8r%2Fleaflet-area-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w8r","download_url":"https://codeload.github.com/w8r/leaflet-area-select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361617,"owners_count":20926642,"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":["area","leaflet","leaflet-plugins","select"],"created_at":"2024-11-18T03:25:33.152Z","updated_at":"2025-04-05T16:05:45.009Z","avatar_url":"https://github.com/w8r.png","language":"JavaScript","readme":"# leaflet-area-select [![npm version](https://badge.fury.io/js/leaflet-area-select.svg)](https://badge.fury.io/js/leaflet-area-select) [![CircleCI](https://circleci.com/gh/w8r/leaflet-area-select/tree/leaflet-1.0.svg?style=svg)](https://circleci.com/gh/w8r/leaflet-area-select/tree/leaflet-1.0)\n\nControl to just select an area and provide bbox for it\n\n## [Demo](http://w8r.github.io/leaflet-area-select/)\n\n## Include\n\n### Browserify, Webpack\n\n```shell\nnpm install --save leaflet-area-select\n```\n\n```javascript\nvar SelectArea = require(\"leaflet-area-select\");\n// or\nimport SelectArea from \"leaflet-area-select\";\n```\n\n### Browser\n\n```html\n\u003cscript type=\"text/javascript\" src=\"path/to/Map.SelectArea.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nIncluding the handler into the project will automatically add it to the `L.Map`,\nso to enable/disable it you can use methods:\n\n```javascript\nlet map = new L.Map(\"map\", {\n    selectArea: true, // will enable it by default\n});\n\n// or\nmap.selectArea.enable();\n\nmap.on(\"selectarea:selected\", (e) =\u003e {\n    console.log(e.bounds.toBBoxString()); // lon, lat, lon, lat\n});\n\n// You can restrict selection area like this:\nconst bounds = map.getBounds().pad(-0.25); // save current map bounds as restriction area\n// check restricted area on start and move\nmap.selectArea.setValidate((layerPoint) =\u003e {\n    return bounds.contains(this._map.layerPointToLatLng(layerPoint));\n});\n\n// now switch it off\nmap.selectArea.setValidate();\n```\n\n### Key-strokes\n\n```javascript\n// dragging will be enabled and you can\n// start selecting with Ctrl key pressed\nmap.selectArea.setControlKey(true);\n\n// box-zoom will be disabled and you can\n// start selecting with Shift key pressed\nmap.selectArea.setShiftKey(true);\n```\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/w8r"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw8r%2Fleaflet-area-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw8r%2Fleaflet-area-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw8r%2Fleaflet-area-select/lists"}