{"id":14845484,"url":"https://github.com/watergis/mapbox-gl-valhalla","last_synced_at":"2025-04-28T15:42:44.954Z","repository":{"id":52962088,"uuid":"354539831","full_name":"watergis/mapbox-gl-valhalla","owner":"watergis","description":"This module adds a control which can integrate with valhalla api.","archived":false,"fork":false,"pushed_at":"2023-06-22T14:35:57.000Z","size":4506,"stargazers_count":13,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T04:06:14.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://watergis.github.io/mapbox-gl-valhalla/","language":"TypeScript","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/watergis.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},"funding":{"github":["JinIgarashi"],"open_collective":"watergis","custom":["https://www.paypal.me/jinigarashi"]}},"created_at":"2021-04-04T12:38:37.000Z","updated_at":"2025-02-25T08:33:08.000Z","dependencies_parsed_at":"2023-12-08T21:44:54.338Z","dependency_job_id":null,"html_url":"https://github.com/watergis/mapbox-gl-valhalla","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":"0.16666666666666663","last_synced_commit":"ee3c4b6dd9db1ff44810f89cea704925aba0ff77"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fmapbox-gl-valhalla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fmapbox-gl-valhalla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fmapbox-gl-valhalla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fmapbox-gl-valhalla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watergis","download_url":"https://codeload.github.com/watergis/mapbox-gl-valhalla/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250991061,"owners_count":21519202,"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":"2024-09-19T13:00:32.727Z","updated_at":"2025-04-28T15:42:44.934Z","avatar_url":"https://github.com/watergis.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JinIgarashi","https://opencollective.com/watergis","https://www.paypal.me/jinigarashi"],"categories":["User Interface Plugins"],"sub_categories":["JavaScript"],"readme":"# mapbox-gl-valhalla\n![](https://github.com/watergis/mapbox-gl-valhalla/workflows/build/badge.svg)\n![](https://github.com/watergis/mapbox-gl-valhalla/workflows/deploy%20gh-pages/badge.svg)\n![](https://github.com/watergis/mapbox-gl-valhalla/workflows/Release%20Draft/badge.svg)\n![](https://github.com/watergis/mapbox-gl-valhalla/workflows/Node.js%20Package/badge.svg)\n![GitHub](https://img.shields.io/github/license/watergis/mapbox-gl-valhalla)\n\nThis module adds a control which can integrate with valhalla api.\n\n## Installation:\n\n\n```bash\nnpm i @watergis/mapbox-gl-valhalla --save\n```\n\n## Demo:\n\nSee [codesandbox](https://codesandbox.io/s/mapbox-gl-valhalla-nxmiw).\n\nSee [demo](https://watergis.github.io/mapbox-gl-valhalla/#12/-1.08551/35.87063).\n\n![demo.gif](./demo.gif)\n\n## Usage:\n\n```ts\nimport { MapboxValhallaControl} from \"@watergis/mapbox-gl-valhalla\";\nimport '@watergis/mapbox-gl-valhalla/css/styles.css';\nimport mapboxgl from 'mapbox-gl';\n\nconst map = new mapboxgl.Map();\nmap.addControl(new MapboxValhallaControl(\n  'http://localhost:8002',\n  {\n    Contours: [\n      {\n        time: 3,\n        distance: 1,\n        color: 'ff0000',\n      },\n      {\n        time: 5,\n        distance: 2,\n        color: 'ffff00',\n      },\n      {\n        time: 10,\n        distance: 3,\n        color: '0000ff',\n      },\n    ]\n  }\n), 'top-right');\n```\n\n### Options\nYou can specify default option as follows.\n\n- URL\n  - Please specify your URL for valhalla services. eg. `http://localhost:8002`\n- Contours\n  - See the specification of valhalla isochrone API [here](https://valhalla.readthedocs.io/en/latest/api/isochrone/api-reference/#inputs-of-the-isochrone-service).\n  - A JSON array of contour objects with the time in minutes in kilometers and color to use for each isochrone contour. You can specify up to four contours.\n  - default is as follows:\n```js\n[\n  {\n    time: 5,\n    distance: 1,\n    color: 'ff0000',\n  },\n  {\n    time: 10,\n    distance: 2,\n    color: 'ffff00',\n  },\n  {\n    time: 15,\n    distance: 3,\n    color: '0000ff',\n  },\n]\n```\n\n## Development:\n\n```\nyarn run lint # check styling of source code\nyarn run lint:fix # fix styling by eslint\nyarn run dev\n```\n\nopen [http://localhost:8080](http://localhost:8080).\n\nIf there are any changes on source code, it will be reflected automatically.\n\n## Build package:\n\n```\nyarn run build\n```\n\nThe modules will be generated under `dist` folder.\n\n## Deploy to Github pages\n\n```\nyarn run deploy\n```\n\nIt will deploy files under `example` folder to gh-pages.\n\n## How to release\n\n```zsh\nnpm version patch # it increase patch version 0.0.X\nnpm version minor # it increase minor version 0.x.0\nnpm version major # it increase major version x.0.0\ngit push origin main --tag\n# release CI will create draft release in Github pages, then publish it if it is ready.\n# publish CI will deploy npmjs and Github Packages.\n```\n\n## Contribution\n\nThis Mapbox GL Valhalla plugin is still under development. so most welcome any feedbacks and pull request to this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatergis%2Fmapbox-gl-valhalla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatergis%2Fmapbox-gl-valhalla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatergis%2Fmapbox-gl-valhalla/lists"}