B4A Library OSMDroid - MapView for B4A

Here we have my latest library - OSMDroid provides a MapView for B4A.

More info on the original (native Android) OSMDroid project can be found here: osmdroid - OpenStreetMap-Tools for Android - Google Project Hosting.

Library reference is no longer included in this post due to limits on the number of characters allowed in a single post.

I have created some tutorials to show basic usage of the library and will update this thread with a link to them as soon as i have them all uploaded.

** Your attention is drawn to the included file Apache License Version 2.0.txt, which is a copy of the Apache License Version 2.0 under which the native Android OSMDroid library is released **

Martin.
 

Attachments

  • OSMDroid_3_0_8_v3.60.zip
    361.9 KB · Views: 4,065
Last edited:

warwound

Expert
Licensed User
Longtime User
Is OSMDroid MapView 3.0.8 from a build prior to r1099?

Looking at the version 3.0.8 source code i see no revision number.
Each class file has a 'Created by plusminus on ????' comment, and the date and time of the comments vary on each class file.
The dates and time all seem to be from 2008 which is long before issue 331 was corrected.

So i'd assume that the b4a verison 3.0.8 library does not contain the fix.
 

androidvh

Member
Licensed User
Longtime User
Dear Martin,

I use your libary in version 4.1.
Since last week no tiles are loaded.
You can check it if you rename the osm folder.

Any idea?

Kind regards Volker
 

MetalOS

Member
Licensed User
Longtime User
Hello,

I'm trying to use your OSMdroid library and I'm having a problem. When I test your SimpleMap example all works wonderfully on B4A 8.0. But if I test your code in my application I only have a frame in place of the OSM tiles. If I modify in my application the package name by your "uk.co.martinpearman.b4a.mapviewtutorial" the tiles will show up well and all will work. Can you tell me or declare the package name of my application to display the OSM tiles in my application. Thank you in advance and sorry for my english because I use Google Translate. Cordially.

Julien
 

corwin42

Expert
Licensed User
Longtime User
Since Martin seems to have disabled conversations I ask him here publicly:

Hello Martin,

I'm currently working on a project which will later run on a device without any Google Services. For this project I need a map and I'm considering using OSMDroid for this.

Your latest OSMDroid wrapper targets OSMDroid 4.1. The latest version of OSMDroid is 6.0.3 with many changes. From what I have seen you don't work anymore on the OSMDroid wrapper so I'm thinking about to create a new wrapper for OSMDroid. Since I even need routing capabilities which can be done with OSMBonuspack I'm thinking about to wrap this, too.

Is the source of your OSMDroid wrapper publicly available somewhere or are you willing to share it? Then I don't need to start completely from the beginning, even if many stuff has changed in OSMDroid.

Thanks and best regards,
Markus
 

ThePuiu

Active Member
Licensed User
Longtime User
I tested the examples provided at the beginning of the thread and it works perfectly! In my application, in MainFrame when I press a button, I want to see the map. I created a new module where I copied your code. All I can see is a background with a grid on it. No map ... Can you tell me what to do?
Thank you!
 

DonManfred

Expert
Licensed User
Longtime User
You should start a new Thread in the questionsforum for any question you have.
Make sure to upload a sample project which shows the issue.

the example is working; yours not. Check your code what you have done wrong i would suggest.
 

maurizio barbera

Member
Licensed User
Longtime User
Since Martin seems to have disabled conversations I ask him here publicly:

Hello Martin,

I'm currently working on a project which will later run on a device without any Google Services. For this project I need a map and I'm considering using OSMDroid for this.

Your latest OSMDroid wrapper targets OSMDroid 4.1. The latest version of OSMDroid is 6.0.3 with many changes. From what I have seen you don't work anymore on the OSMDroid wrapper so I'm thinking about to create a new wrapper for OSMDroid. Since I even need routing capabilities which can be done with OSMBonuspack I'm thinking about to wrap this, too.

Is the source of your OSMDroid wrapper publicly available somewhere or are you willing to share it? Then I don't need to start completely from the beginning, even if many stuff has changed in OSMDroid.

Thanks and best regards,
Markus


hi, where can I download the 6.0.3 library? thank you
 

MbedAndroid

Active Member
Licensed User
Longtime User
I've have guessed that HttpUtils2 adds no header to it's requests - just as OSMDroid adds no header to it's tile requests.
In the b4a library source i have found the code that creates the tile requests and can see where i can simply add a line such as:

B4X:
head.setHeader("User-Agent", "OSMDroid");

Following the thread on Google groups it's been said not to use 'OSMDroid' as a user-agent as technically speaking your application is not the official OSMDroid application.
I thought it'd be better to instead use the application packagename - but there's no way to get this packagename in the part of the code that sets the header.
And then we might find that using the packagename as the user-agent does not force the Mapnik tileserver to return tiles.
Or it might even be that the user-agent setting has no effect whatsoever on whether the Mapnik tileserver will return a tile - the Mapnik tileserver may only return a tile if it is not overloaded.

Martin.
sorry to bump in on this old thread, but osmdroid 4.1 hasnt included this command. Is there a way we can do it ourselfs? Currently 4.1 seems to be banned from tileserver.
 
Top