This is an experimental project so please feel free to help in any way.
This project wraps graphhopper, specifically the ios-compat branch, and translates the .java sources into Objective-C using j2objc.
There is some removed / commented out code in the GraphHopper sources in order for it to work with j2objc and iOS. Ideally, all these changes will be resolved in the future so that there won't be a need for a separate branch.
Feel free to raise problems or questions in our forum.
The version of GraphHopper used is the tip of the ios-compat branch. To update GraphHopper inside this project, you can do the following steps (each step assumes the working directory is the root of graphhopper-ios):
- Make sure GraphHopper is updated:
cd graphhopper
git fetch --all
- Merge a remote branch or tag (eg.
origin/master
,0.5.0
) intoios-compat
, resolving any conflicts:
cd graphhopper
git merge --no-commit -X patience 0.5.0
# if any conflicts you can use mergetool (or any other tool):
git mergetool
# after all conflicts are resolved (git status), commit:
git commit
- Update
graphhopper-ios-sample
import script to the same tag (branch) you just updated graphhopper to. To do this edit graphhopper-ios-sample/import-sample.sh and graphhopper-ios-sample/README.md. Commit the changes:
cd graphhopper-ios-sample
git add .
git commit -m "Update import script to use GraphHopper X.X.X"
- Clean all previous build files and re-generate
class.list
:
make cleanall
make class.list
If using Xcode, make sure you clean the project at this time (Product -> Clean).
- Build and run the project again (eg. in Xcode). If everything still works, you can push and commit the new tip of GraphHopper:
cd graphhopper
git push
cd ..
git add .
git commit -m "Update GraphHopper to X.X.X"
Note: It's possible the graph data needs to be generated again, using the new version of GraphHopper.
Note: It's also possible that after the update new translations become available, so make sure you have all the translations from /graphhopper-ios/build/translations added into Xcode. This is the case if you get this error while running in Xcode: "No input stream found in class path!?", in util/TranslationMap.java.