Field Work is a web application that supports offline editing and mapping of geospatial data. This app:
- downloads and saves geospatial data locally for offline use by Cloudant Geo or Lucene Geo query
- has a UI that supports editing of points, lines, and polygons
- syncs locally-edited data back to an IBM Cloudant database
Many field-based industries whose personnel are disconnected from communications networks—often in remote areas or even underground—can benefit from this kind of offline-first mobile application. This demonstration is designed for utilities repair personnel who need to capture events in work orders.
-
Blog post: Better infrastructure maintenance with offline mobile maps
-
Presentation: Field Work: Map-centric mobile apps with Cloudant Geo and LeafletJS
Play with the live demo version of this app. To get started:
- Drag the map to an area you want to see.
- Click the Load Data button.
- On the upper right of the map, choose the data types you want to see.
- In the left pane, click the Edit Pins button. Pushpins appear on the map.
- On the left side of the map, use the controls that appear to edit and add pins. (Hover over a control for guidance.)
This an architectural overview of the components that make this app run.
The fastest way to deploy this application to Bluemix is to click this Deploy to Bluemix button. If you prefer instead to deploy manually to Bluemix then skip ahead to the Manual Development section.
Don't have a Bluemix account? If you haven't already, you'll be prompted to sign up for a Bluemix account when you click the button. Sign up, verify your email address, then return here and click the the Deploy to Bluemix button again. Your new credentials let you deploy to the platform and also to code online with Bluemix and Git. If you have questions about working in Bluemix, find answers in the Bluemix Docs.
Bluemix creates a random, unique URL for your app, each time you deploy. If you want to customize and set a static URL, you can do so in the IBM Bluemix DevOps Services project created for you when you deployed.
- On the Bluemix Deployment Successful screen, click the Edit Code button.
- Find and open the
manifest.yml
file. - Change the line
random-route: true
tohost: my-unique-app-name
On the next deployment, the URL for your app will be my-unique-app-name.mybluemix.net
If you plan to modify the code for this app, and want to use GitHub's code repository (instead of IBM Bluemix DevOps Services), follow the instructions in the next section.
-
Fork the repo Click the Fork button in the top right corner of this repository
-
Create a Bluemix Account
Sign up for Bluemix, or use an existing account.
-
Download and install the Cloud-foundry CLI tool.
-
Clone the app to your local environment from your terminal using the following command
git clone https://github.com/ibm-cds-labs/fieldwork
-
cd into your newly created directory.
-
Edit the
manifest.yml
file and change the<application-host>
to something unique.
---
declared-services:
cloudant-fieldwork-db:
label: cloudantNoSQLDB
plan: Shared
applications:
- name: fieldwork
host: fieldwork-gr8one
memory: 128M
disk_quota: 512M
path: .
domain: mybluemix.net
instances: 1
services:
- cloudant-fieldwork-db
The host you use determines your application url initially, e.g. <application-host>.mybluemix.net
.
- Connect to Bluemix in your command-line tool and follow the prompts to log in.
$ cf api https://api.ng.bluemix.net
$ cf login
- Create the Cloudant service in Bluemix.
$ cf create-service cloudantNoSQLDB Shared cloudant-fieldwork-db
To deploy to Bluemix, simply:
$ cf push
The Field Work sample web application includes code to track deployments to Bluemix and other Cloud Foundry platforms. The following information is sent to a Deployment Tracker service on each deployment:
- Application Name (application_name)
- Space ID (space_id)
- Application Version (application_version)
- Application URIs (application_uris)
This data is collected from the VCAP_APPLICATION environment variable in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
You can disable deployment tracking by removing ./admin.js track &&
from the install
line of the scripts
sections within package.json
.
Licensed under the Apache License, Version 2.0.
Field Work is a sample application created for the purpose of demonstrating an offline geographic data sync and editing application. The program is provided as-is with no warranties of any kind, express or implied.