Android Question RFC: What does a minimum OSMDroid needs on features

DonManfred

Expert
Licensed User
Longtime User
Request for comments

I´m playing around with OSMDroid doing a new wrapper for it. Just out of fun. ;-)

Which features does the Library needs at minimum to get released?

As of now i can load a map using openstreetmap tiles (online), use offline tiles, show compassoverlay, own locationoverlay, mapscaleoverlay, minimapoverlay with the wrapper already written.

A lot is missing but i want to know which feature(s) i should focus when continuing writing the wrapper.

Any comments are welcome ;-)
 

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Request for comments

I´m playing around with OSMDroid doing a new wrapper for it. Just out of fun. ;-)

Which features does the Library needs at minimum to get released?

As of now i can load a map using openstreetmap tiles (online), use offline tiles, show compassoverlay, own locationoverlay, mapscaleoverlay, minimapoverlay with the wrapper already written.

A lot is missing but i want to know which feature(s) i should focus when continuing writing the wrapper.

Any comments are welcome ;-)

I take it can already, but just if not:
Draw a line/path, zoom.

RBS
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

udg

Expert
Licensed User
Longtime User
A short list from my old app:
- set initial center, zoom level... independently from device coordinates (think of it as a way to just show a map)
- multiple bitmaps for markers
- click/long click on markers
- tracking position (GPS or FLP)
- distance between current position/marker (or marker1 to marker2)
- geofencing (kind of) when distance from given marker is below a set value rise an event
I recall that you already did a "collapsed marker", i.e. a marker representing a bunch of them when zooming in to avoid the clutter

If you like so, let me know by PM (or email) when ready and I'll substitute current 4.1 code with yours in my old app reporting you back about my findings.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
set initial center, zoom level... independently from device coordinates (think of it as a way to just show a map)
already possible

I recall that you already did a "collapsed marker", i.e. a marker representing a bunch of them when zooming in to avoid the clutter
it is a clustermanager for GoogleMaps, not osmdroid. find one in the web for osmdroid and i´ll implement it.

multiple bitmaps for markers
Is this possible with osmdroid? Do you have referencelinks/code for this?

If you like so, let me know by PM (or email) when ready and I'll substitute current 4.1 code with yours in my old app reporting you back about my findings.
My holiday starts this evening. :D

Give me some days to implement most of the things already on my todo list. As i do not have a wife/children (just my Cats) i do have much time to code over christmas ;-)

I´ll release a open beta then. Open for anyone to test and try and report back in public.
- tracking position (GPS or FLP)
- distance between current position/marker (or marker1 to marker2)
- geofencing (kind of) when distance from given marker is below a set value rise an event
If you find some example code in the web you can post the examplecode for such wishes to give a reference on how it works (i need to learn too). Would be great if you specify such feature with more details, code, referencelinks to help me ;-)
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi Manfred,

let me clean up my code (it sports too many attempts to have OSM 4.1 works again after the "recent" servers limitations) and I'll mail it to you.
It used proximity to a marker/target to show an HTML page and play a sound file.
It has different icons for different groups of markers
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
@DonManfred
If you have much time over christmas please consider creating a wrapper for OSMBonusPack, too. :)

What I'm interested in is the Clustering and routing capabilities of it.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
What I'm interested in is the Clustering and routing capabilities of it.
As i am awaiting you hopefully find the source i played around a bit with it :D

We are starting here
B4X:
    Dim dest As GeoPoint
    dest.Initialize(50.7694121,6.0716359) ' 50.818984,6.4635953)
    Dim roadman As RoadManager
    roadman.Initialize("RoadManager")
    
    Dim l As List
    l.Initialize
    l.Add(geop)
    l.Add(dest)
    ' .Initialize2(Array As GeoPoint(geop.Object,dest.Object))
    
    roadman.getRoad2(l)

which raises an Event for the Road
B4X:
Sub RoadManager_onRoad(rl As Object)
    'Log($"RoadManager_onRoad(Road: ${road.RouteLow})"$)
    Dim roadman As RoadManager
    roadman.Initialize("RoadManager")
    Dim roads As List = rl
    If roads.IsInitialized And roads.Size > 0 Then
        For i=0 To roads.Size-1
            Dim r As Road = roads.Get(i)

            Log($"RoadManager_onRoad.${i}.(${r.RouteLow})"$)
            Dim poly As Polyline = roadman.buildRoadOverlay(r)
            poly.StrokeWidth = 2dip
            Dim points As List = poly.Points
            Log($"Polyline.Points.Size = ${points.Size}"$)
            Dim nodes As List = r.Nodes
            Log($"Polyline.Nodes.Size = ${nodes.Size}"$)
            '
            For o=0 To nodes.Size-1
                Dim node As RoadNode = nodes.Get(o)
                Log($"RoadNode#${o}.Instructions = ${node.Instructions}"$)
                Log($"RoadNode#${o}.Duration = ${node.Duration}"$)
                Log($"RoadNode#${o}.Length = ${node.Length}"$)
                Log($"RoadNode#${o}.ManeuverType = ${node.ManeuverType}"$)
                Dim m As Marker = MapView1.createMarker
                m.Draggable = True
                'm.Image = xml.GetDrawable("simon")
                m.Position = node.Location
                m.Icon = xml.GetDrawable("marker_node")
                m.Title = node.Instructions
                m.Visible = True
                MapView1.addOverlay(m)
            Next
            poly.Color = Colors.Red
            poly.addOnClickListener("Polyline")
            MapView1.addOverlay(poly)
        Next
    End If
    MapView1.Invalidate
    'Dim r As Road = road
    
End Sub

when i click on one of the waypoint-markers:

RoadWaypoint.jpeg


It is funny to see it working. Stay tuned ;-)
 
Upvote 0

js486dog

Active Member
Licensed User
Longtime User
Request for comments

I´m playing around with OSMDroid doing a new wrapper for it. Just out of fun. ;-)

Which features does the Library needs at minimum to get released?

As of now i can load a map using openstreetmap tiles (online), use offline tiles, show compassoverlay, own locationoverlay, mapscaleoverlay, minimapoverlay with the wrapper already written.

A lot is missing but i want to know which feature(s) i should focus when continuing writing the wrapper.

Any comments are welcome ;-)
It is a great to hear about regeneration of OSMDroid.

It will be fine to:
- display offline raster maps (at least: zip , sqlite map files)
- draw vectors : points, lines, polygons (from lat,lon arrays, datas)
- draw text labels (from lat,lon arrays, datas)
- have possibility of overzooming map (this was only one feature missing in Osmdroid 4.1)
- work with GPS.

Overzooming:
When the offline map for osmdroid is created (sqlite ...) with the max zoom 15, and it will be zoomed over 15 you can see only the actual zoomed part of the display.
When you move map (with zoom over 15) there is only white display (raster map is not showed), because there are not tiles over 15 zoom.
Osmdroid > 4 has built-in function called : setTilesScaledDpi(boolean) . The function is located in MapView class. They say that with this function is possible to do overzooming.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
- A good offline routing with spoken directions.
OSM DOES support this??
- Live traffic congestion warnings.
OSM DOES support this??

In both cases i need reference links (internet) and/or java source to see how it works.

- Take a look at "Maps.Me" which is the best offline Map App at present.

How does it help in developing OSMDroid wrapper?

Maps.me is an APP when i interpret it correctly. It does not support downloading maps to use them in OSMDroid. Or am i wrong?
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Please use www.openstreetmap.de not .org as the source of map tiles
How can i download them? I just can see an Onlinemap. In the FAQ i see that are based on OSM Data (probably the PBF data?)...

As downloadmirror GeoFabrik.de are mentioned for example. http://download.geofabrik.de/

Here you can download .pbf (PBF File), .shp (Shapefile) and .xml (XML File) for different Regions. To use it in OSMDroid one need to create Tiles for the needed Region(s) in any Zoom one need. I only know one Free tool to do this. Maperitive.

Be aware that you need to create a lot of Tiles if you want support for higher Zoom-Levels offline ;-)
Maperitive is able to create tiles up to zoom 19 for the PBF file i provided. Not sure if it can create deeper tiles somehow too (need to investigate ;-))
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I thought you might be able to extend the functionality of OSMdroid
No. I´m able to do a wrapper for existing OSMDroid Library. But not to extend it. I´m not able and this is not my itention.

3. You can download OSM-DE tiles with these links: http://a.tile.openstreetmap.de/tiles/osmde/" & [Zoom] & "/" & [X1] & "/" & [Y2] & ".png"
in which Y2 = 2^Zoom - 1 - Y1 Example (Berlin): https://a.tile.openstreetmap.de/11/1100/670.png
http://b.tile.... , http://c.tile.... and http://d.tile.... will also work
Thank you for this info.
I´ll try out to create a XYTileSource with these BaseURLs. ;-)

2. I mentioned Maps.Me because it is an excellent App, in particular for offline use including spoken directions. By playing with it you can get more ideas what kind of useful functions could maybe also be incorporated in OSMdroid.
First i am trying to get OSDMDroid working at all. With the functionality OSMDroid offers. This alone is a lot of work; without extending anything but getting the available things working.

My question is about the complexity needed before releasing anything. To just use the basic things (not all for sure at this time) i could release the library already.

I am writing the library step by step and created this question/thread to know what features are requested so i can focus on creating a wrap for it.

There are hundrets of Objects in the osmdroid library which are worth oing a wrap for.
I don´t know if i ever finish writing all of them. :D

But i would like to focus on the requested features if they are available in Osmdroid.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You maybe can add them using the correct tilesource configuration. We need to figure it out.
You can post the urls or even links to any documentation of how it may work inside/with OSMDROID.
is it überhaupt possible to add functionality to a wrapper?
No, not really.

But for example talking about osm. You can use any api you like to fetch Data you want to show in a Map.

The bonuspack above does provide additional infos to fetch and show on a Map. The shown red line is a Polyline which is drawn over the hole map to show a route you fetched using the provided api. In this case i did define two Points. One at my home address and one somewhere is Bremen.
The api is giving me all infos to show the route on the map. I did a wrap for the MapSnapshot funcationality.

In fact the api provides two routes. Both of them are drawn on the map using a polyline plus some markers.

The Image generated is to big to upload. So download it here please.

https://www.dropbox.com/s/895ii4kdi4y9wrf/MapSnapshot.png?dl=0

In fact this is an addition to the osmdroid library but using another library :D
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
OpenFietsMap
OpenSeaMap
They are already included in the TileFactory and can be easily included to use as a TileSource...

B4X:
public static final OnlineTileSourceBase FIETS_OVERLAY_NL = new XYTileSource("Fiets",
            3, 18, 256, ".png",
            new String[] { "https://overlay.openstreetmap.nl/openfietskaart-overlay/" },"© OpenStreetMap contributors");

    public static final OnlineTileSourceBase BASE_OVERLAY_NL = new XYTileSource("BaseNL",
            0, 18, 256, ".png",
            new String[] { "https://overlay.openstreetmap.nl/basemap/" });

    public static final OnlineTileSourceBase ROADS_OVERLAY_NL = new XYTileSource("RoadsNL",
            0, 18, 256, ".png",
            new String[] { "https://overlay.openstreetmap.nl/roads/" },"© OpenStreetMap contributors");
   
     public static final OnlineTileSourceBase HIKEBIKEMAP = new XYTileSource("HikeBikeMap",
             0, 18, 256, ".png",
            new String[] { "https://a.tiles.wmflabs.org/hikebike/",
                    "https://b.tiles.wmflabs.org/hikebike/",
                    "https://c.tiles.wmflabs.org/hikebike/"  });

    /**
     * This is actually another tile overlay
     * @sunce 5.6.2
     */
    public static final OnlineTileSourceBase OPEN_SEAMAP = new XYTileSource("OpenSeaMap",
            3,18,256,".png", new String[] { "https://tiles.openseamap.org/seamark/"}, "OpenSeaMap");
 
Upvote 0
Top