gup web mobilegis

70
Getting Started with Web Mobile GIS Andy Gup, Esri @agup

Upload: geco-in-the-rockies

Post on 18-Dec-2014

57 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Gup web mobilegis

Getting Started with Web Mobile GIS

Andy Gup, Esri @agup

Page 2: Gup web mobilegis
Page 4: Gup web mobilegis

What’s on the agenda?

Mobile is NOT desktop

Responsive design

Progressive enhancement

Hybrid

Offline

Page 5: Gup web mobilegis

Why care about mobile?

Users/customers demand it Higher productivity Greater user satisfaction More repeat visits

Page 6: Gup web mobilegis

Examples

Field data collection Road/weather conditions app Zoning enforcement Citizen 311 Historical tours … …

Page 8: Gup web mobilegis

http://xkcd.com/773/

Page 9: Gup web mobilegis

Mobile Devices Are different…

• Physical device

• Screen size

• Button size

Page 10: Gup web mobilegis

User Interactions Are different…

• Touch

• Orientation

• Keyboard

• Voice

Page 11: Gup web mobilegis

User Expectations Are different…

• App to work like an app

• Websites to work like an app

Page 12: Gup web mobilegis

Design Patterns Need to be different!

Page 13: Gup web mobilegis

Think mobile first!

320px

Page 14: Gup web mobilegis

Touch aware map

Page 15: Gup web mobilegis

HTML5 input types

type=“email” type=“tel” type=“date”

Page 16: Gup web mobilegis

Mobile styling

esri/dijit/Geocoder

esri/dijit/LocateButton

Page 17: Gup web mobilegis

Mobile Popups

esri/dijit/PopupMobile

Page 18: Gup web mobilegis

Custom components

Page 19: Gup web mobilegis

A few JavaScript Frameworks

Bootstrap (responsive)

jQuery Mobile (Progressive Enhancement or responsive)

PhoneGap (Hybrid)

Page 20: Gup web mobilegis

Responsive

Page 21: Gup web mobilegis

Default Behavior

Page 22: Gup web mobilegis

Responsive Grid Layouts

Vertical Stacking

Page 23: Gup web mobilegis

Large: 3 Rows - 3 Columns

>= 1280px

Page 24: Gup web mobilegis

Medium: 2 Columns

1024 - 1280px

Page 25: Gup web mobilegis

Small: Single Column

768 - 1024px

Page 26: Gup web mobilegis

X-Small: 1 Column, Minimized

=< 768px

Page 27: Gup web mobilegis

Responsive HTML5 Application

Page 28: Gup web mobilegis

Dev Tip: HTML Viewport Settings

<head>

<meta name="viewport"

content="width=device-width,

initial-scale=1.0,

maximum-scale=1.0,

user-scalable=no">

</head>

Page 29: Gup web mobilegis

Bootstrap (Responsive)

Single web app that works well across

a variety of devices/screen sizes

Re-use content and software

Considers

Device limitations

User’s behavior

Page 30: Gup web mobilegis

Bootstrap (Responsive)

Page 31: Gup web mobilegis

Bootstrap (Responsive)

Page 32: Gup web mobilegis

Fluid Grid System

Layout adapts to:

- different screen sizes

- Device orientation

Based on percentages

12 column / 960px

Page 33: Gup web mobilegis

Fluid Grid System

Page 34: Gup web mobilegis

CSS Media Queries

Detect device screen size and orientation

/* Extra small devices (phones, less than 768px) No media query -- Bootstrap default */ /* Small devices (tablets, 768px and up) */ @media (min-width: @screen-sm-min) { ... } /* Medium devices (desktops, 992px and up) */ @media (min-width: @screen-md-min) { ... } /* Large devices (large desktops, 1200px and up) */ @media (min-width: @screen-lg-min) { ... }

Page 35: Gup web mobilegis
Page 37: Gup web mobilegis

Progressive Enhancement

Page 38: Gup web mobilegis

jQuery Mobile

Can be progressively enhanced or responsive

If “Progressive”:

Built with specific screen sizes in mind

Formal control of UX

Mimics native app look, feel and behavior

Multi-page views

**Perfect for use in Hybrid applications

Page 39: Gup web mobilegis

Progressive enhancement

Desktop Phone

Page 40: Gup web mobilegis

Progressive enhancement

Desktop Phone

Page 41: Gup web mobilegis

Desktop view of mobile app

Page 42: Gup web mobilegis

Browser detection

Page 43: Gup web mobilegis

Browser/device type

Server-side browser/device detection

- http://detectmobilebrowsers.com/

Client-side browser/device detection

- Modernizr

- YepNope

Page 44: Gup web mobilegis

Single Page View

Page structure

Apply CSS, roles and themes

Page 45: Gup web mobilegis

Single Page Map - HTML

<div data-role="page" id="home">

//Header

<div data-theme="a" data-role="header"

data-position="fixed">

<h3>HTML5 Geolocation</h3>

</div>

//Map

<div data-role="content">

<div id="mapDiv"></div>

</div>

</div>

Page 46: Gup web mobilegis

Single Page Map - HTML

<div data-role="page" id="home">

//Header

<div data-theme="a" data-role="header"

data-position="fixed">

<h3>HTML5 Geolocation</h3>

</div>

//Map

<div data-role="content">

<div id="mapDiv"></div>

</div>

</div>

Page 47: Gup web mobilegis

<div data-role="page" id="home">

//Header

<div data-theme="a" data-role="header"

data-position="fixed">

<h3>HTML5 Geolocation</h3>

</div>

//Map

<div data-role="content">

<div id="mapDiv"></div>

</div>

</div>

Single Page Map - HTML

Page 48: Gup web mobilegis

Single Page Map - CSS

html,body, div[data-role ="page"]

{

height: 100%;

width: 100%;

margin: 0px;

padding: 0px;

}

.ui-header{

margin: 0px !important;

padding: 0px !important;

float: left;

}

.ui-content{

height: 100%;

width: 100%;

margin: 0px;

padding: 0px;

}

#mapDiv {

position: absolute;

background-color: #EEEEDD;

height: 100%;

width: 100%;

padding: 0px;

z-index: 0;

left: 0px;

}

Page 49: Gup web mobilegis
Page 51: Gup web mobilegis

Hybrid

Page 52: Gup web mobilegis

What is PhoneGap?

Native wrapper around headless browser

Cross-device access to storage and sensors

Create JavaScript apps for Google Play, App Store

Typically used in conjunction with jQuery

Page 53: Gup web mobilegis

PhoneGap + JavaScript

+ HTML + CSS +

Mobile JavaScript

Framework

= Android SDK

Project

Page 54: Gup web mobilegis

Native deployment

Page 55: Gup web mobilegis

Access to:

GPS Camera SD Card Compass Accelerometer Connection State …

Page 56: Gup web mobilegis

Why PhoneGap?

Page 57: Gup web mobilegis

PhoneGap vs Cordova

PhoneGap came first

Original developer Nitobi

Adobe acquired Nitobi (Oct 2011)

Apache Cordova open source project (2011)

Share same code base

Adobe PhoneGap Build (Sep 2012)

Becomes top-level Apache Project (Oct 2012)

Page 59: Gup web mobilegis

Optimize

Page 60: Gup web mobilegis

ArcGIS Web Optimizer

Online tool

Single ArcGIS JavaScript library file!

Faster download

At least 3x smaller

Page 61: Gup web mobilegis

ArcGIS Web Optimizer

<script

src="http://localhost/test/dojo.js"

data-dojo-config="async: true">

</script>

Page 62: Gup web mobilegis

ArcGIS Web Optimizer

http://jso.arcgis.com/

Page 63: Gup web mobilegis

Grunt-uglify

http://gruntjs.com/

Page 64: Gup web mobilegis

Offline JS

Page 65: Gup web mobilegis

Offline JavaScript? Yes!

Lightweight tools for intermittent offline or fully offline

Editing of features and tile management

Resync edits when internet reestablished

Ability to reload or restart offline

Page 66: Gup web mobilegis

Need full featured, robust offline solution?

ArcGIS Runtimes for iOS, Android, Qt and .NET! Includes integrated support for offline editing and synchronization. Fully supports related tables, sub-types, domains and much more.

Page 68: Gup web mobilegis

Offline trails app

Mtn biking

Hiking

Page 69: Gup web mobilegis

Recap

Think Mobile first Prototype, prototype and prototype Use ArcGIS Web Optimizer and Grunt Offline JS is possible!