With open source projects, you expect to get all the source code. Sure enough, that’s what we do with WhirlyGlobe-Maply. All of it is available on github, with a long history and references to other projects we use.
So the most open-source-y way to set yourself up is with submodules. It’s also the slowest, but we like it.
Open a Terminal window, and change to the root directory of your project. That directory should contain HelloEarth.xcodeproj.
Create a libs subdirectory and add WG-Maply in that path.
Next, we need to initialize and update WG-Maply’s dependencies. We heard you liked submodules, so we put submodules in your submodules. No, we’re not proud of that joke.
This part will take a while. WG-Maply uses a bunch of other projects and it has a lot of data in its Resources submodule.
Once it’s done we’re done with Terminal. Close that window and open the HelloEarth project in Xcode.
In some rare cases you may have problems upgrading an existing installation to 2.3 or… other times this happens. Hey, git is a dark art.
If you get an error message when doing the submodule init, try running the update_from_2_2_to_2_3.sh script. It cleans out the submodules and tries again, basically.
Now you need to add the WG-Maply library to the project, along with a number of others upon which WG-Maply depends.
Select the HelloEarth project, then go to Build Phases, and expand Link Binary With Libraries.
Click the + at the bottom, and then Add Other.
Navigate to the libs/WhirlyGlobeMaply/WhirlyGlobeSrc/WhirlyGlobe-MaplyComponent/ directory, and select WhirlyGlobeMaplyComponent.xcodeproj. Click Open. If you are prompted to share a working copy, no is fine.
Click + again, and you will see a new option: libWhirlyGlobeMaplyComponent.a. Select that and click Add. You’ll need to and add the following libraries as well:
Once you have all those libraries added, it should look like this.
Finally, we need to add the path to the WG-Maply headers so Xcode knows where to find the includes. To do this, go to Build Settings and look for Header Search Paths.
Click + and add the following path.
Maybe you’re a lucky guy and you’re doing your iOS project using Swift. In such case, you need one final step. Go to Build Settings and look for “Objective-C Bridging Header”.
Type there the following path:
At this point, your project should be set up properly and you’ll be linked to the github repo for updates.
Next up, let’s look at something!