This repo is home to the mobile mapbook app, an example application using the ArcGIS Runtime SDK for iOS. Replace the paper maps you use for field work with offline maps.
- Features
- Best Practices
- Detailed Documentation
- Get Started
- Learn More
- Requirements
- Contributing
- MDTOC
- Licensing
- Mobile map packages
- Feature layers
- Identify
- Table of Contents
- Show a legend
- Use a map view callout
- Geocode addresses
- Suggestion search
- Bookmarks
- Sign in to your portal
The project also demonstrates some patterns for building real-world apps around the ArcGIS Runtime SDK.
- Defining a modular, decoupled UI that operates alongside a map view
- Asynchronous service and UI coding patterns
- Internal application communication patterns
- FileManager used with ArcGIS
Read the docs for a detailed explanation of the application, including its architecture and how it leverages the ArcGIS platform, as well as how you can begin using the app right away.
Make sure you've installed Xcode and the ArcGIS Runtime SDK for iOS and that they meet these requirements.
Fork the Mapbook App repo.
Once you have forked the repo, you can make a clone.
Make sure to use the "recursive" option to ensure you get the ArcGIS Runtime Toolkit submodule
git clone --recursive [URL to forked Git repo]
If you've already cloned the repo without the submodule, you can load the submodule using
git submodule update --init
- Clone the Mapbook App
cd
into themapbook-ios
folder- Make your changes and create a pull request
If you make changes in the fork and would like to sync those changes with the upstream repository, you must first configure the remote. This will be required when you have created local branches and would like to make a pull request to your upstream branch.
- In the Terminal (for Mac users) or command prompt (fow Windows and Linus users) type
git remote -v
to list the current configured remote repo for your fork. git remote add upstream https://github.com/Esri/mapbook-ios.git
to specify new remote upstream repository that will be synced with the fork. You can typegit remote -v
to verify the new upstream.
If there are changes made in the original repository, you can sync the fork to keep it updated with upstream repository.
- In the terminal, change the current working directory to your local project
- Type
git fetch upstream
to fetch the commits from the upstream repository git checkout master
to checkout your fork's local master branch.git merge upstream/master
to sync your localmaster
branch withupstream/master
. Note: Your local changes will be retained and your fork's master branch will be in sync with the upstream repository.
Before running the app, it must be configured with application credentials. Follow the steps below to obtain application credentials used for browsing and downloading Portal content.
- Register an ArcGIS Portal Application.
- Configure the Mapbook App project to reference that application.
- License the app to remove the Developer Mode watermark.
For OAuth configuration, create a new Application in your ArcGIS Portal to obtain a Client ID
and configure a Redirect URL
. The Client ID configures the ArcGIS Runtime to show your users, during the log in process, that the application was built by you and can be trusted. The Redirect URL configures the OAuth process to then return to your app once authentication is complete.
- Log in to https://developers.arcgis.com with either your ArcGIS Organizational Account or an ArcGIS Developer Account.
- Visit your dashboard and create a new application.
- In the Authentication tab, note the Client ID
- In the Authentication tab add a redirect URI to the Current Redirect URIs section. By default the Xcode project is configured to authentication callbacks using:
mapbook://auth
Configure Redirect URL
- Open the project in Xcode and browse to the
mapbook-iOS
target'sInfo
panel and expand theAGSConfiguration
dictionary (see steps 1-4 in the screenshot below). - Set the
AppURLScheme
value to match the Redirect URL scheme configured in "Register an Application" above. The scheme is the app name that comes before://
in the redirect URI.
mapbook://auth
- Expand the URL Types section and modify the existing entry.
- The Identifier doesn't matter, but should be unique.
ex: com.esri.mapbook
- The URL Scheme should match the Redirect URL scheme configured in "Register an Application" above. The scheme is the app name that comes before
://
in the redirect URI.
mapbook://auth
Configure Client ID
- In the Navigator pane under the project, find the file named
AppSettings.swift
. - Within
AppSettings.swift
set the value of the static variableclientID
to the application's Client ID noted in the step 'Register an Application'.
This step is optional during development, but required for deployment.
- Access your dashboard and get your Runtime Lite license key.
- Open the project in Xcode and navigate to
AppSettings.swift
, the same file used to configure your applications client id. - Set the value of the static variable
licenseKey
to the value from step 1.
Learn more about the App Architecture and usage here.
- Xcode 12 and Swift 5
- ArcGIS Runtime SDK for iOS, version 100.10.
- ArcGIS Runtime Toolkit for iOS, version 100.10.
- Device or Simulator running iOS 13.0 or later.
Note: Starting from the 100.8 release, the ArcGIS Runtime SDK for iOS uses Apple's Metal framework to display maps and scenes. However, Xcode does not support Metal based rendering in any version of iOS simulator on macOS Mojave. If you are developing map or scene based apps in these environments, you will need test and debug them on a physical device instead of the simulator.
Note: The 100.10 release of the ArcGIS Runtime SDK for iOS replaces the installed "fat framework" ArcGIS.framework
with a new binary framework ArcGIS.xcframework
. It also changes the location of the installed framework file and removes the need for the strip-frameworks.sh
Build Phase. These changes have been incorporated in the latest release of Mapbook iOS.
Anyone and everyone is welcome to contribute. We do accept pull requests.
- Get involved
- Report issues
- Contribute code
- Improve documentation
Generation of this and other documents' table of contents in this repository was performed using the MDTOC package for Atom.
Copyright 2017 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's LICENSE file.
For information about licensing your deployed app, see License your app.