Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Map tiles resolution on retina device in screenshot is lower than on screen #589

Open
joshfisher opened this issue Feb 20, 2015 · 3 comments
Labels

Comments

@joshfisher
Copy link

When using RMMapView.takeSnapshot, it looks like snapshot is using lower resolution tiles. Strangely, the markers appear to be captured at the correct resolution. Also, the stacking order of annotations is different in the snapshot vs the simulator in the top left corner. Attached are images from the simulator and the snapshot, for comparison. I'm seeing the same behavior on the simulator and a device.

I'm using mapbox-ios-sdk 1.6.0, iOS 8, iPhone 6

simulator screengrab
simulator

RMMapView.takeSnapshot result
snapshot

@joshfisher joshfisher changed the title Map tiles resolution in screenshot on retina device Map tiles resolution on retina device in screenshot is lower than on screen Feb 20, 2015
@joshfisher
Copy link
Author

@incanus Any thoughts on this issue?

@incanus incanus added the bug label Mar 4, 2015
@incanus
Copy link
Contributor

incanus commented Mar 4, 2015

Hmm, the place to look is in this routine:

https://github.com/mapbox/mapbox-ios-sdk/blob/dd26736adb6c2769accb99bd687509a0119780d6/MapView/Map/RMMapTiledLayerView.m#L94

That's where the branching logic happens between drawing within CATiledLayer and drawing to a CGContext for snapshot purposes. Unfortunately when you draw to your own CATiledLayer, you can't merely request a layer snapshot of it like with normal views, so that's why this exists.

It sounds like there is a discrepancy between the two zoom levels to grab in this branching.

As for the annotations, I'm not sure what's happening there. The snapshot routine only toggles their superlayer's visibility (though not in your "capture overlay" case) and doesn't alter ordering. Probably need a call to -correctOrderingOfAllAnnotations somewhere.

We don't have the bandwidth to look at this right now, but those are some pointers until we do.

@drhaynes
Copy link

@joshfisher have fixed this issue at OrdnanceSurvey in our fork, see here: https://github.com/OrdnanceSurvey/mapbox-ios-sdk

Have issued PR upstream to Mapbox here: #611

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants