Outdooractive/route-me

retina + XIB issue

Closed this issue · 5 comments

I'm rounding the bend on #59 location services, but one issue I've just noticed, which I thought was related to #57 retina assertion problem but isn't, is related to creating a map view in a XIB vs. in code.

If on a retina device and created in XIB, while the maxZoom is set property and reports properly, the scroll view can be zoomed in one level beyond, resulting in empty tiles (and failed requests for them).

In code (e.g., initWithFrame), this doesn't happen, nor does it happen on non-retina devices. I'm not using adjustTilesForRetinaDisplay, either (that was a red herring).

Any ideas? I can code up a sample if it helps, but you can see this in action with the map views in this project (code init) vs. this project (XIB init). Regardless of the behavior of the apps, try zooming in beyond the max of 17 in both.

One difference that I can see is that the mapbox-ios-example uses adjustTilesForRetinaDisplay = YES (not the OnlineLayerViewController, though, due to the two different tile sources), while mapbox-me uses adjustTilesForRetinaDisplay = NO (implicit via performInitializationWithTilesource:...).

Actually, I think there is some initialization missing after setting a tile source, something which is done in createMapView, like setting the contentSize. I'll check this.

Sorry, should have been more clear. I'm just talking about the Online dual-URL view controller.

Justin R. Miller
http://codesorcery.net

On Jun 1, 2012, at 3:11 AM, Thomas Rasch reply@reply.github.com wrote:

One difference that I can see is that the mapbox-ios-example uses adjustTilesForRetinaDisplay = YES (not the OnlineLayerViewController, though, due to the two different tile sources), while mapbox-me uses adjustTilesForRetinaDisplay = NO (implicit via performInitializationWithTilesource:...).

Actually, I think there is some initialization missing after setting a tile source, something which is done in createMapView, like setting the contentSize. I'll check this.


Reply to this email directly or view it on GitHub:
#66 (comment)

As far as I could find out, this is a problem which only occurs if you set a tile source after the map initialization...

I just added a patch which should fix your problem, but it has some side effects for me. I think this is due to some weird app logic on my part but it might be a good idea if you test it with your apps as well.

I tested this today with our apps and commited a few more (mostly unrelated) patches, I think this should fix your problem.