xissburg / XBPageCurl

A decent page curl transition for iOS.
MIT License
671 stars 135 forks source link

Using XBPageCurl With Google Maps SDK for iOS #49

Open 942v opened 11 years ago

942v commented 11 years ago

Why is it that when I try to curl the view that contains the googleMapView (front View) the map gets black? Am I doing something wrong? Is it a bug? or XBpageCurl is not compatible with Google Maps SDK for iOS? I have change the map from the apple's map where the curl worked perfectly. Thanks for the reply.

-----------------------------------------------------------------------EDIT---------------------------------------------------------------------------------

Here are some images: ios simulator screen shot may 15 2013 9 14 10 pm ios simulator screen shot may 15 2013 9 14 15 pm

I'm using 3 View's like the example (backView, frontView, peelView). More info: Google Maps SDK for iOS version that I'm using is: 1.3.0 (current) & I'm using storyboards. Idk if this is going to help but I have made a project with the same approach I'm using on my main workplace and it's on Bitbucket. Here's the link:

https://942v@bitbucket.org/942v/test-xbpagecurl-google-maps-sdk-for-ios.git

You need an API Key from Google. Specifically for Google Maps SDK for iOS. Visit: "https://code.google.com/apis/console/" Please go to "GoogleAPIKey.h" and put your key before running it on the simulator.

Can you tell me what I'm doing wrong?

xissburg commented 11 years ago

I haven't tried using XBPageCurl with Google Maps yet, but the view drawing mechanism that is used internally is totally dependent on -[CALayer renderInContext:] (to draw the view on an OpenGL texture). If the view you are trying to draw does not support it, I don't know what could be done. Have you tried using a 'container view' which contains the map view and curl this container view instead?

benjaminetw commented 11 years ago

i have met the same problem, i tried to curl a view which contains googlemaps, it turns into black.is there a solution?

benjaminetw commented 11 years ago

GMSMapLayer, the CALayer subclass for GMSMapView, now supports modification of its camera properties, allowing for advanced animation effects.

i saw it in google maps ios doc, it seems support calayer.

942v commented 11 years ago

Thanks for the quick reply @xissburg, I have edit my issue with more data and a test project. Please fork it and tell me if it's a problem with my code or something that I'm doing wrong.

brycethomas commented 11 years ago

I just downloaded @942v 's example project (https://942v@bitbucket.org/942v/test-xbpagecurl-google-maps-sdk-for-ios.git) illustrating the problem. @xissburg - it looks like @942v is already adding the Google Map as a subview of frontView (a plain UIView), and setting frontView as the viewToCurl, so I'm guessing simply stuffing the map inside of a 'container view' doesn't work unfortunately.

xissburg commented 11 years ago

Wow sorry for the delay.. been very busy and I can't really look into this at the moment. What I've been wondering is that this Google Maps view uses OpenGL to draw its contents. I think it does because it is capable of rendering 3D buildings. If this view is backed by a CAEAGLLayer then -[CALayer renderInContext] won't work on it. I have no idea what would at the moment.. if we could perhaps grab the GoogleMaps view's OpenGL context and framebuffer, we would be able to obtain the image through glReadPixels.. this would be a nice hack.