Giter Club home page Giter Club logo

graphhopper-ios's Introduction

graphhopper-ios

graphhopper-ios wraps graphhopper and creates the libgraphhopper.a library to be used on iOS and OS X. It uses j2objc to translate the .java sources into Objective-C.

Disclaimer: This is experimental so treat it accordingly. Feel free to help in any way.

Getting Started

To get started run the following commands in Terminal:

git clone --recursive https://github.com/graphhopper/graphhopper-ios.git
cd graphhopper-ios

This will clone the repository and all its submodules. Now you are ready to use GraphHopper on iOS or OS X.

You have two options:

  1. Head over to graphhopper-ios-sample and follow the instructions there. This is the easiest way to get started.

  2. Manually add graphhopper.xcodeproj to your Xcode project. See the Usage section below.

Community

Feel free to raise problems or questions in our forum.

Usage

You can either add graphhopper.xcodeproj to your project and let Xcode compile the library or you can compile it from the Terminal and then add the library and sources to your Xcode project.

Xcode

To configure your project to use graphhopper.xcodeproj follow the steps below:

  • Drag&drop graphhopper.xcodeproj into your project (or use the menu File -> Add Files to...)
  • Expand graphhopper.xcodeproj and drag&drop the Translations and Libraries groups into your project (make sure you check "Create folder references" and have your target selected in "Add to targets:")
  • In the Build Settings of your project:
    • add -ObjC to your target's Other Linker Flags
    • add {path-to-graphhopper-ios}/j2objc/include and {path-to-graphhopper-ios}/src to your target's User Header Search Paths
  • In the Build Phases of your project:
    • in Target Dependencies add the graphhopper target
    • in Link Binary With Libraries add Security.framework (to support secure hash generation), libz.dylib (needed to support java.util.zip) and libicucore.dylib (to support java.text, which is a dependency introduced by j2objc 0.9.5)

You're now ready to use GraphHopper on iOS and OS X.

You are responsible for importing graph data. For an example check out graphhopper-ios-sample.

Terminal

Alternatively, you can translate and compile the library by invoking make in the Terminal. You can then link the library graphhopper-ios/build/libgraphhopper.a and it's header files at graphhopper-ios/src manually into your project. For all the other configurations see the Xcode section above.

This method compiles the library for the following architectures: macosx, simulator, iphoneos, so using Xcode instead is recommended.

Example

iPhone-offline-routing

Requirements

  • iOS 7.0+ or OS X 10.10 (it might work on older versions but haven't tested)
  • JDK 1.7 or higher
  • Xcode 6.0 or higher

Troubleshooting

If you run into problems, you can try one of the following:

  • if using Xcode, try cleaning up the project (Product -> Clean)
  • if using the Terminal, you can use one of these 2 cleanup commands:
    • make clean - will delete the /graphhopper-ios/build directory
    • make cleanall - if the first one didn't do it, this will delete everything related to the build process (you then need to run make class.list)

graphhopper-ios's People

Contributors

clns avatar dimohamdy avatar karussell avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.