{"id":17298208,"url":"https://github.com/wang1212/mapbox-gl-utils-source","last_synced_at":"2025-04-14T12:22:54.113Z","repository":{"id":42012358,"uuid":"266663320","full_name":"wang1212/mapbox-gl-utils-source","owner":"wang1212","description":":earth_asia: Mapbox-GL utils, commonly used map service data sources. | 常用的地图服务数据源。","archived":false,"fork":false,"pushed_at":"2023-12-15T20:31:55.000Z","size":513,"stargazers_count":5,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T01:44:32.460Z","etag":null,"topics":["mapbox-gl","mapbox-gl-js","utils"],"latest_commit_sha":null,"homepage":"","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/wang1212.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-05-25T02:16:41.000Z","updated_at":"2024-11-04T09:07:31.000Z","dependencies_parsed_at":"2023-01-26T18:01:48.493Z","dependency_job_id":null,"html_url":"https://github.com/wang1212/mapbox-gl-utils-source","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"wang1212/create-lib-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang1212%2Fmapbox-gl-utils-source","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang1212%2Fmapbox-gl-utils-source/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang1212%2Fmapbox-gl-utils-source/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang1212%2Fmapbox-gl-utils-source/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wang1212","download_url":"https://codeload.github.com/wang1212/mapbox-gl-utils-source/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248878583,"owners_count":21176340,"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-gl","mapbox-gl-js","utils"],"created_at":"2024-10-15T11:18:26.361Z","updated_at":"2025-04-14T12:22:54.058Z","avatar_url":"https://github.com/wang1212.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mapbox-GL utils - Source\n\nThis is a utils of [Mapbox-GL](https://docs.mapbox.com/mapbox-gl-js/overview/).\n\nThe tool provides a data [Source](https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/) for daily use.\n\n[Demo](./test/index.html)\n\n[English](./README.md) | [简体中文](./README.zh-CN.md)\n\n## Content\n\nIncluding the following map services:\n\n-   TianDiTu\n\n    -   TianDiTu.satellite.map\n    -   TianDiTu.satellite.annotation\n    -   TianDiTu.streets.map\n    -   TianDiTu.streets.annotation\n\n-   Google\n\n    -   Google.satellite.Map\n    -   Google.streets.mapWithAnnotation\n\n-   OpenStreetMap\n\n    -   OSM.streets.mapWithAnnotation\n\n## Bundle\n\nThe following bundles are provided:\n\n    types/\n    build/\n    ├── bundle.js\n    ├── bundle.min.js\n    ├── bundle.esm.js\n    ├── bundle.esm.min.js\n    ├── bundle.cjs.js\n    ├── bundle.cjs.min.js\n    ├── bundle.umd.js\n    └── bundle.umd.min.js\n\nIt also provides the corresponding **sourcemap** file.\n\n## Usage\n\n### Browser\n\nIn the browser, referenced by the `\u003cscript\u003e` tag:\n\n```html\n\u003cscript src=\"https://api.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.js\"\u003e\u003c/script\u003e\n\u003c!-- Reference the utils library --\u003e\n\u003cscript src=\"../build/bundle.min.js\"\u003e\u003c/script\u003e\n```\n\nIt is mounted at `mapboxgl._utils.Source`, so you can use it like this:\n\n```js\nconst { TianDiTu, Google } = mapboxgl._utils.Source\n```\n\n**_If you can't get the bundle file, you can try to [build it yourself](#build)._**\n\n### Node.js\n\nInstall via npm:\n\n```bash\nnpm install mapbox-gl-utils-source\n```\n\nUse it like this:\n\n```js\n// ES Module\nimport { TianDiTu, Google } from 'mapbox-gl-utils-source'\n\n// CommonJS\nconst utilsSource = require('mapbox-gl-utils-source')\n```\n\n## Build\n\nIf you cannot get the bundle file, or you want to add additional map service resources and other reasons, you can build your own.\n\nFirst, `clone` to local\n\n```bash\ngit clone https://github.com/wang1212/mapbox-gl-utils-source.git \u003cdir\u003e\ncd \u003cdir\u003e/\nnpm install\n```\n\nThen you can modify the files in **src/** by yourself, and run the following command when finished:\n\n```bash\nnpm run build\n```\n\nThe bundle file will be generated in the **build/** folder, include **sourcemap** file.\n\n## License\n\n[MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwang1212%2Fmapbox-gl-utils-source","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwang1212%2Fmapbox-gl-utils-source","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwang1212%2Fmapbox-gl-utils-source/lists"}