Outdooractive / route-me

Open source map library for iOS
Other
122 stars 400 forks source link

Assertion failure with retina display #57

Closed jan-christiansen closed 12 years ago

jan-christiansen commented 12 years ago

My application crashes with an assertion failure in URLForTile when I zoom in quickly in the simulator with retina display or on a device with retina display. Is it possible that commit 7a452e70b2e2e94c7cdb0280deac5453c6e24bcb has introduced a bug.

jan-christiansen commented 12 years ago

PS: This problem only appears if adjustTilesForRetinaDisplay is set to NO. Do I have to set the property to YES if I want to support retina devices?

trasch commented 12 years ago

If you set this option to YES, the tiles will have the same size as on non-retina devices. If you set it to NO, every pixel in the tile image will be mapped to one pixel on the display - but the option is itself independent from retina displays, your app should work no matter what you set here.

I think the bug you are experiencing here is that the tiled layer will sometimes zoom in too far, i.e. beyond the tile source's bounds if you set adjustTilesForRetinaDisplay to NO.

Setting it to YES should actually fix your problem, but I'll check if there is a better option.

incanus commented 12 years ago

Took me a while to notice this myself, when my map was zooming to z17 and requesting tiles for z18. Couldn't figure out why until I tracked this change down. Not sure I'm following the logic here? Now that we have retina-optimized 256px tiles, I'm doing my own detection with [[UIScreen mainScreen] scale], then setting the tile source accordingly. I'm leaving adjustTilesForRetinaDisplay as NO since I'm taking care of things myself, but then I'm ending up with requests for a zoom greater than what I have.

incanus commented 12 years ago

I don't think the issue I'm seeing is related to this. See #66.

trasch commented 12 years ago

@plancalculus I commited a few patches meanwhile, do they by any chance fix your problem as well?

trasch commented 12 years ago

I can't replicate this bug, can I assume that this is fixed now?

If not, please reopen this issue and give me some example code that shows the issue (I tried the sample code included with route-me as well as my own apps)

jan-christiansen commented 12 years ago

Sorry for the delay I have merged your patches into my fork and did not have any problems either. Thanks for the fix.