@watergis/mapbox-gl-print
v1.0.1
Published
This module adds print control to mapbox-gl.
Downloads
6
Readme
mapbox-gl-print
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.