{"id":13929853,"url":"https://github.com/camptocamp/inkmap","last_synced_at":"2025-07-19T12:30:38.276Z","repository":{"id":37003553,"uuid":"308686633","full_name":"camptocamp/inkmap","owner":"camptocamp","description":"A library for generating high-quality, printable maps on the browser.","archived":false,"fork":false,"pushed_at":"2025-07-17T13:10:26.000Z","size":5987,"stargazers_count":89,"open_issues_count":8,"forks_count":17,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-07-17T14:26:10.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/camptocamp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2020-10-30T16:33:04.000Z","updated_at":"2025-07-17T13:07:10.000Z","dependencies_parsed_at":"2024-01-17T05:24:44.912Z","dependency_job_id":"7ce37181-7432-40a5-b078-a649c750d095","html_url":"https://github.com/camptocamp/inkmap","commit_stats":{"total_commits":207,"total_committers":12,"mean_commits":17.25,"dds":0.3623188405797102,"last_synced_commit":"ff7137ea1ce8f6717df17a5a3aa36cc09b01d20a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/camptocamp/inkmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Finkmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Finkmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Finkmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Finkmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camptocamp","download_url":"https://codeload.github.com/camptocamp/inkmap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Finkmap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265934185,"owners_count":23852086,"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-08-07T18:02:35.491Z","updated_at":"2025-07-19T12:30:38.270Z","avatar_url":"https://github.com/camptocamp.png","language":"JavaScript","readme":"\u003cdiv style=\"text-align: center\"\u003e\u003cstrong\u003einkmap\u003c/strong\u003e, a library for generating high resolution maps in the browser\u003c/div\u003e\n\n\n##### [Live demo here!](https://camptocamp.github.io/inkmap/main/)\n\n## Introduction\n\n**inkmap** is based on [OpenLayers](https://www.openlayers.org) and will generate maps in PNG format based on a given JSON specification.\n\n**inkmap** can handle long-running jobs (e.g. A0 format in 300 dpi) and provides an API for following a job progress.\nIt uses a service worker in the background provided the user browser supports [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas), and falls back (almost) seamlessly to the main thread if not.\n\nPlease note that the first version of **inkmap** has been entirely funded and supported by the [French Ministry of Ecology](https://www.ecologie.gouv.fr/) as part of their Descartes web mapping toolkit, hosted here: https://adullact.net/projects/descartes/\n\n## Usage\n\n### Basic\n\nTo include the library in your project:\n```bash\n$ npm install --save @camptocamp/inkmap\n```\n\nThen import the different methods from the `inkmap` package:\n```js\nimport { print, downloadBlob } from '@camptocamp/inkmap';\n\nprint({\n  layers: [ ... ],\n  projection: 'EPSG:4326',\n  ...\n}).then(downloadBlob);\n```\n\n### Advanced\n\n**inkmap** offers advanced job monitoring through the use of Observables provided by the [rxjs](https://rxjs.dev/) library.\n\nObservables are different from Promises in that they can emit *multiple values* instead of just one, and are a very good fit for progress reporting.\n\nTo use an Observable, simply call its `subscribe()` method with a function as argument. The function will be called anytime a new value is emitted, like so:\n```js\nimport { getJobStatus } from '@camptocamp/inkmap';\n\n...\n\ngetJobStatus(jobId).subscribe((jobStatus) =\u003e {\n  // do something with the status\n});\n```\n\nNote that for *long-lived Observables* (i.e. Observables that never completes) it is important to call `unsubscribe()` when the emitted values are not needed anymore. Open subscriptions to Observables might create memory leaks.\n\n### Enabling the service worker\n\n**inkmap** can _and will_ use a dedicated service worker for running print jobs if given the chance. This offers the following\nadvantages:\n* Jobs run in a separate thread, meaning the user navigation will not be impacted at all by any CPU-intensive task\n* The service worker isn't tied to a window or tab, so jobs will continue running when the tab is closed (and even when the browser is closed, depending on the platform)\n* Push notifications might be sent to the user when a print job complete (not implemented yet)\n\n**To enable this, the `inkmap-worker.js` file located in the `dist` folder must be published on the same path as the application\nusing inkmap**.\n\nThe worker file can be published either using a symbolic link or by actually copying the file, for example in the application build pipeline.\n\nIf using Webpack to build the application, a solution is to use the [CopyWebpackPlugin](https://webpack.js.org/plugins/copy-webpack-plugin/):\n\n```js\nexport default {\n  ...\n  plugins: [\n     new CopyWebpackPlugin([\n       {\n         from: 'node_modules/@camptocamp/inkmap/dist/inkmap-worker.js',\n         to: 'dist'\n       },\n     ]),\n  ],\n  ...\n}\n```\n\n## API\n\nImportant note: all API functions are named exports from the `inkmap` package.\n\nSee the [API documentation](https://camptocamp.github.io/inkmap/main/docs/) website.\n\n## Architecture\n\nUnder the hood, `inkmap` will attempt to install a service worker on the page it is called. The service worker will then be in charge\nof loading all the map images and data, composing them together and giving them back to the application code.\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n\n## License\n\n[CeCILL-C](https://cecill.info/licences/Licence_CeCILL-C_V1-en.txt)\n","funding_links":[],"categories":["others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamptocamp%2Finkmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamptocamp%2Finkmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamptocamp%2Finkmap/lists"}