Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Implement transparency in MGLMapSnapshotter #10118

Closed
fabian-guerra opened this issue Oct 3, 2017 · 3 comments
Closed

Implement transparency in MGLMapSnapshotter #10118

fabian-guerra opened this issue Oct 3, 2017 · 3 comments
Labels
archived Archived because of inactivity feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS

Comments

@fabian-guerra
Copy link
Contributor

As is asserted in this comment a MGLMapView is not necessarily opaque. MGLMapSnapshotter should implement an alpha channel if the background style layer has a non-opaque fill color.

@fabian-guerra fabian-guerra added feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Oct 3, 2017
@1ec5
Copy link
Contributor

1ec5 commented Oct 4, 2017

This should just be a matter of passing YES in as the second parameter to UIGraphicsBeginImageContextWithOptions():

UIGraphicsBeginImageContextWithOptions(mglImage.size, NO, self.options.scale);

If the image ends up getting saved out in a format that doesn't support transparency, like JPEG, the output will be no worse than it would be without this change. For images that require no alpha channel, which is the usual case, I suppose there would be a marginal increase in file size, but it shouldn't matter greatly.

@1ec5 1ec5 changed the title Implement opaqueness in MGLMapSnapshotter Implement transparency in MGLMapSnapshotter Oct 4, 2017
@1ec5
Copy link
Contributor

1ec5 commented Oct 4, 2017

if the background style layer has a non-opaque fill color

This would require #9914, although per #10118 (comment), I don’t think it’s strictly necessary to enable opacity in any case.

@stale stale bot added the archived Archived because of inactivity label Nov 3, 2018
@stale
Copy link

stale bot commented Dec 3, 2018

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

@stale stale bot closed this as completed Dec 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

No branches or pull requests

2 participants