Package Exports
- @watergis/mapbox-gl-export
- @watergis/mapbox-gl-export/dist/mapbox-gl-export.css
Readme
mapbox-gl-export
This module adds control which can export PDF and images.
This module is using source code of mpetroff/print-maps. I just adopted this library to normal Mapbox GL Plugin. Thanks so much to develop this library!
for Maplibre GL users
Please consider to use maplibre-gl-export plugin for Maplibre GL.
Installation
pnpm add --save-dev @watergis/maplibre-gl-exportDemo & usage
See documentation.
Attribution
When you use exported map, please includes attribution as follows.
If you can include HTML, use this code snippet that includes links to Mapbox & OpenStreetMap:
© NARWASSCO, Ltd. © <a href='https://www.mapbox.com/about/maps/'>Mapbox</a> © <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> <strong><a href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a></strong>Powered by the United Nations Vector Tile ToolkitFor print output or if you can’t include links, use this text-only attribution:
© NARWASSCO, Ltd. ©Mapbox ©OpenStreetMap contributors, Powered by the United Nations Vector Tile Toolkit© NARWASSCO, Ltd. is default example of map data by Narok Water and Sewerage Services Co., Ltd., Kenya. If you don't use current map, you don't need to use this attribution.
Also, default example is using base map by United Nation Vector Tile Toolkit. That is why Powered by the United Nations Vector Tile Toolkit is included in above.
Development
pnpm lint
pnpm format
pnpm devopen http://localhost:5173.
If there are any changes on source code, it will be reflected automatically.
Build package
pnpm buildThe modules will be generated under dist folder.