Android Tutorial OSMDroid - MapView for B4A tutorial

eronquillo

Member
Licensed User
Longtime User

Hi Martin, thanks for your help on this. It gives me something to move forward with. Thanks again!
 

warwound

Expert
Licensed User
Longtime User
@Spectre

Ah so that was the cause.
The map is a Canvas that can be rotated.
The Labels are Views added to the layout, anchored to a GeoPoint on the Canvas BUT the anchor point does not take into account map rotation.

There is a possibility that these Views (ViewHost objects) could be converted to a Bitmap and then drawn onto the map Canvas instead of being added to the layout as Views.
I looked at this while developing the ViewHostOverlay - hoping to make it an option to draw a View on the Canvas OR add it to the layout.
Time is the limiting factor here and i just didn't have time to create such an option.

I'm likely to be busy for a couple for weeks here getting some work done but will think again about this option when i next update OSMDroid.

Martin.
 

Spectre

Active Member
Licensed User
Longtime User

Hi Martin...
Important thing is to have found the problem, for now I will visualize the label on the map, my project can be expected in the meantime I will go on with other parties. It seems like a good option to convert to a bitmap and then add to a single overlay.
I also thought I had to work around the problem of generating an icon with the name of the point and then use it on the map ...

Riccardo.
 

fabio.guerrazzi

Member
Licensed User
Longtime User
I didn't figured out wich one should I follow for my app, Google Maps v2 Tutorial or OSMDroid MapView. I just installed the first one, created signature, got api key.. now I realized this. What is the best way in your opinion? thank you
 

Spectre

Active Member
Licensed User
Longtime User
I didn't figured out wich one should I follow for my app, Google Maps v2 Tutorial or OSMDroid MapView. I just installed the first one, created signature, got api key.. now I realized this. What is the best way in your opinion? thank you

osmodroid in my opinion is the most complete and versatile ... You can use off-line maps and the new version 4.1 beta is very good though.
 

warwound

Expert
Licensed User
Longtime User
In my opinion the GoogleMaps library is far more 'professional' and is also regularly updated with new features.
GoogleMaps does though mean that your app will only be compatible with devices running a version of android Honeycomb and later - it doesn't support the older 2.? versions of android.
GoogleMaps is also limited from a developers point of view as it lacks any way to enhance it with your own objects and classes.

OSMDroid is 'functional' and feature rich and allows developers to enhance it's functionality with their own objects and classes.
Just a couple of weeks ago i created the new CircleOverlay for Spectre to use in the new version 4.1 of OSMDroid.
OSMDroid is compatible with just about every version of android so no problems with older devices.
OSMDroid is updated 'regularly' but not as often as GoogleMaps is updated.

Each has it's good points and weak points.

Martin.
 

Spectre

Active Member
Licensed User
Longtime User
[Quote = "warwound, palo: 247.086, membro: 11161"] A mio parere la biblioteca GoogleMaps è molto più 'professionale' e viene regolarmente aggiornato con nuove funzionalità.
GoogleMaps non significa però che la vostra applicazione sarà compatibile solo con i dispositivi che esegue una versione di Android Honeycomb e poi - non supporta la vecchia 2.? versioni di Android.
GoogleMaps è limitata anche da un punto di vista gli sviluppatori in quanto manca qualsiasi modo per migliorare con i propri oggetti e classi.

OSMDroid è 'funzionale' e ricco di funzionalità e consente agli sviluppatori di migliorare la sua funzionalità con i propri oggetti e classi.
Solo un paio di settimane fa ho creato il nuovo CircleOverlay per Spectre da utilizzare nella nuova versione 4.1 di OSMDroid.
OSMDroid è compatibile con quasi tutte le versioni di Android quindi niente problemi con i dispositivi più vecchi.
OSMDroid è aggiornato 'regolarmente', ma non così spesso come GoogleMaps viene aggiornato.

Ognuno ha la sua buona punti e punti deboli.

Martin. [/ Quote]
 

Spectre

Active Member
Licensed User
Longtime User
Hi! Martin ... Some news for the bug rotation label on the map?
Spectre...
 

warwound

Expert
Licensed User
Longtime User
Hi! Martin ... Some news for the bug rotation label on the map?
Spectre...

lol it'll be a while before i have time to look at that - gotta get some other work done first.
Updating the ViewHost so that Views are drawn onto the map Canvas instead of being displayed as 'standard' Views isn't an easy bit of code to write, so i'll look at it when i know i have enough time to get it working.

Martin.
 

Spectre

Active Member
Licensed User
Longtime User
Tanks...
 

jamesnz

Active Member
Licensed User
Longtime User
what an awesome library, the only issue I have is with screen rotation I get out of memory errors, usually after 2 'rotations' , not sure why but otherwise it's really great, well done
 

Mbm

Member
Licensed User
Longtime User
Is there any way to use OSMDroid library together with googlemaps api in the same proyect? Both libraries have a class called Marker and the IDE doesn´t allow the same short name for classes...
 

warwound

Expert
Licensed User
Longtime User

Sam H

Member
Licensed User
Longtime User
I was trying to use the example in post #375, however I get the following error message during compilation:
"A referenced library is missing: slf4j-android-1.6.1-rc1". I have the following librarys referenced:
OSMDroid_3_0_8
OSMDroid_4_1
OSMDroid_4_1_MapsForgeTileSource.

What am I missing?, thanks in advance.
 

warwound

Expert
Licensed User
Longtime User

That example uses OSMDroid version 4.1 - you don't need version 3.0.8 to run it and you don't need MapsForgeTileSource either.
The latest version 4.1 library files can be downloaded from here: http://b4a.martinpearman.co.uk/osmdroid/OSMDroid_library_files_v4.1_20140428.zip (not sure if you have the latest version 4.1 or not).

Can you make sure you have OSMDroid version 4.1 library checked in the b4a ide and no other libraries checked?

Martin.
 

Sam H

Member
Licensed User
Longtime User
Thanks, I have found the slf4j-android-1.6.1-rc1 library reference in the files from the download link and added it to the librarys folder. That seems to have done it.

Thanks again

sam
 

Sam H

Member
Licensed User
Longtime User
A few slight problems since upgrading the library from OSMDroid 3_0_8 to OSMDroid 4_1. I can no-longer trigger the following sub by clicking on any of the markers:
Sub MarkersOverlay1_Click(Title As String, Description As String, Point As OSMDroid_GeoPoint)
coding
End Sub

Any ideas?

Also the mylocationOverlay didn't work.

Are there any tutorials/examples for OSMDroid 4_1, like there were for 3_1 on the first page of this tutorial as they were really useful?

Thanks

Sam
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…