{"id":13426130,"url":"https://github.com/w8r/L.Control.LineStringSelect","last_synced_at":"2025-03-15T21:30:42.709Z","repository":{"id":25207334,"uuid":"28631265","full_name":"w8r/L.Control.LineStringSelect","owner":"w8r","description":"Polyline selection control for Leaflet","archived":false,"fork":false,"pushed_at":"2023-07-18T22:54:29.000Z","size":3255,"stargazers_count":47,"open_issues_count":4,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-15T08:11:19.743Z","etag":null,"topics":["leaflet","leaflet-plugin","linestring","selection"],"latest_commit_sha":null,"homepage":"https://w8r.github.io/L.Control.LineStringSelect","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":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":"2014-12-30T13:10:41.000Z","updated_at":"2023-04-15T16:52:59.000Z","dependencies_parsed_at":"2024-06-21T19:19:39.232Z","dependency_job_id":"c5af8919-ba66-4b78-aff8-2369f0d8d313","html_url":"https://github.com/w8r/L.Control.LineStringSelect","commit_stats":{"total_commits":55,"total_committers":5,"mean_commits":11.0,"dds":"0.23636363636363633","last_synced_commit":"54a542cb2e2b6427cac3722037641d15479da4c5"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w8r%2FL.Control.LineStringSelect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w8r%2FL.Control.LineStringSelect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w8r%2FL.Control.LineStringSelect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w8r%2FL.Control.LineStringSelect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w8r","download_url":"https://codeload.github.com/w8r/L.Control.LineStringSelect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243701460,"owners_count":20333631,"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":["leaflet","leaflet-plugin","linestring","selection"],"created_at":"2024-07-31T00:01:27.066Z","updated_at":"2025-03-15T21:30:41.856Z","avatar_url":"https://github.com/w8r.png","language":"JavaScript","readme":"# L.Control.LineStringSelect [![npm version](https://badge.fury.io/js/leaflet-linestring-select.svg)](https://badge.fury.io/js/leaflet-linestring-select) [![CircleCI](https://circleci.com/gh/w8r/L.Control.LineStringSelect.svg?style=shield)](https://circleci.com/gh/w8r/L.Control.LineStringSelect)\n\n![Screenshot](https://user-images.githubusercontent.com/26884/63355399-5912de00-c366-11e9-9fd9-445d68d4203c.png)\n\nLineString selection tool: you can select a part or a stretch of a polyline on the map. Performance-oriented, uses [rbush](https://github.com/mourner/rbush/) for segment lookup\n\n## [Demo](https://w8r.github.io/L.Control.LineStringSelect)\n\nLook how this thing deals with a coastline polyline consisting of ~500 points\n\n[demo](https://w8r.github.io/L.Control.LineStringSelect)\n\n## Options\n\n| Option | type | default value |\n| - | - | - |\n| `startMarkerClass` | `string` | 'select-marker select-start-marker' |\n| `endMarkerClass` | `string` | 'select-marker select-end-marker' |\n| `movingMarkerClass` | `string` | 'select-marker select-moving-marker' |\n| `name` | `string` | 'leaflet-linestring-select' |\n| `lineWeight` | `number` | 4 |\n| `lineTolerance` | `number` | `L.Browser.mobile ? 10 : 5` |\n| `movingMarkerStyle` | [`L.CircleMarcerOptions`](https://leafletjs.com/reference-1.6.0.html#circlemarker-option) | \u003ccode\u003e{\u003cbr\u003e\u0026nbsp;\u0026nbsp;fillColor: '#fff',\u003cbr\u003e\u0026nbsp;\u0026nbsp;fillOpacity: 1,\u003cbr\u003e\u0026nbsp;\u0026nbsp;weight: 2,\u003cbr\u003e\u0026nbsp;\u0026nbsp;opacity: 0.5,\u003cbr\u003e\u0026nbsp;\u0026nbsp;color: '#000'\u003cbr\u003e}\u003c/code\u003e |\n| `endpointStyle` | [`L.CircleMarcerOptions`](https://leafletjs.com/reference-1.6.0.html#circlemarker-option) | \u003ccode\u003e{\u003cbr\u003e\u0026nbsp;\u0026nbsp;radius: 5,\u003cbr\u003e\u0026nbsp;\u0026nbsp;color: '#111',\u003cbr\u003e\u0026nbsp;\u0026nbsp;fillColor: '#fff',\u003cbr\u003e\u0026nbsp;\u0026nbsp;fillOpacity: 1\u003cbr\u003e}\u003c/code\u003e |\n| `selectionStyle` | [`L.PolylineOptions`](https://leafletjs.com/reference-1.6.0.html#polyline-option) | \u003ccode\u003e{\u003cbr\u003e\u0026nbsp;\u0026nbsp;color: '#0ff',\u003cbr\u003e\u0026nbsp;\u0026nbsp;opacity: 1\u003cbr\u003e}\u003ccode\u003e |\n| `useTouch` | `boolean` | `L.Browser.mobile` |\n| `position` | `'topright'|'topleft'|'bottomleft'|'bottomright'` | `'topright'` |\n\n## API\n\n`.enable({layer: polyline, feature: feature})`\nEnables control, initializes it with provided polyline. You can pass GeoJSON object as well, otherwise it will be auto-generated\n\n`.disable()`\nDisable control, remove handlers and selection\n\n`.reset()`\nReset selection\n\n`.selectMeters(startMeter, endMeter)`\nSelect stretch by meter distances from linestring start.\n\n`.toGeoJSON()`\nReturns selection GeoJSON\n\n`.getSelection()`\nReturns array of selection `L.LatLng`s\n\n### Events\n\n`selection`\nSelection changed or finished.\n\n`reset`\nSelection cleared\n\n`select:start : {pos: \u003cL.LatLng\u003e}`\nFirst point set\n\n`select:end : {pos: \u003cL.LatLng\u003e}`\nSecond point set\n\n## Usage\n\n```javascript\nnpm install --save leaflet-linestring-select\n...\nvar Select = require('leaflet-linestring-select');\n```\n\nor\n\n```\n\u003cscript type=\"text/javascript\" src=\"leaflet.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"path/to/L.Control.LineStringSelect.min.js\"\u003e\u003c/script\u003e\n```\n\nSee `/examples/app.js` for initialization and other things\n\n## Requirements\n\n - `leaflet@\u003e=1.x`\n - `rbush@\u003e=3.x`\n\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2019 Alexander Milevski\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw8r%2FL.Control.LineStringSelect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw8r%2FL.Control.LineStringSelect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw8r%2FL.Control.LineStringSelect/lists"}