52
Getting Started with the ArcGIS API for JavaScript Julie Powell, Antoon Uijtdehaag European Developer Summit Rotterdam, Nov. 9, 2012

Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Getting Started with the ArcGIS API for JavaScript

Julie Powell, Antoon Uijtdehaag

European Developer SummitRotterdam, Nov. 9, 2012

Page 2: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Agenda

• Overview• Best Practices

- Maximizing Performance- Building expressive web applications with the latest features

• HTML5• Tips & Tricks• What’s next?• Resources

Page 3: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

ArcGIS for Server Is a Platform for Web GIS

Comprehensive GIS Accessible from the Web, Desktop, and Mobile

• Server Oriented Architecture

• Enabling Web GIS• Rich Application

Clients• High Performance and

scalable• Interoperable• Dissemination and

collaboration

MobileWebDesktop

USEApplications

(clients)

SERVEArcGIS for

Server(Services)

OpenAPIs

OGC

KMLSOAP

SQL

AUTHORArcGIS Desktop

Enabled System

Page 4: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

ArcGIS for Server Services

Map (including WMS, WMTS)• View or query a 2D map on the server

Globe• View or query a 3D globe on the server

Geocode• Perform address matching on the server

Geodata• Perform data replication, extraction, or query

Geoprocessing• Run a tool or model on the server and get results

Image• Provide access to raster data though a Web service

Page 5: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

ArcGIS JavaScript APIs – Why JavaScript?It’s your future ;-)

• Lightweight web GIS

• Pervasive

• Cross-platform, cross-browser, plugin-less

• JS Frameworks abstract away the browser complexity- YUI, Dojo, EXTJS, jQuery

• IDE’s are getting better. Aptana, Notepad ++, Visual Studio

Page 6: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

JavaScript Considerations

• Can be a longer development cycle

• Mobile: limitations with interacting with device, using local storage

• Performance Limitations

Page 7: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Race for the fastest browser – HTML5

• JavaScript Engine- Just in time compilation to byte code- Faster property access- Efficient garbage collection

• Graphics engine improvements

• DOM improvements

• CSS3

Page 8: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

What can you do with the API?

• Interactive maps• ArcGIS Online basemaps • Execute a task• Find an address

Page 9: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Core Library

• Map control• Support for Webmap• Layers

– Tiled, Dynamic, FeatureLayer, WMS, WMTS, KML, Graphics

• Graphics• Tasks

– GP, Network, Geometry, Query, Locator• Geometry• Symbology

– ArcGIS Server Symbology• Toolbars

– Edit, Draw, Navigation

Page 10: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Widgets

Page 12: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Code Editors

Page 13: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Cloud-based IDEs

JSFiddle

Maqetta

Page 14: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Get the API

CDN

Page 18: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Web Map ID

Page 20: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Maximizing Performance

• Tiled layers vs. Dynamic

• Feature Services- With power comes responsibility - Generalizing geometries

• Balancing what you bring client side- Image vs. features- Calculating statistics

• Viewing performance stats

Page 25: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

HTML5: 5 Facts

1. It’s not one big thing2. You don’t need to throw anything away

3. It’s easy to get started

4. It already works

5. It’s here to stay

MARK PILGRIM, Dive into HTML5

Page 26: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Evolution of HTML5

By Sergey Mavrody 2011 | CC Attribution-ShareAlike 3.0

Page 27: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Can I Use?

http://www.caniuse.com/

Page 28: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

HTML5 components in (or soon to be in) the JSAPI

Canvas (pixel control and android graphics)

CSS3 TransitionsCross Origin Resource

Sharing

CPU Intensive Operations (asynch data processing, client geometric operations)

High performance browsers!

CSS 3D Transforms

Page 29: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Example: Store Bookmarks Locally

• Try to store bookmark in local storage.

• If not supported: Cookie

Page 30: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Example: Offline Tiling

• Web Workers• Use Web Storage for Tiles

Page 31: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

HTML5 File AccessUsing Drag and Drop

Page 33: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

JS Beautifier

Page 34: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

JSHint / JSLint

Page 35: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Plug-ins

Page 36: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag
Page 37: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag
Page 38: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag
Page 39: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Extents

Demo

Page 40: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag
Page 43: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Agenda

• Overview• Best Practices

- Maximizing Performance- Building expressive web applications with the latest features

• HTML5• Tips & Tricks• What’s next?• Resources

Page 44: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

ArcGIS API for JavaScript Roadmap

• Simplified API• New Widgets such as Placefinder widget• Dojo 1.8• More build profiles • AMD compliance• Full touch support IE 10

Research• Web Workers• Socket Connections• CityEngine WebScenes

Page 46: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag
Page 47: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag
Page 48: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Layers

Page 49: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

Configure Development Environment

• Set up web server• IDEs• Debugging & Tools

Page 50: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

How to run code from web server (IIS)

Page 51: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

esri.request

Your code

Browser Web Server Remote Server

ArcGIS Server

proxy

Proxy

Page 52: Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoon Uijtdehaag

CORS

esri.request

Your code

Browser Remote Server

ArcGIS Server