B4A Library OSMDroid - MapView for B4A

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
 

warwound

Expert
Licensed User
@androidvh

Take a look at these posts of mine:

http://www.basic4ppc.com/android/forum/threads/osmdroid-mapview-for-b4a-tutorial.16310/page-19#post-243189
http://www.basic4ppc.com/android/forum/threads/osmdroid-mapview-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.
 

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:

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.pngupload_2014-5-25_19-45-41.png
 

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
 

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.
 

westingenieria

Active 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.
I have the same question.... help!!!!!
 

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.
 

westingenieria

Active Member
Licensed User
know the tool Maperitive? I have a few minutes testing the generation mapnik through this and apparently it works ...
 

warwound

Expert
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.
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.
 

jamesnz

Active Member
Licensed User
know the tool Maperitive? I have a few minutes testing the generation mapnik through this and apparently it works ...
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 ?
 

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:

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.
 

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...
 
Top