This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
MGLMapView printouts should respect pagination #10611
Labels
macOS
Mapbox Maps SDK for macOS
MapKit parity
For feature parity with MapKit on iOS or macOS
refactor
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.
mapbox-gl-native/platform/macos/src/MGLMapView.mm
Lines 785 to 789 in 7e6ca67
mapbox-gl-native/platform/macos/src/MGLMapView.mm
Lines 2935 to 2937 in 2eec5a1
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
The text was updated successfully, but these errors were encountered: