jofomah / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Doesn't work in Android 4.0.4 - no tiles shown #339

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

This simple code:
https://github.com/jarofgreen/Real-Virtual-Maze-Android/commit/1777d862758af759c
11d15414e9c009577ef46fb

Works on the Android 2.1 (API 7) emulator.

On the Android 4.0.3 (API 15) emulator no map tiles show. There is network 
activity so I assume they are being loaded, but nothing shows.

Original issue reported on code.google.com by ja...@doubtlesshouse.org.uk on 14 Apr 2012 at 10:24

GoogleCodeExporter commented 8 years ago
Is there anything in the log?

Original comment by neilboyd on 15 Apr 2012 at 3:14

GoogleCodeExporter commented 8 years ago
Not that I saw.

Original comment by ja...@doubtlesshouse.org.uk on 15 Apr 2012 at 10:24

GoogleCodeExporter commented 8 years ago
It works OK for me with a 4.0.3 emulator with basically the same code, except I 
set a map centre. ( I don't know what 4.0.4 is ?)

public class OsmdroidDemoMap extends Activity {

    private MapView     mMapView;
    private MapController   mMapController;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
            setContentView(R.layout.osm_main);
        mMapView = (MapView) findViewById(R.id.mapview);
        mMapView.setTileSource(TileSourceFactory.MAPNIK);
        mMapView.setBuiltInZoomControls(true);
        mMapController = mMapView.getController();
        mMapController.setZoom(13);
        GeoPoint gPt = new GeoPoint(51500000, -150000);
        //Centre map near to Hyde Park Corner, London
        mMapController.setCenter(gPt);
    }
}

Original comment by n...@nthearle.demon.co.uk on 16 Apr 2012 at 11:22

GoogleCodeExporter commented 8 years ago
Aggh, 4.0.4 is a typo, I meant 4.0.3, can you edit the subject? Sorry.

So I took the code I have and added:

MapController mMapController = mapView.getController();
mMapController.setZoom(13);
GeoPoint gPt = new GeoPoint(51500000, -150000);
//Centre map near to Hyde Park Corner, London
mMapController.setCenter(gPt);

And I still have the same symptoms, works fine on 2.1 but no tiles appear in 
4.0.3.

The code I have is really very simple, hopefully it's a good test case? (I'm 
not sure what you mean by "basically the same code"?)

The only difference I can see is you haven't called 
setMultiTouchControls(true); but I tried removing that and it still happens.

Thanks for looking at this,
James

Original comment by ja...@doubtlesshouse.org.uk on 16 Apr 2012 at 2:53

GoogleCodeExporter commented 8 years ago
I had a similar issue ... except I was specifically trying offline maps.
see my question here: 
https://groups.google.com/d/topic/osmdroid/RDYtt6f0OQo/discussion

Online maps works for OSMViewer on 4.0.3 but I can't get offline maps to work 
on 4.0.3.

Original comment by felipena...@gmail.com on 19 Apr 2012 at 1:04

GoogleCodeExporter commented 8 years ago
I can get OSMDroid to work on ICS 4.0.3 but found that adding a ScaleBarOverlay 
causes an exception if the device has hardware acceleration available.

A typical exception is:

java.lang.UnsupportedOperationException
at android.view.GLES20Canvas.drawPicture(GLES20Canvas .java:900)
at uk.co.martinpearman.b4a.osmdroid.views.overlays.My 
ScaleBarOverlay.draw(MyScaleBarOverlay.java:287)
at org.osmdroid.views.overlay.OverlayManager.onDraw(OverlayManager.java:119)
at org.osmdroid.views.MapView.dispatchDraw(MapView.java:867) 

There may be other classes which will cause a similar exception if hardware 
accleration is available - i shall do some tests and report my findings when i 
have the time.

Martin.

Original comment by warwo...@gmail.com on 10 Aug 2012 at 6:24

GoogleCodeExporter commented 8 years ago

Original comment by neilboyd on 30 Oct 2012 at 4:40