otavio17 / osmdroid

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

CompassOverlay and MyLocationNewOverlay not showing in android 4.2 #518

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have an app using osmdroid-android-4.0 and in one device that has android 
2.3.4 and everything is working fine but in other device i have with android 
4.2.2 neither the compass nor the yellow person appears although the map and 
the other overlays are showing and working fine.

This is the code i'm using on the oncreate method of my map activity:

{code}
point = new GeoPoint((int) (lati * 1E6),(int) (lngi * 1E6));
        myOpenMapView = (MapView) findViewById(R.id.openmapview);
        myOpenMapView.setBuiltInZoomControls(false);
        myOpenMapView.setMultiTouchControls(true);
        myOpenMapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
        myMapController = myOpenMapView.getController();
        myMapController.setZoom(16);
        myMapController.setCenter(point);
        this.mCompassOverlay = new CompassOverlay(this, 
                new InternalCompassOrientationProvider(this), myOpenMapView);
        this.mLocationOverlay = new MyLocationNewOverlay(this, 
                new GpsMyLocationProvider(this),myOpenMapView);
        myOpenMapView.getOverlays().add(this.mLocationOverlay);
        myOpenMapView.getOverlays().add(this.mCompassOverlay);
        this.mLocationOverlay.enableMyLocation();
        this.mCompassOverlay.enableCompass();
        myOpenMapView.postInvalidate();
{/code}
Thank's to everyone.

Original issue reported on code.google.com by krlos...@gmail.com on 21 Jan 2014 at 2:04

GoogleCodeExporter commented 9 years ago
Tested in android 4.0: working fine, shows compass and my location.
Tested in android 4.1: same as 4.2 not showing neither compass nor my location

Original comment by krlos...@gmail.com on 21 Jan 2014 at 3:48

GoogleCodeExporter commented 9 years ago
Do you have this issue with the OpenStreetMapViewer demo app?

Original comment by kurtzm...@gmail.com on 7 Feb 2014 at 10:06

GoogleCodeExporter commented 9 years ago
I had the same issue when using the jar v.4.1, but fixed itself by migrating to 
jar v.4.2. Can original poster confirm?

Original comment by carlos...@gmail.com on 3 Sep 2014 at 5:53