-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work well with Google Map v2 (SupportMapFragment) #168
Comments
I'm having the same issue also using OpenGL as my main content view. For me, everything works fine on Jelly Bean, but not in ICS (I get the black shadow overlay). The difference from the original post is that I'm not using a MapFragment, but SherlockFragment (my app does not contain maps). |
Do you both have the most recent version of the code? I know that the guys in #62 didn't and then once they updated all was fine |
Also try adding this code to force a redraw and tell me if it does anything getSlidingMenu().setOnOpenedListener(new OnOpenedListener() {
public void onOpened() {
getSlidingMenu().invalidate();
}
} |
Oops, didn't mean to close it, sorry! |
I just tried your code snippit and it did not fix the problem. My library is 2 days old (Dec 4 date). I'll try to update it later today and try it again. |
I'm having the same problem, I'm using the slidingright branch. I noticed this branch doesn't get updated as often as the master branch. Is this issue resolved for the master branch and if so, will it be fixed as well for the slidingright branch? |
Is there any way that you can stop map updates and drawing as soon as an open gesture starts? |
I tried to make a onStop on my class mapFragment and stop drawing marker on the map google and I get the same result. I tried to hide the fragment to see if I get the problem and i didn't get the problem, but isn't the good solution. |
Any progress on this issue? |
I got a really ugly solution : private void setMapTransparent(ViewGroup group) {
And, to call this function properly : mapFragment = new SupportMapFragment() { Using the hierarchy viewer, I tried to identify what element in the view hierarchy was of the type SurfaceView, you then set the background to transparent... Hope this helps ! |
Hmm very strange. Do you have any idea why the background color might be visible outside the view itself? |
It happens that it's a problem with SurfaceViews in general : the way they work, as described : "the SurfaceView punches a hole in its window to allow its surface to be displayed" (http://developer.android.com/reference/android/view/SurfaceView.html) Somehow, it appears always on top, even when hidden, for some reason, and setting the background to transparent solves it somehow. Also, this black glitch only appears for ICS and under, it seems. On GS3, or Nexus 4 with jelly beans, it worked properly... |
GoogleMapOptions op = new GoogleMapOptions(); seems to solve it for me. |
Works for me as well. Nice one. A lot better than my ugly solution. |
How would I implement this since I don't use a map fragment? I'm seeing the issue when using a SherlockFragment hosting OpenGL component. |
set the background of your GLSurfaceView to transparent will do the trick, and looks like setting zOrderOnTop works as well. The choice is yours :-) |
Setting the background to transparent 'mGLView.setBackgroundDrawable(new ColorDrawable(0));' worked for me. Thanks! |
Does somebody want to formally write this up for the README file? |
This works pretty well for me ...
Thanks redwarp and others :), cheers. |
I have the same problem, I use this option zOrderOnTop="true" to resolved the problem but with this the overlay objects in the map as button zoom, etc , are drawer rear thet map, you can't click but you can't see them. |
I used fixed with:
but then I cannot use another fix for getting info when Map Fragment is added and supportMapFragment.getMap() returns map handler.
my dirty workaround for that is now is simply using delay
How are you dealing with that problem? initializeMap sets for example zoom level. |
Hi, You're doing good job jfeinstein10, the bug is coming from GoogleApis, not from you! But it says on the link above that we have to flood this link: Coz', workarounds are nice, but don't make for nice maintainable code, please folk click the second link and "star" the issue :) Regards, Thibault D. |
The workaround that worked for me is to add a transparent view above the map in menu onOpen and then remove it in menu onClose getSlidingMenu().setOnOpenListener(new OnOpenListener() {
|
Hi all, The both-side sliding menu's view is on top of the Google map view. Anyone know how to solve it? |
hi |
I have the same problem. I read this issue thread and I don't understand - is there any solution for the problem? my problem on lg p970 (4.0.4) device. Anyone can help me? |
I had the same problem with using Google Map v2 on the main activity. I solved the problem by following carlonzo reply in #62
|
Solved. But the result is terrible! |
@ckakei that worked for me. Previously I had another view too after the FrameLayout but they didn't work. After I put the transparent View that you said it worked like a charm. Lots of thanks! |
Beware that Google as precisely released a fix for this issue and the tricky thing is that this patch will only apply to some compatible devices. You now have to do your tests at least on two different devices... |
@jfeinstein10 thank you very much for such an awesome library. |
I am facing same problem on loading map v2 in same activity. When I navigate to the NewsDetailsFragment initially, the map is loaded, now if I load a new instance of the NewsDetailsFragment like on scrolling pager I am displaying my next record. The ViewPager in the 2nd NewsDetailsFragment wont display the map. In LogCat,Log shows that everything works fine, map is displaying and markers get set. But on place of map showing black screen. If there is 1 loaded map ViewPager, any more NewsDetailsFragment wont show their maps, only if I press Back till I have no NewsDetailsFragment (hence no ViewPagers running), only then if I open a new instance of NewsDetailsFragment it will load the map. |
The code snippet shared by @avatar21 works pretty well for me. :) Thanks man! |
The code is working well..thanks man..!! @avatar21 |
The snippet from @ckakei worked for me. Thanks !!! |
I've looked at both tickets closed and I don't see a comment from the Moderator about what his solution is...I see a " library-maps-support" but no documentation about when to use it. I looked at the one java file (SlidingMapActivity.java) and I don't see any special code. And to be clear i'm using a map fragment not a MapActivity. Any info is appreciated. |
The snippet from @ckakei worked for me. Thanks !!! |
I liked your work, it works great without a map fragment ... since MapFragment came out from Google not long ago, I've tried to look for ways to integrate SherlockActionbar + SlidingMenu + MapFragment ...
The result:
Note: I think this is related to issue #62
References:
http://facebook.stackoverflow.com/questions/13721929/using-actionbarsherlock-with-the-new-supportmapfragment/13727539#13727539
public class SlideExample extends SlidingFragmentActivity {
public void onCreate(Bundle savedInstanceState) {
// ...
setContentView(R.layout.view_with_map_fragment);
// ...
Screenshot:
Hardware:
The text was updated successfully, but these errors were encountered: