{"id":25636606,"url":"https://github.com/bbecquet/simple-static-map-server","last_synced_at":"2025-04-14T22:11:32.534Z","repository":{"id":42621861,"uuid":"276118798","full_name":"bbecquet/simple-static-map-server","owner":"bbecquet","description":"Raster map service based on MapLibre GL JS","archived":false,"fork":false,"pushed_at":"2024-12-17T09:46:47.000Z","size":407,"stargazers_count":10,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T10:11:39.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/bbecquet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-30T14:13:50.000Z","updated_at":"2025-03-23T12:20:35.000Z","dependencies_parsed_at":"2024-12-17T10:34:28.149Z","dependency_job_id":null,"html_url":"https://github.com/bbecquet/simple-static-map-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2Fsimple-static-map-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2Fsimple-static-map-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2Fsimple-static-map-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbecquet%2Fsimple-static-map-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbecquet","download_url":"https://codeload.github.com/bbecquet/simple-static-map-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968914,"owners_count":21191162,"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.841Z","updated_at":"2025-04-14T22:11:32.500Z","avatar_url":"https://github.com/bbecquet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-static-map-server\n\nThis project comes from a silly idea: creating a raster map web server, using the browser lib [MapLibre GL JS](https://github.com/maplibre/maplibre-gl-js) as a rendering engine instead of the low-level [MapLibre GL native](https://github.com/maplibre/maplibre-gl-native) lib.\n\nUnder the hood, it launches a headless Chromium browser with [Puppeteer](https://github.com/puppeteer/puppeteer), go to a special page with a Maplibre GL JS map instance, and takes screenshots to serve as images.\n\n## Example\n\nRequest: `http://localhost:3000/map?width=600\u0026height=300\u0026zoom=12\u0026center=-3.825,57.185\u0026style=osm`\n\nResult:\n\n![Result of the above request](./imgs/example.png)\n\n## Usage\n\n### Configuration\n\nThe [`mapstyles.json`](./mapstyles.json) file contains an array of available map styles. Each is defined by 3 properties:\n\n- `name`: the style name, used to specify which style to render for multiple style instances\n- `styleUrl`: the url of the vector map style definition in JSON\n- `attribution`: the attribution string, to display proper copyright information on each generated image\n\nYou should replace the styles in the current file by styles you own or have the rights to use.\n\n#### Raster tiles\n\nAlternatively, to use raster tiles, you can define a `rasterTiles` object in place of `styleUrl`.\nSee the current [`mapstyles.json`](./mapstyles.json) file for an example.\n\n### Starting the server\n\n```\n$ node index.js\n```\n\nBy default, it runs on the port 3000. You can specify another port using an env var.\n\n```\n$ PORT=3666 node index.js\n```\n\n### Requests\n\nThen go to `http://localhost:\u003cport\u003e/map` and send queries with those query string parameters:\n\n| Parameter | Description                                                    | Default             |\n| --------- | -------------------------------------------------------------- | ------------------- |\n| `style`   | Name of the map style, as defined in the `mapstyles.json` file | First defined style |\n| `center`  | Coordinates of the center, as `\u003clongitude\u003e,\u003clatitude\u003e`         | `0,0`               |\n| `zoom`    | Zoom level                                                     | `3`                 |\n| `width`   | Image width in pixels                                          | `400`               |\n| `height`  | Image height in pixels                                         | `400`               |\n| `type`    | `png` or `jpeg`                                                | `png`               |\n| `timeout` | Query timeout in milliseconds                                  | `30000`             |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbecquet%2Fsimple-static-map-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbecquet%2Fsimple-static-map-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbecquet%2Fsimple-static-map-server/lists"}