{"id":25636595,"url":"https://github.com/bbecquet/leaflet.polylineoffset","last_synced_at":"2025-04-06T08:14:05.798Z","repository":{"id":21545613,"uuid":"24865204","full_name":"bbecquet/Leaflet.PolylineOffset","owner":"bbecquet","description":"Apply a relative pixel offset to polylines without changing their coordinates.","archived":false,"fork":false,"pushed_at":"2020-11-22T11:30:57.000Z","size":34,"stargazers_count":154,"open_issues_count":16,"forks_count":32,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-31T06:02:12.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bbecquet.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}},"created_at":"2014-10-06T21:15:53.000Z","updated_at":"2025-03-06T21:18:57.000Z","dependencies_parsed_at":"2022-07-27T02:32:18.863Z","dependency_job_id":null,"html_url":"https://github.com/bbecquet/Leaflet.PolylineOffset","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2FLeaflet.PolylineOffset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2FLeaflet.PolylineOffset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2FLeaflet.PolylineOffset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2FLeaflet.PolylineOffset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbecquet","download_url":"https://codeload.github.com/bbecquet/Leaflet.PolylineOffset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451665,"owners_count":20940944,"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":[],"created_at":"2025-02-23T00:48:51.383Z","updated_at":"2025-04-06T08:14:05.691Z","avatar_url":"https://github.com/bbecquet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Leaflet Polyline Offset\n===\nWorks with Leaflet \u003e= 1.0.\n\nThis plugin adds to Leaflet `Polyline`s the ability to be drawn with a relative pixel offset, without modifying their actual `LatLng`s. The offset value can be either negative or positive, for left- or right-side offset, and remains constant across zoom levels.\n\n## Install with NPM\n\n```bash\nnpm install leaflet-polylineoffset\n```\n\n## Use cases and demos\n\nLine offsetting is the process of drawing a line parallel to an existant one, at a fixed distance. It's not a simple (x,y) translation of the whole shape, as it shouldn't overlap. It can be used to visually emphasize different properties of the same linear feature, or achieve complex composite styling.\n\nThis plugin brings this feature to Leaflet, to apply to client-side vectors.\n\nDemos are clearer than words:\n* [Basic demo](http://bbecquet.github.io/Leaflet.PolylineOffset/examples/example.html). The dashed line is the \"model\", with no offset applied. Red is with a -10px offset, green is with a 5px offset. The three are distinct `Polyline` objects but uses the same coordinate array.\n* [Cycle lanes](http://bbecquet.github.io/Leaflet.PolylineOffset/examples/example_cycle.html). Drawing a road with two directions of cycle lanes, a main one and one shared.\n* [Bus lines](http://bbecquet.github.io/Leaflet.PolylineOffset/examples/example_bus.html). A more complex demo. Offsets are computed automatically depending on the number of bus lines using the same segment. Other non-offset polylines are used to achieve the white and black outline effect.\n\n## Usage\n\nThe plugin adds offset capabilities directly to the `L.Polyline` class.\n```javascript\n// Instantiate a normal Polyline with an 'offset' options, in pixels.\nvar pl = L.polyline([[48.8508, 2.3455], [48.8497, 2.3504], [48.8494, 2.35654]], {\n  offset: 5\n});\n\n// Setting the 'offset' property through the 'setStyle' method won't work.\n// If you want to set the offset afterwards, use 'setOffset'.\npl.setOffset(-10);\n\n// To cancel the offset, simply set it to 0\npl.setOffset(0);\n```\n\n## License\nMIT.\n\n## Contributors\n* [Benjamin Becquet](https://github.com/bbecquet) (original author)\n* [sanderd17](https://github.com/sanderd17)\n* [jellevoost](https://github.com/jellevoost)\n* [ghybs](https://github.com/ghybs)\n* [BartWaardenburg](https://github.com/BartWaardenburg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbecquet%2Fleaflet.polylineoffset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbecquet%2Fleaflet.polylineoffset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbecquet%2Fleaflet.polylineoffset/lists"}