open source mobile web maps

30
OPEN-SOURCE MOBILE WEB MAPS Using OpenLayers and jQuery Mobile Gregory L. Gunther

Upload: governmentcu-denver

Post on 01-Nov-2014

6.246 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Open source mobile web maps

OPEN-SOURCE MOBILE WEB MAPSUsing OpenLayers and jQuery MobileGregory L. Gunther

Page 2: Open source mobile web maps
Page 3: Open source mobile web maps

REST

GeoRSS

Flex

AJAX

KML

WMS JavaScript

JSON

Design

Page 4: Open source mobile web maps

General Web Technology Landscape

HTML (5)

JavaScript

CSS

• Content encoding

• Semantic Context

• Easy—”Language of the Web”

• Logic

• Styling

Page 5: Open source mobile web maps

Formats as Representation

Resources(Map)

KML GeoRSS

GeoJSON(AGS)

JPEG2000

GMLJPEG2000

Representations of a resource

SOAPWMS

WFSHTTP Goodness (RESTful)

AMF

Page 6: Open source mobile web maps

OPEN-SOURCE

Page 7: Open source mobile web maps

OPENLAYERS

Page 8: Open source mobile web maps

OpenLayers

“OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles and markers loaded from any source. OpenLayers has been developed to further the use of geographic information of all kinds. OpenLayers is completely free, Open Source JavaScript” -- openlayer.org

JavaScript APIBusiness Case

Alternatives

Page 9: Open source mobile web maps

Open Layers Format Support

ArcGIS (Dynamic and

Cached)ArcIMS

Bing

GeoRSS

GMLPerformance

(Kinetic Panning)

Bing Maps

WMS, WFS

XYZ Standard cache

WorldWind

Page 10: Open source mobile web maps

My First OpenLayers Map

Page 11: Open source mobile web maps

Why Mobile?

Search Engines

Your Site Won’t Work

More Mobile Users Than

Desktop

1/5 Access Mobile Web

All American Adults Own Cell Phones

2 B Cell phones Globally

Page 12: Open source mobile web maps

NATIVE

MOBILE WEB

Page 13: Open source mobile web maps

Native Mobile Apps

Pros• Targets specific device

and unique capabilities• Optimized performance• App store presence**

Cons• Longer development time• Multiple development

platforms for multiple devices

• Costs & Licensing (developer licenses $99, $299, etc) Alford 2011

Page 14: Open source mobile web maps

Mobile Web App

Pros• Multiple platform

support• Single point of

maintenance • No restrictionsCons• Less aesthetically

pleasing UI• Business / commercial• Not a good gaming

platform

Alford 2011

Page 15: Open source mobile web maps

OPENLAYERS

MOBILE

Page 16: Open source mobile web maps

Touch Support Performance (Kinetic Panning)

Bing Maps Representation

Support (JSONP)

Open Layers 2.11

Page 17: Open source mobile web maps

LAB 1

Page 18: Open source mobile web maps

Lab 1 Solution

Page 19: Open source mobile web maps

FurtherOpenLayers Mobile

Features

Drawing Graphics w/ Touch

AccelerometerSupport

Geolocation

Page 20: Open source mobile web maps

The Mobile Challenge

Page 21: Open source mobile web maps

Technologies That Help

CSS Media Queries• CSS styling based on device

screen size• Client Side (In Browser)

Server Side Detection• Based on user agent request• Server renders based on user

agentToolkits• OpenLayers Browser

Detection• jQuery Mobile• Minified Libraries (ArcGIS JS

API)

Page 22: Open source mobile web maps

jQuery Mobile

“A unified user interface system across all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design”

Cross Platform/Device• IOS• Android• BlackBerry• Windows Phone• webOS• More…

Touch Optimized UI Widgets• Provides Native Feel and

Experience• Themable• Bigger

Page 23: Open source mobile web maps

Pages and Popups

Buttons

Lists/Navigation

Form Elements

Themes

Page 24: Open source mobile web maps

UI Examples

Alford 2011

Page 25: Open source mobile web maps

Coding

<!DOCTYPE html>

<html>

<head>

<title>Page Title</title>

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />

<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>

<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>

</head>

……….

<div data-role="page">

<div data-role="header"><h1>Page Title</h1></div

<div data-role="content"> <p>Page content goes here.</p></div>

<div data-role="footer"> <h4>Page Footer</h4> </div>

</div>

Page 26: Open source mobile web maps

OpenLayers and jQuery

<body>

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

<div data-role="header"><h1>Page Title</h1></div

<div data-role="content">

<div id="map"></div>

</div>

<div data-role="footer">

<a href="#layerspage" data-icon="layers" data-role="button">Layers</a>

</div>

……

<div data-role="page“ id=“layerpage”>

<div data-role="header">

<a href="#mappage" data-role="button"><<Back</a>

</div>

<div data-role="content"> <p>Page content goes here.</p></div>

<div data-role="footer"> <h4>Page Footer</h4> </div>

</div>

Page 27: Open source mobile web maps

LAB 2

Page 28: Open source mobile web maps

Lab 2 Solution

Page 29: Open source mobile web maps

REFERENCES

Raymond, E., S. (1999). The Cathedral and the Bazaar. California: O’Reilly Media Inc.

10 Reasons You Should Have A Mobile Ready Website. Weblog entry. Web Design Tips and FAQ’s. December 1, 2010. http://uniqueamb.com/website-design-blog/?p=112 .

Alford, T. (2011). GIS For The Mobile Web. USGS CDI MAD Presentation. https://my.usgs.gov/confluence/display/cdi/MAD+Meetings

Page 30: Open source mobile web maps

RESOURCES

OpenLayers -- http://openlayers.org/

OpenLayers Mobile – http://m.openlayers.org

jQuery Mobile – http://jquerymobile.com

W3c Mobile -- http://www.w3.org/Mobile/