mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

MGLMapView printouts should respect pagination #10611

Open 1ec5 opened 6 years ago

1ec5 commented 6 years ago

The macOS SDK implementation of MGLMapView currently implements printing with a little bit of custom drawing code. While elegant, it means a document containing the map view can only print the exact viewport currently visible in the map view. Instead, MGLMapView or macosapp should use MGLMapSnapshotter, which is capable of rendering a map at an arbitrary size and scale. This will allow the printout to respect the page boundaries and pagination.

https://github.com/mapbox/mapbox-gl-native/blob/7e6ca6793a3fe508d4111a11a5887362707ddd26/platform/macos/src/MGLMapView.mm#L785-L789 https://github.com/mapbox/mapbox-gl-native/blob/2eec5a19803a01e21d5793706ae69ac0d886cee5/platform/macos/src/MGLMapView.mm#L2935-L2937

We may want to wait until #9914 lands in order to preserve any annotations and other style modifications in the printed map. Alternatively, we could use MGLMapSnapshot’s coordinate conversion methods to manually add the annotations to the map, but it would be a fair amount of work for MGLOverlays.

/cc @fabian-guerra

stale[bot] commented 5 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.