Android Tutorial OSMDroid - MapView for B4A tutorial

Discussion in 'Tutorials & Examples' started by warwound, Mar 26, 2012.

  1. supriono

    supriono Member Licensed User

    last time i try your great,..
    but i want to try offline map.where i can download offline map for OSM Mapnik?
    i don't see anything for this (link)
  2. DonManfred

    DonManfred Expert Licensed User

    Use MOBile Atlas Creator (like described in Post #1)

    Start the tool, select a working tilesource, slect a small area and define which zoomlevel you want to have, add the selected area to the Atlascontent... Create Atlas

  3. supriono

    supriono Member Licensed User

    thanks ..
    but i don't see map...image only cros X
  4. DonManfred

    DonManfred Expert Licensed User

    I do not see a map with all sources. You need to find the one which is working for you i guess

    I tried the tool yesterday the first time.
  5. androidvh

    androidvh Member Licensed User

    Dear Martin,

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

    Any idea?

    Kind regards Volker
  6. gravel

    gravel Member Licensed User

    Yes same here, from a few days ago no new tiles from mapnik.
  7. warwound

    warwound Expert Licensed User

    Is it only tiles from Mapnik that fail to load - do tiles from other tile providers load correctly?
  8. gravel

    gravel Member Licensed User

    DonManfred likes this.
  9. androidvh

    androidvh Member Licensed User

    now the world is round again...
    System ist running.
    have a look...
  10. cas6678

    cas6678 Active Member Licensed User


    ¿Is there any tutorial to work with offline maps?

    I want to know how to generate a map file to work offlline, where to locate and how to make this library you use this new map.

    Thank you.
  11. warwound

    warwound Expert Licensed User

    Are you talking about creating a mapsforge .map file?

    If so then look here for general documentation:

    And here in particular for documentation about the .map file creation:

    I can't find a forum link to the tutorial on using a .map file in OSMDroid but i'm sure if you search for 'mapsforge' you'll find it.
  12. cas6678

    cas6678 Active Member Licensed User

    Hello @warwound

    I don`t know mapsforge. Now I´m read your links.

    Maybe I´ve problems with the translation from Spanish, sorry.

    I tried your library and works very well, thank you.

    But I want to use offline, the questions are:

    It's possible?

    That software to create the map?

    Where I place the map to your library can use it?

    Maybe some example b4a for maps offline whit you library?

  13. DonManfred

    DonManfred Expert Licensed User

  14. Medexpert

    Medexpert Member Licensed User

    Dear All,

    I didn't found solution for street font size on high dpi display. I use Samsung s6 and street name on map is too small in the bigest zoom view too.
    The library is OSMDroid 3.08.
    Could you help me what is the solution?

    Thanks in andvanced,
    Last edited: Dec 1, 2016
  15. maso1975

    maso1975 Member Licensed User

    Hello everyone, after searching a lot in this forum and on the internet, what I have left is to ask. In advance I thank anyone who takes five minutes to answer and my question is the following:

    Why, according to the terminal model where I install an application with a mapview and omsdroid, the map is visualized with different scales?

    For example, if I use a Galaxy Core 2, the map has a maximum zoom scale of 113m and if it is a Galaxy S3 the scale is 160m or 120m I do not remember well.

    On the other hand and I approve to ask, as I could do an additional zoom to the map, ie, I need to be able to zoom up to at least 10m according to the scale, it is possible, since I have seen applications with the same titles that I am Using which I downloaded with Mobile Atlas.

    Somebody could help me.

    Thanks again.
  16. maso1975

    maso1975 Member Licensed User

    Hello Medexpert, from what I am seeing, your problem is similar to mine, that is, from what I understand, the scale of the map in the S6 is very small, the same is true with my S6, when I execute the entire map application It looks very small, if I do in a Core 2 for example, it looks a little bigger, all this in the maximum zoom and I can not find the solution.

  17. maso1975

    maso1975 Member Licensed User

    Hello, I think the problem of map scale is a limitation of the library, after searching and searching without stopping, I found here:, a solution that raises Kurtzmarc:

    To fix # 49, we would also like to add something like this to MapView:

    Public void setTileSource (final ITileSource aTileSource) {
    MTileProvider.setTileSource (aTileSource);
    Float density = getResources (). GetDisplayMetrics (). Density;
    TileSystem.setTileSize ((int) (aTileSource.getTileSizePixels () * density));
    This.checkZoomButtons ();This.setZoomLevel (mZoomLevel);// revalidate zoom level
    PostInvalidate ();​

    And here:, another that poses this solution:

    final float scale = getBaseContext().getResources().getDisplayMetrics().density;
    final int newScale =(int)(256* scale);

    Of course this is in JAVA.

    Anyone know if you could bring this code to B4A, or use the JAVA embedded in the B4A code to use any of these solutions?
  18. tracklocator

    tracklocator Member Licensed User

    Very good work @warwound has helped me a lot to get tiles from two sources or more is documented in one of the threads and I do with version 4.1 and works well

    MyTileSource.Initialize2(MapView1, MyTileSourceName, Array As String ("URLservertiles.png""URLserver.tiles1.png"), 018256)
  19. cas6678

    cas6678 Active Member Licensed User

    Hi all.

    After a lot of testing I have the working example with the OSDDroid 3.08 and OSMDroid 3.08 MapsForgeTilesSource libraries.

    Now I want to add the rotation of the map and I have read that I need to use the library 4.1

    But I do not find the new methods and properties equivalent to 3.08 for 4.1. I need These:

    MapView OSMDroid_MapView
    (anOverlay AsOverlay)
    AddTileSource (TileSource1 AsITileSource)
    FitMapToBoundingBox (BoundingBox AsBoundingBoxE6)
    GetCenter AsGeoPointWrapper GetMapCenter AsGeoPoint ???
    GetTileSources AsList
    (aGeoPoint AsGeoPoint)
    SetMultiTouchEnabled (Enabled AsBoolean)
    SetTileSource (TileSource AsString)
    SetZoomEnabled (Enabled AsBoolean)
    Zoom AsInt
    CompassEnabled AsBoolean Enabled AsBoolean ???
    FollowLocationEnabled AsBoolean Enabled AsBoolean ???
    MyLocationEnabled AsBoolean Enabled AsBoolean ???

  20. tracklocator

    tracklocator Member Licensed User

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice