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