Hi,--
Following the samples app I integrated external map rotation into my existing app but this has lead to the MapView flashing on and off on my Nexus 9 tablet (Android 6.0.1). I've tried the app on a phone (Android 4.2.2), here the screen doesn't flash but flickering occurs when I pan the map.Hardware acceleration is disabled and the rotation of the map works.
I cloned the 0.6.0 release branch in an attempt to run the samples code but I am unable to run the samples app due to the following error:
Error:Execution failed for task ':Applications:Android:Samples:transformClassesWithDexForOldpermissionsDebug'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_31\bin\java.exe'' finished with non-zero exit value 1
I downloaded the samples apk and was able to run the RotateMapViewer which worked perfectly.
I've attached the creation of the MapView in my fragment and the layout file.
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View rootView = inflater.inflate(getLayout(), container, false); this.mapView = (MapView) rootView.findViewById(R.id.myMap); this.mapView.getModel().frameBufferModel.setOverdrawFactor(1.0d); this.mapView.setClickable(true); this.mapView.getMapScaleBar().setVisible(false); this.mapView.setBuiltInZoomControls(false); this.mapView.getMapZoomControls().setZoomLevelMin((byte) getZoomLevelMin()); this.mapView.getMapZoomControls().setZoomLevelMax((byte) getZoomLevelMax()); setDefaultPositionAndZoom(); if (this.mapType == MapType.TILE) { setTileStoreCache(); } rotateMapButton = (Button) rootView.findViewById(R.id.rotateButton); rotateMapButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { RotateView rotateView = (RotateView) rootView.findViewById(R.id.rotateView); rotateView.setHeading(rotateView.getHeading() - 45f); rotateView.postInvalidate(); } }); return rootView; }
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/mainView" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.gaist.android.asset.collection.map.RotateView android:id="@+id/rotateView" android:layout_width="fill_parent" android:layout_height="fill_parent"> <org.mapsforge.map.android.view.MapView android:id="@+id/myMap" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </com.gaist.android.asset.collection.map.RotateView> <Button android:id="@+id/rotateButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:text="Rotate Map"/> </RelativeLayout>
Regards,
Andy
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/3b87aa74-fe14-43e5-ad1c-00331bd1d763%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
| From: Emux Sent: Friday, 25 December 2015 18:09 Reply To: mapsfo...@googlegroups.com Subject: Re: [mapsforge-dev] RotateView (External) Mapsforge 0.6.0 screen flicker |