moocdev / osmdroid

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

Upgrade from 3.0.1 to 3.0.7 issues #305

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I just tried to upgrade my app (http://osmtracker-android.googlecode.com) from 
v3.0.1 to the latest v3.0.7 and encountered an few issues.

The first one has to do with SimpleLocationOverlay.

I was using the default "person.png" bitmap that comes in the JAR and with 
v3.0.7 creating a new SimpleLocationOverlay throws an exception with "Resource 
not found: person.png".

Looking at the DefaultResourceProxyImpl class the bitmap is loaded with 
getClass().getResourceAsStream() with a relative path ("person.jpg"). I believe 
that means that the resource is relative to the current package 
(org/osmdroid/person.png), whereas it should be an absolute URL: 
getResourceAsStream("/person.png").

I've changed that to add a leading slash in my local copy and it doesn't throw 
an exception anymore.
I'm surprised that this issue didn't arise before since I suspect the 
DefaultResrouceProxyImpl is used everywhere ? Maybe it's an environment thing 
or related to changes in the ClassLoader and how it resolves resources in 
Android ? I'm using Android 1.6.

The second issue is that the MapView doesn't display anything after the upgrade 
:) I just get a full black screen. All I can see is that some tiles are 
downloaded on the SD card under /osmdroid/tiles/Mapnik/17/65535 and 65536 
folders, which looks suspicious !

Do you have any idea of what could cause that, or what would be the best way to 
debug the issue ?

Thanks,

Nico

Original issue reported on code.google.com by nicolas@guillaumin.me on 1 Feb 2012 at 12:10

GoogleCodeExporter commented 8 years ago
I think the problem is that the resources should be in the org.osmdroid package

Original comment by neilboyd on 8 Feb 2012 at 9:59

GoogleCodeExporter commented 8 years ago
I think revision 1077 has fixed this.

Original comment by neilboyd on 8 Feb 2012 at 10:07

GoogleCodeExporter commented 8 years ago
You can download the latest build from here: 
https://oss.sonatype.org/content/groups/public/org/osmdroid/

Original comment by neilboyd on 8 Feb 2012 at 10:11

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Is it still broken in the latest? If so, please make a new issue.

Original comment by neilboyd on 9 Feb 2012 at 11:44

GoogleCodeExporter commented 8 years ago
Oops sorry deleted my comment by mistake: Thanks it fixed it indeed !

I'm investigating the other issue, I'll create a ticket if I get stuck.

Original comment by nicolas@guillaumin.me on 9 Feb 2012 at 12:14

GoogleCodeExporter commented 8 years ago
working ith latest from svn I still have the issue, since : 
ndroid.R.drawable.ic_delete
makes pretty good lcoation marker :)

Original comment by pip...@gmail.com on 8 Jun 2012 at 10:18

GoogleCodeExporter commented 8 years ago
i figured it out! if I change the default icon for the overlay:

        ItemizedIconOverlay<OverlayItem> myOverlay = new ItemizedIconOverlay<OverlayItem>(pList,marker, pOnItemGestureListener, new DefaultResourceProxyImpl(getApplicationContext()));

instead of :

        //ItemizedIconOverlay<OverlayItem> myOverlay = new ItemizedIconOverlay<OverlayItem>(getApplicationContext(), pList, pOnItemGestureListener);

it does nto raise an exception for some missing default_marker.png

Original comment by pip...@gmail.com on 8 Jun 2012 at 3:53

GoogleCodeExporter commented 8 years ago
i am a beginner.i want to write offline map. i don't know how to write and i 
fine offline map.i see osmdroid and i am testing the osmdroid. i use 
osmdroid-android-3.0.7.jar and slf4j-android-1.5.8.jar .Map view is appeared. 
now i am testing overlay for my offline map view. the overlay is not 
appeared.how to do? please tell me.

Original comment by antk...@gmail.com on 2 Aug 2013 at 5:04

Attachments: