{"id":16535427,"url":"https://github.com/qiuxiang/canvas-tilemap","last_synced_at":"2025-10-10T02:07:11.239Z","repository":{"id":65695990,"uuid":"596161479","full_name":"qiuxiang/canvas-tilemap","owner":"qiuxiang","description":"Super smooth 2d tilemap build with canvas2d.","archived":false,"fork":false,"pushed_at":"2023-04-14T03:35:31.000Z","size":128,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-13T11:57:31.489Z","etag":null,"topics":["canvas","maps","tilemap"],"latest_commit_sha":null,"homepage":"https://qiuxiang.github.io/canvas-tilemap/","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/qiuxiang.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":"2023-02-01T15:44:00.000Z","updated_at":"2025-02-17T08:56:15.000Z","dependencies_parsed_at":"2025-02-13T11:43:27.424Z","dependency_job_id":null,"html_url":"https://github.com/qiuxiang/canvas-tilemap","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/qiuxiang/canvas-tilemap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiuxiang%2Fcanvas-tilemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiuxiang%2Fcanvas-tilemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiuxiang%2Fcanvas-tilemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiuxiang%2Fcanvas-tilemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qiuxiang","download_url":"https://codeload.github.com/qiuxiang/canvas-tilemap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiuxiang%2Fcanvas-tilemap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002528,"owners_count":26083399,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["canvas","maps","tilemap"],"created_at":"2024-10-11T18:27:26.141Z","updated_at":"2025-10-10T02:07:11.227Z","avatar_url":"https://github.com/qiuxiang.png","language":"TypeScript","readme":"# canvas-tilemap\n\nSuper smooth 2d tilemap build with canvas2d.\n\nhttps://user-images.githubusercontent.com/1709072/216881683-b17ac057-c1f3-435f-8c98-9486d1c631e7.mp4\n\n## Install\n\n```\nnpm i @7c00/canvas-tilemap\n```\n\n## Usage\n\n### Create tilemap\n\n```html\n\u003cdiv id=\"tilemap\"\u003e\u003c/div\u003e\n```\n\n```typescript\nconst tilemap = new Tilemap({\n  element: \"#tilemap\",\n  size: [12288, 12288],\n  origin: [3568, 6286],\n});\n```\n\n### Add TileLayer\n\n```typescript\ntilemap.tileLayers.add(\n  new TileLayer(tilemap, {\n    minZoom: 10,\n    maxZoom: 13,\n    getTileUrl(x, y, z) {\n      return `https://assets.yuanshen.site/tiles_yxg2/${z}/${x}_${y}.png`;\n    },\n  })\n);\n```\n\n### Add MarkerLayer\n```typescript\nconst image = new Image();\nimage.src = \"https://assets.yuanshen.site/icons/127.png\";\nimage.addEventListener(\"load\", () =\u003e {\n  tilemap.draw();\n});\nconst markerLayer = new MarkerLayer(tilemap, {\n  positions: [\n    [-999, 3766],\n    [-1685, 2359],\n    [112, 1365],\n    [1231, 575],\n    [1202, -346],\n    [1737, 14],\n    [3101, 422],\n    [3488, 215],\n    [3147, 1495],\n    [3455, 801],\n    [4229, 888],\n    [2804, 2379],\n    [3073, 3269],\n    [2716, 4054],\n    [3845, 2665],\n    [4522, 2307],\n    [6108, 974],\n    [5866, 205],\n    [5178, 29],\n    [6231, -411],\n    [2095, -591],\n    [1188, -4131],\n    [7413, -2412],\n    [4783, 5059],\n  ],\n  image: image,\n});\ntilemap.markerLayers.add(markerLayer);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiuxiang%2Fcanvas-tilemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqiuxiang%2Fcanvas-tilemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiuxiang%2Fcanvas-tilemap/lists"}