arcgis api for javascript: an introduction...• 2d and true 3d (above ground, below ground, fully...

37
ArcGIS API for JavaScript: An Introduction Andy Gup, @agup ArcGIS API for JavaScript team

Upload: others

Post on 04-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

ArcGIS API for JavaScript:An Introduction

Andy Gup, @agupArcGIS API for JavaScript team

Page 3: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Resources for getting started

Online Tutorials => https://developers.arcgis.com/labs/Over 200 samples => https://developers.arcgis.com/javascriptGeoDev Webinars => https://www.esri.com/en-us/landing-page/product/2018/geodev-webinar-series

GeoNet – ArcGIS API for JavaScript2018 DevSummit Tech Sessions (2019 will be available soon)2019 DevSummit Plenary (Youtube)

Page 4: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Sign up for a free developer accounthttps://developers.arcgis.com/

Page 5: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Capabilities

https://developers.arcgis.com/javascript/latest/api-reference/

• 2D and true 3D (above ground, below ground, fully interactive)• Many different layers• Out-of-the-box widgets• Client-side geometry engine• Client-side projection engine• Tasks• And so much more!

Page 7: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Maps and Views

• Maps manage references to basemaps and layers.• Views display layers, handle user interaction, popups and widgets

Page 8: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

How do I get the library?

• Content Delivery Network (CDN)

• Or, locally custom builds hosted (npm or webpack)

https://developers.arcgis.com/javascript/latest/guide/using-webpack/

Page 9: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Data, data, data

The API works with many different types of data:

https://developers.arcgis.com/javascript/latest/api-reference/index.html#layers

Page 10: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

What the what?

Data – 2D, 3D, spatial or non-spatial

Service – makes data accessible via HTTP

Layer – displays a collection of spatial data in vector or raster format

Page 11: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Data & layer demo

USGS Earthquake CSVCSVLayer for display

https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=layers-csv

Page 12: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Data + Service + FeatureLayer Demo

Take the Earthquake CSV and convert to hosted FeatureLayerExample: https://services.arcgis.com/uCXeTVveQzP4IIcx/arcgis/rest/services/2_5_week/FeatureServer

Example Demo

Page 13: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Add a renderer to the FeatureLayer demo

• https://jsbin.com/kobiyip/edit?html,output

Page 14: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Add a visual variables to the FeatureLayer demo

• https://jsbin.com/vapayuq/edit?html,output

Page 15: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Add a popup to a FeatureLayer

• https://jsbin.com/dowavux/edit?html,output

Page 16: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Add CSV to Webmaphttps://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv

Page 17: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Add Webmap to custom JS map app

• https://jsbin.com/gubopen/edit?html,output

Page 18: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

And now for some more cool stuff

Page 26: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Some developer things about Web GIS

Page 27: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

ArcGIS REST API

https://developers.arcgis.com/ > Documentation

Mapping AppArcGIS Online/

ArcGIS EnterpriseArcGIS REST API

Services:• Map tiles• Features• Imagery• And, more!

Page 28: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

REST API Demo

• Demo feature service debugging

• What is .pbf?? ProtocalBuffer Binary Format• What is Brotli? Better compression that .zip

Page 29: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Development Environments (IDEs)

A partial list of the most popular:• Visual Studio Code (free)• Visual Studio• WebStorm • IntelliJ

Page 30: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Bonus slides!

Page 31: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Be aware of app performance“Responsive” also means User Interface performanceUsers will notice any operation longer than . . .

16ms** 60Hz or 60 FPS

Page 32: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Improve app performance – be kind!

Test using real scenarios – test on phone over cellular not WiFi

Lazy Load

Use fewer map layers

Simplify rendering

Use Web workers

Page 33: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Lazy load

• Avoid huge require() statements…wait till you need it

Page 34: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Lazy load layers

• Don’t load’em until you need’em!

Page 35: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Please Take Our Survey on the App

Download the Esri Events app and find your event

Select the session you attended

Scroll down to find the feedback section

Complete answersand select “Submit”

Page 36: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side

Andy GupTechnical Product Manager,ArcGIS API for [email protected]@agup

Page 37: ArcGIS API for JavaScript: An Introduction...• 2D and true 3D (above ground, below ground, fully interactive) • Many different layers • Out-of-the-box widgets • Client-side