Re: [mapsforge-dev] RotateView (External) Mapsforge 0.6.0 screen flicker

181 views
Skip to first unread message

Emux

unread,
Dec 25, 2015, 1:09:22 PM12/25/15
to mapsfo...@googlegroups.com
Sorry it went in spam, I unmarked it.

SmoothCanvas is an old school class, it's not working correctly with HA.
Where did you disabled it, in app level, in (which) view level ?

Also it's important to follow precisely the creation of tile cache, as it's different from regular maps.

(For Gradle try with Java 7 - it's currently the max in Android)

On 23/12/2015 02:26 μμ, Andy Greaves wrote:
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.


--
Emux

Ludwig

unread,
Dec 25, 2015, 1:12:59 PM12/25/15
to mapsfo...@googlegroups.com
Try Java 1.7.

andy.g...@gaist.co.uk

unread,
Dec 27, 2015, 12:29:50 PM12/27/15
to Emux
I've fixed the issue by disabling hardware acceleration at the application level in the manifest. ‎I wasn't aware that this was required  as the MapView reported that it was disabled. 

Regards,

Andy

Sent from my BlackBerry 10 smartphone.
From: Emux
Sent: Friday, 25 December 2015 18:09
Subject: Re: [mapsforge-dev] RotateView (External) Mapsforge 0.6.0 screen flicker

Emux

unread,
Dec 27, 2015, 1:12:21 PM12/27/15
to mapsfo...@googlegroups.com
Since MapView in external map rotation is not autonomous but directly communicates with another view (i.e. RotateView), it's probably best to either disable HA in application level or to a parent of MapView.

I have not tested the 2nd suggestion, just quick thoughts to check.

--
Emux
Reply all
Reply to author
Forward
0 new messages