New gms.maps.MapView rendering lags a bit when in a ListView?
Asked Answered
E

1

7

I'm trying to put an instance of the new MapView in a ListView. New mapview being:

com.google.android.gms.maps.MapView

I'm turning all interactions off, and setting a fixed height for the view:

GoogleMapOptions options = new GoogleMapOptions();
    options.mapType(GoogleMap.MAP_TYPE_NORMAL);
    options.compassEnabled(false);
    options.rotateGesturesEnabled(false);
    options.scrollGesturesEnabled(false);
    options.tiltGesturesEnabled(false);
    options.zoomControlsEnabled(false);
    options.zoomGesturesEnabled(false);

mMapView = new MapView(getActivity(), options);
mMapView.setLayoutParams(new AbsListView.LayoutParams(
    AbsListView.LayoutParams.MATCH_PARENT,
    200));
mMapView.setEnabled(false);
mMapView.setFocusable(false);
getListView().addHeaderView(mMapView);
getListView().addAdapter(simpleArrayAdapter);

This works, but if I scroll the listview quickly, it looks like the mapview rendering lags a bit, so you can see a small area of black pixels in the direction of scrolling.

It almost seems as if this is some kind of synchronization issue, as I'm guessing the mapview with opengl is fast enough to render in response to my scrolls. Also, the old MapView+MapActivity would perform fine in the same setup.

Below is a picture of the gap that appears when you scroll quickly. After a short time, the mapview will catch up and render ok again.

enter image description here

Any ideas on this?

Thanks

----- Update ---------

This issue looks to be the same as:

ViewPager with Google Maps API v2: mysterious black view

I could not get the fix documented there to work in this setup, though.

Evalynevan answered 8/1, 2013 at 15:15 Comment(3)
I have a similar problem: #14420021. Posted a video showing how it looks there. Btw, what device are you testing on?Allegorical
Range of devices - HTC wildfire, Galaxy Nexus, Nexus S - behaves similarly on all of them, some worse than others (HTC Wildfire just goes completely black)Berk
Hey buddy as far as I get you have cteated controller like here cocoacontrols.com/controls/slparallaxcontroller. Do you know where can I find it.Allowed
H
1

Put this in your manifest if your targeting API 13>

<application android:hardwareAccelerated="true"/>
Hump answered 20/10, 2013 at 7:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.