@watergis/mapbox-gl-print
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

mapbox-gl-print

GitHub

This module adds print control to mapbox-gl.

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!

Installation:

npm i @watergis/mapbox-gl-print --save

Demo:

See demo.

Test:

npm run build
npm start

open http://localhost:8080.

Usage:

import MapboxPrintControl from "@watergis/mapbox-gl-print";
import '@watergis/mapbox-gl-print/css/styles.css';
import mapboxgl from 'mapbox-gl';

const map = new mapboxgl.Map();
map.addControl(new MapboxPrintControl(), 'top-right');
});

Attribution

When you use printed 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 Toolkit

For 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.

Contribution

This Mapbox GL Print Control is still under development, especially exporting to PDF is not working well. so most welcome any feedbacks and pull request to this repository.

Package Sidebar

Install

npm i @watergis/mapbox-gl-print

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

23.6 kB

Total Files

10

Last publish

Collaborators

  • j_igarashi