B4A Library OSMDroid - MapView for B4A

Discussion in 'Additional libraries, classes and official updates' started by warwound, Mar 26, 2012.

  1. androidvh

    androidvh Member Licensed User

    Hallo Martin,

    I play around with your new Version 4.1, an fantastic piece of work.

    I have a Problem with the new circlepathoverlay

    is it radius or Diameter?

    radius = 150
    CircleOverlayItem1=CircleOverlay1.AddCircleOverlayItem(point, radius , CircleOverlay1.RADIUS_UNITS_TYPE_METERS, 1, Colors.ARGB(32, 255, 10, 10))
    CircleOverlayItem1.StrokeStyle=CircleOverlayItem1.FILL_AND_STROKE

    I think there is something wrong with the radius.

    if I calculate a new Point with a distance of 150 from the Center of the circle the drawn circle is greater or smaller (dependes on radius or diameter) than 150.

    can you please check it...


    Kind regards
    Volker
     
  2. warwound

    warwound Expert Licensed User

  3. warwound

    warwound Expert Licensed User

    @androidvh

    Take a look at these posts of mine:

    http://www.basic4ppc.com/android/fo...ew-for-b4a-tutorial.16310/page-19#post-243189
    http://www.basic4ppc.com/android/fo...ew-for-b4a-tutorial.16310/page-19#post-243189

    The parameter is radius and can be configured as a fixed pixel size or as 'units of meters' relative to the map's current zoom level.
    The second post i linked to explains inaccuracies due to how far from the equator your circle is.

    Try drawing a circle on the equator and checking it's size - does this appear to be correct?

    Martin.
     
  4. ErickAsas

    ErickAsas Member Licensed User

    Thank you very much Martin...
     
  5. PABLO2013

    PABLO2013 Active Member Licensed User

    Tks for osm lib 4.1 and samples, greetings Martin,


    I Do some questions:


    1: How implemented in the new version 4.1, markersfocusoverlay options.


    2: What is the best way to read files shape with osm, i have seen some applications (play-store), i think its used osm to read ... or in any case, not drawing lines between polygons.


    3: Whe my app "pause" and “loading” it disable map tiles, what was happening?


    4. Not find the way to show scale overlay , i reviewed your work samples 4.1, but not , do you have any idea?... today i have some practical and compas overlay and scale overlay and nothing?


    Thanks
     
    Last edited: May 25, 2014
  6. PABLO2013

    PABLO2013 Active Member Licensed User

    GREETINGS
    WHAT HAPPENS WHEN I USE FILL.STROKE, THE DRAWINGS is distorted TO THE LIMITS OF THE SCREEN . TKS
    upload_2014-5-25_19-44-26.png upload_2014-5-25_19-45-41.png
     
  7. androidvh

    androidvh Member Licensed User

    Hallo Martin,

    I solve the problem with the circle as followed:

    Dim pp As Float = distanceinpixel

    distancepixel is the result in pixel with the given radius(m), point(lat and lon) and zoomfaktor(mapview)

    that´s working fine

    CircleOverlayItem1=CircleOverlay1.AddCircleOverlayItem(point,pp, CircleOverlay1.RADIUS_UNITS_TYPE_PIXELS, 1, Colors.ARGB(32, 255, 10, 10))


    Kind regards Volker
     
  8. merlin2049er

    merlin2049er Well-Known Member Licensed User

    Hmm, I just re-created a few maps using mobac. I used osmdroid.zip as a format and mapquest maps for a tilesource (I grabbed zoom level 16 & 17).

    What tile source should I use in my application? It was previously set to mapnik.
     
  9. westingenieria

    westingenieria Active Member Licensed User

    I have the same question.... help!!!!!
     
  10. warwound

    warwound Expert Licensed User

    @merlin2049er and @westingenieria

    The syntax for version 4.0 is:

    Code:
    MapView1.SetTileSource(TileSourceFactory1.GetTileSource("your tilesource name here"))
    Martin.
     
  11. merlin2049er

    merlin2049er Well-Known Member Licensed User

    Thanks. I've just downloaded MapsForgeTileSource recompiled for version 4.1 of OSMDroid. Is this an upgrade? I've got 3_0_8 installed.
     
  12. westingenieria

    westingenieria Active Member Licensed User


    Martin, can you give me an example of offline map please, I try and I fail. thanks
     
  13. westingenieria

    westingenieria Active Member Licensed User

    know the tool Maperitive? I have a few minutes testing the generation mapnik through this and apparently it works ...
     
  14. warwound

    warwound Expert Licensed User

    No the underlying code is the same - just required a few internal changes to make it 100% compatible with version 4.1 of OSMDroid.

    Martin.
     
  15. jamesnz

    jamesnz Active Member Licensed User

    I have downloaded and restyled my country maps using maperitive, but how does one use these with the 4.1 library. I have loaded the above library but do I use the standard naming conventions, Is there an example anywhere ?
     
  16. jamesnz

    jamesnz Active Member Licensed User

    Tilesourcespinner.AddAll(MapView1.GetTileProvider) <-- java.lang.ClassCastException: org.osmdroid.tileprovider.MapTileProviderBasic cannot be cast to java.util.List

    MapView1.SetTileSource(tilesourcefactory1.GetTileSource("Mapnik")) <-- error : array expected

    can't for the life of me get maps to display offline...
    Since I could not work out how to set the tile source I loaded some of the unzipped raster tiles into /osmdroid/tiles/Mapnik , now they load, but, only from the unzipped file, not from the tile source(zip) file. This is a gps app so perhaps I will need to figure out a method of downloading and extracting zip files for relevant areas as I wont be able to package the whole country in the assets folder
     
    Last edited: Jul 8, 2014
  17. georm

    georm Member Licensed User

  18. warwound

    warwound Expert Licensed User

    If i can just let you all know that i am following this thread but currently having a 2 or 3 week break from programming.
    It's summer in the UK and time for a holiday.

    Please be patient and i'll catch up at a later date :).

    Martin.
     
  19. georm

    georm Member Licensed User

    No problem

    thanks
     
  20. schimanski

    schimanski Well-Known Member Licensed User

    Is it possible to save the tiles on the external sd-card? The /osmdroid-directory is on the internal storage by default. For using offline maps, it is much simpler and faster to save the tiles on the sd-card...

    Thanks for help...
     
Loading...
  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