{"id":26477424,"url":"https://github.com/jack-weilage/svelte-mapbox","last_synced_at":"2025-08-20T10:28:21.482Z","repository":{"id":203211087,"uuid":"709065607","full_name":"jack-weilage/svelte-mapbox","owner":"jack-weilage","description":"A simple and powerful Svelte wrapper around `mapbox-gl`","archived":false,"fork":false,"pushed_at":"2024-02-09T18:13:01.000Z","size":428,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T12:02:53.364Z","etag":null,"topics":["mapbox","mapbox-gl","svelte","sveltekit"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/svelte-mapbox","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jack-weilage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-10-24T00:07:37.000Z","updated_at":"2024-09-27T18:23:25.000Z","dependencies_parsed_at":"2024-02-01T21:37:36.075Z","dependency_job_id":"4a4c0d8d-8a38-4105-ab21-b81cefe7c3f6","html_url":"https://github.com/jack-weilage/svelte-mapbox","commit_stats":null,"previous_names":["jack-weilage/svelte-mapbox"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-weilage%2Fsvelte-mapbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-weilage%2Fsvelte-mapbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-weilage%2Fsvelte-mapbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-weilage%2Fsvelte-mapbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jack-weilage","download_url":"https://codeload.github.com/jack-weilage/svelte-mapbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244525958,"owners_count":20466612,"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":["mapbox","mapbox-gl","svelte","sveltekit"],"created_at":"2025-03-20T00:21:28.124Z","updated_at":"2025-03-20T00:21:28.591Z","avatar_url":"https://github.com/jack-weilage.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-mapbox\n\n## Components\n\n### Proxy Components\n\nProxy components act as convenient wrappers for necessary boilerplate.\n\n- Image ([Mapbox reference](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#addimage))\n- Map ([Mapbox reference](https://docs.mapbox.com/mapbox-gl-js/api/map/))\n- Source ([Mapbox reference](https://docs.mapbox.com/mapbox-gl-js/api/sources/))\n- Layer ([Mapbox reference](https://docs.mapbox.com/style-spec/reference/layers/))\n\n### DOM Components\n\nDOM components add necessary DOM elements and bind them to `mapbox-gl`.\n\n- Marker ([Mapbox reference](https://docs.mapbox.com/mapbox-gl-js/api/markers/#marker))\n- Popup ([Mapbox reference](https://docs.mapbox.com/mapbox-gl-js/api/markers/#popup))\n- Control ([Mapbox reference](https://docs.mapbox.com/mapbox-gl-js/api/markers/#icontrol))\n\n## Getting Started\n\nInstall via NPM/PNPM/Yarn/Bun:\n\n```sh\nnpm install svelte-mapbox --save\n```\n\nImport and use components:\n\n```jsx\n\u003cscript\u003e\n    import { Map, Source, Marker, Popup } from 'svelte-mapbox'\n\u003c/script\u003e\n\n\u003cMap options={{\n    accessToken: 'YOUR_MAPBOX_ACCESS_TOKEN'\n    style: 'mapbox://styles/mapbox/streets-v12',\n    center: [12.550343, 55.665957],\n    zoom: 8,\n}}\u003e\n    \u003cMarker lngLat={[12.550343, 55.665957]}\u003e\n        \u003cPopup\u003eBlue marker popup\u003c/Popup\u003e\n    \u003c/Marker\u003e\n    \u003cMarker lngLat={[12.65147, 55.608166]} options={{ color: 'black', rotation: 45 }}\u003e\n        \u003cPopup\u003eBlack tilted marker popup\u003c/Popup\u003e\n    \u003c/Marker\u003e\n\u003c/Map\u003e\n```\n\n## API Design\n\n`svelte-mapbox` attempts to stick as close as possible to the official Mapbox API, but there are some differences. If you know `mapbox-gl`, you should know `svelte-mapbox`.\n\nGenerally, if you can add something to a `Map` object, you can import it as a component. If you can specify options for that thing, you can pass them as `options` to the component.\n\nIf you can call a `set` method on an object, you can pass it as a prop. As an example, calling `setLngLat` can be replaced with the `lngLat` prop.\n\nIf you want to simply access the underlying object, you can use `bind:[component type]`. As an example, `bind:map` returns the `Map` object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack-weilage%2Fsvelte-mapbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjack-weilage%2Fsvelte-mapbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack-weilage%2Fsvelte-mapbox/lists"}