Mapsforge/VTM iOS

148 views
Skip to first unread message

Dustin Matzel

unread,
Feb 9, 2020, 1:10:23 PM2/9/20
to Mapsforge & VTM
Hello,

we would like to use Mapsforge/VTM in our iOS app and found many projects (mostly not finished) that tried to reached this.
We would like to check, if we found all or if we are missing some.
We want to make a wrap up like what was done 4 years ago here: https://groups.google.com/forum/#!topic/mapsforge-dev/A1CpRxcwQtI

What is the best approach to use Mapsforge/VTM in an iOS app?

Needs:
We are developing with XCode and therefore we need a Mapsforge/VTM library.

Found approaches:

Xamarin:
Is a tool for cross platform development from Microsoft.

VTM-iOS: Works with libgdx/robovm/moe and uses OPENGL.
It converts the project in an iOS app but there are reports that libgdx apps can be convert into a static library (officially not supported).
The big disadvantage is that Apple removed the OPENGL support (at the moment deprecated) for their own Metal framework and could remove OPENGL totally at every new iOS release.
There is only one commercial tools to wrap the OPENGL commands to Metal commands (MoltenGL) and it is not calculable if this would work at all in the libgdx context.
Therefore this approach is not sustainable especially because there are from time to time issues with the general libgdx approach.

MapsforgeSharp:
1:1 c# implementation, also works with Xamarin and has therefore the same issues.
It is also not updated since 3 years.
github: https://github.com/charlenni/MapsforgeSharp
thread: https://groups.google.com/forum/#%21topic/mapsforge-dev/gOzn0VIznHg

j2ObjC:
This approach cross compiles the mapsforge "core" components and does an one to one implementation of the android components in Objective-C.
There are many projects which did this, here are all I found:

HallM:
Implementation of mapsforge 0.5.1, we could not see an image of the map as described in the thread.
The reason will be most likely that "When I last stopped, I was trying to figure out what I broke and why all the tiles were just empty."
So maybe an older state is working. Last commit was 5 years ago.
github: github: https://github.com/HallM/MapsForge-ios
thread: https://groups.google.com/forum/#!msg/mapsforge-dev/OofRv2s-E2c/kENSPZaSblQJ
projects which are equal: https://github.com/geolives/MapsForge-ios

medvedNick:
really old project but the developer said that it should work nevertheless.
Based on mapsforge 0.3.2, last updated 5 years ago.
github: https://github.com/medvedNick/Mapsforge_iOS
forks:
https://github.com/breiko83/Mapsforge_iOS Added arm64 support which was similar done by medvedNick afterwards
https://github.com/braandl/Mapsforge_iOS rebased the work of medvedNick on the (at this moment) current mapbox-ios-sdk (https://github.com/mapbox/DEPRECATED-mapbox-ios-sdk).
Last commit was 5 years ago - 9 month ago he merged something from the original repository.
This mapbox-ios-sdk is based on "route-me" (https://github.com/Outdooractive/route-me) which is deprecated and refers back to the deprecated mapbox-ios-sdk.
The mapsforge-ios-sdk refers to the new git (https://github.com/mapbox/mapbox-gl-native) and preciesly to (https://github.com/mapbox/mapbox-gl-native-ios).
This project has as far as I know no support for mapsforge maps and also struggles with going from opengl to metal (https://github.com/mapbox/mapbox-gl-native/issues/12061).

We dived deeper in the project HallM and could reproduce his work.
But it did not show any maps, possibly because we used the latest master state which was broken as the dev said.

In our team we made good experience with cross compiling.
We are cross compiling our java backend at the moment and use it in the iOS application.
Therefore we are surprised that all of these projects did not finish completely and are not maintained anymore.

Apps which can do it:

Cartograph 2 Maps (no sources available):
Can display mapsforge maps in iOS. I got in contact with the developer. He uses a self written render which is not public available-
app store: https://apps.apple.com/us/app/cartograph-pro-map-viewer/id1082995961?ls=1

FarigMaps (no sources found):
Can display mapsforge maps in iOS.
Similar to the one above. I am also trying to get in contact.
app store: https://apps.apple.com/de/app/farigmaps-gps-tracks-for-outdoor-hike-trek-bike/id1069817771

Conclusion:
There are two main approaches to get mapsforge/VTM working in an iOS app.
First, with the use of Xamarin. But the mapsforgesharp project is no longer maintained and VTM brings a big uncertainty with the dropping OPENGL support.
Also Xamarin does not really create an iOS library.
The second approach is cross compiling the "core" and do an one to one implementation of the android components in Objective-C.
Sadly there is no project (which I could find) that created a working iOS library of Mapsforge/VTM.
Because there are apps that are using it, it must be possible to end such a project.

Open question:
First of all, are there other projects and/or approaches that I missed?
It would be nice if this thread gives a good overview over the hole topic. So if someone knows another project or approach, please tell us.
Does anyone know why all these projects stopped the development at some point?

Further development:
We use Mapsforge/VTM in our project and also need it for iOS.
The big question is what is the best way to use it? Which project could we use?
Exists a project that is stable enough to use it in a proportional environment?
At the moment I would say HallMs mapsforge fits our needs best, iff we could find a working state of his repository.
Or braandls mapsforge which should work after what I read, but it uses a quite outdated mapsforge.
Or are there any other projects that I missed?

If there is no feasible project which can be used in a productive environment what would be the best starting point to create a library?
We do not have a deeper OPENGL/Metal knowledge. Therefore I would say that cross compiling the "core" functionality and adding the missing platform specific code in the Mapsforge project is the best approach.
As a starting project I think the one from HallM is the best because it uses the latest mapsforge (therefore has the major structure changes with 0.4 already implemented).
What are your opinions, what would be the best way to get a mapsforge/VTM library for our iOS application?


Thanks in advance,
Dustin

Dustin Matzel

unread,
Feb 10, 2020, 5:07:13 AM2/10/20
to Mapsforge & VTM
@Emux what is your opinion to this topic, what would be the best appraoch?

@Matthew Hall are you still active in this forum?


We tried to find a working state of Matthew Halls project but could not find one.

We also tried medvedNick and braandles project but it seems that their code is not compatible with newer XCode versions.
We did this with XCode 7 which is the lowest version we can go but still a lot of errors.

At the moment I think a complet new development starting from a current mapsforge version would be the best way.
@Emux what do you think about it?You are probably the person with the best overview.

Emux

unread,
Feb 10, 2020, 5:20:35 AM2/10/20
to mapsfo...@googlegroups.com
There is an open source app with iOS support in applications list to check its state.


Another approach is to find a good map engine and write a Mapsforge reader for it.

Essentially that what was happened in VTM to support Mapsforge some time ago.

--
Emux

Dustin Matzel

unread,
Feb 14, 2020, 5:18:16 PM2/14/20
to Mapsforge & VTM
Thank you,
I checked the app from the applications list and it uses Xamarin which also has the uncertainty of the further OpenGL of Apple.

The approach of finding a map engine and writing a reader sounds quite interesting. We will check this idea and keep you updated and if we decide to go this way and also share the code.


Dustin

Robert Oehler

unread,
Mar 26, 2021, 5:51:19 AM3/26/21
to Mapsforge & VTM
Hi,

I just came by looking for the iOS development state and found this thread. So still nothing official, that is sad.

I also made an iOS port (based on 0.3.0) in 2014/2015 and would be interested in a current version. 
I was never able to get VTM running on iOS. 
The BikeComputer app is still out there if you want to have a look :


Best regards

Robert

Reply all
Reply to author
Forward
0 new messages