43
Building Mashups Using the ArcGIS Web APIs Nikki Golding

Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Building Mashups Using the ArcGIS Web APIs

Nikki Golding

Page 2: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Agenda

• Introduction

• ArcGIS Javascript API

• ArcGIS API for FLEX

• ArcGIS API for Silverlight

Page 3: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

What is a “mashup”?

In web development, a mashup is a web application that combines data from more than one source into a single integrated tool.

- Wikipedia

Page 4: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

DemoLandscope

Page 5: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS Server 9.3 mashupsWhat is a mashup?

Supported Web Clients

Consumer Mapping

Mashup

ArcGIS JavaScript APIVirtual Earth\Google Maps

OpenLayers

Yahoo Pipes

CAdobe Flex/Java Fx/Silverlight

Other Web Clients

Page 6: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS Server Web APIsRich Internet Applications

• New at 9.3

• Build modern web applications

• Use development environment of your choice

ArcGISServer

REST

JavaScript API

FlexAPI

SilverlightAPI (Beta)

9

Page 7: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS Server Web APIsSilverlight, Flex, JavaScript

• Client-side technology• Use the REST API• Embed maps and tasks from any ArcGIS Server• Available at the ESRI Resource Center

10

Page 8: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS Server Resource Center

• http://resources.esri.com/arcgisserver

Page 9: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

UC2008 Technical Workshop 12

ArcGIS Server REST API

• Service Directory: –A simple view of your ArcGIS Server (example)

• All GIS Services are exposed as resources– Service level metadata

• Resources have operations–Map Service (export, find, identify)–Map Service Layers (query)– Image Services (export)–Geocode Service (Find Address Candidates, Reverse Geocode)–Geoprocessing (execute, submit job)–Geometry Service (project, simplify, and others*)

12121212121212121212121212121212112

Page 10: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS Server Functions

•Maps

– Tiled Maps• Cached• Accesses tiles from a cache instead of dynamically rendering images

–Dynamic Maps (MXD Based and Optimized Map @9.3.1)• Generates images on the fly

–Map Navigation• Drag the mouse to pan • Mouse Scroll Forward to zoom in • Mouse Scroll Backward to zoom out • SHIFT + Drag the mouse to zoom in • SHIFT + CTRL + Drag the mouse to zoom out • SHIFT + Click to recenter• SHIFT + Double Click to Center and Zoom in • Use arrow keys to pan • Use + key to zoom in a level • Use - key to zoom out a level

Page 11: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

DemoBase Map, Extent

GraphicsSymbolsGeometryAttributesInfoTemplate

Page 12: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic
Page 13: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS Server Functions

• Graphics

–Graphics (geometry + attributes + symbol + InfoTemplate)

– Each map has a GraphicLayer

–Allows for the drawing of graphics on top of the map

–Can be drawn by the user as markup or input to a task

–Can be drawn by the application in response to a task

– Exist as vectors in the browser

–Mouse Events on GraphicLayer• onClick, OnMouseIn, OnMouseOut, OnMouseOver

Page 14: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS Server Functions

• Tasks

–QueryTask

– Locator

– FindTask

– IdentifyTask

–Geometry

–Geoprocessor (synchronous or asynchronous)• Data• Map image

––QueryTaskQ

–– LocatorL

–– FindTaskF

–– dentifyTaskId

––GeometryyG

––GeoprocessssssooG rrp ssyynncccchhrroonnoo((ss•• DataD•• Map immaaggeeeeM

oouuss oooorrrr asssssyyyyyynnnnncccchhrrroooonnnnooooouuuuuuuuuuusssssssss)))))

Page 15: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Agenda

• Introduction• ArcGIS Javascript API• ArcGIS API for FLEX• ArcGIS API for Silverlight

Page 16: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

What is Javascript ?

• Increase the interactivity of web pages

• Pure client development; runs in the browser

• No web application server (IIS, Apache/Tomcat)

• No download or install; not a plug-in

• All web browsers know how to interpret it.

• Develop in text editor

• ncrease the iinntteerraaaacctttiivvitty ooofff wweebbbbbb ppppppppaaaaggggggggggggeeeeeeeeeesssss In

•• Pure client developpmmmmeeenntt;; rruunnns in tthhheeee brrrrroowwsssseeeeeeeeeerrrrrrrrrrrrrP

•• No web application serrvvveeerr ((IIISSS, AAAApppaaaaccccchhhe/TTooommmmmmmmmccccccccccaaaatt))))N

• No download or install; nott aa pplluuN gggg- nnniin

• All web browsers know how to innttteeerrpprreeett iiitt.A

• Develop in text editorD

Page 17: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

What is the ArcGIS Javascript API?

• Free Browser based API

• Collection of Javascript classes

• For developing high performance, easy to use mapping applications.

• Hosted by ESRI on ArcGIS Online–High performance and availability (Akamai)

• Embed maps and tasks from any ArcGIS Server into your website

• Uses the REST API

• Built on Dojo Toolkit

sses

mance, easy to uuusssseee mmmaaapping

OnlineOability ( kamaaAk ai))

m anyy rcGGGIISA SS Seeerver intttttoo yyyyooour wwwwwwwwebbbbbbbbbsssssiiiiittteeeeeeeeS

Page 18: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Dojo Toolkithttp://dojotoolkit.org/

• Javascript library• Abstract browser complexity• Powerful eventing model and graphics support• Dojo Dijits–Grids–Charts– Toolbars– Trees–Many more

• Active Community

Page 19: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Creating JavaScript mapping Web pages

ArcGIS Server

1. Author Maps / GP Models

2. Publish resources to ArcGIS Server

3. Discover services using

Services Directory

4. Copy/Paste HTML/JS from

Resource Center

5. Preview Web application

HTML / JS

Page 20: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

DemoKansas Oil and Gas, Thematic Representation

Page 21: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Sample Javascript ViewerJavascript Viewer

Page 22: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

• Combine GIS content hosted in ArcGIS Server with content on top of Google Maps or Virtual Earth base maps

• Works with backend ArcGIS Server services

• Applications can be built in *traditional* Mashup form or as Google Mapplets (maps.google.com)

• VE Shapes and Tiles can be viewed in 2D and 3D

• Tiled Maps are in the WGS 1984 Web Mercator projection–WKID: 102113

ArcGIS Server Javascript Extensions Google Maps API , Virtual Earth

Page 23: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Other Resources• Online SDKs

– http://resources.esri.com/arcgisserver/apis/javascript/...– Sample driven–Code gallery– Samples powered by an ArcGIS Server sample server• http://sampleserver1.arcgisonline.com/arcgis/rest/services• http://sampleserver2.arcgisonline.com/arcgis/rest/services

• JavaScript hosted by ESRI– http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1– Flexible release cycle–Hosted by ArcGIS Online • 24/7

Page 24: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Questions?

Page 25: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Agenda

• Introduction

• ArcGIS Javascript API

• ArcGIS API for FLEX

• ArcGIS Silverlight API

Page 26: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

What is Flash?

• Technology for delivering RIA to browser

• Runs in the Flash Player

• Compiled executable–Delivered as a SWF file

• Even if you’ve never heard of it, you have seen it…

Page 27: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Advantages of Flash

• Ubiquity

• Cross-browser compatibility

• Compiled–Discover errors at compile-time vs. run-time

• Layout tools

• Built-in transitions and effects

• CrosC sss- rowser compppaaaaaaatttttttiiiiibbbbbbiiiilllitttttyyyybrb

• CompiledC p––Discover errors aaattt cccccooommmmpppiiilllD lleeeee-- mmmeee vvvvsss... ruiiimmtttii nnnnn- mmeiimmmtttii

• Layout toolsL

• BuiB ltt- n trannnnnnsssiiiittttiiiioooonnnnsss aaaaannnnnddddd eeeeeeeffffffffffffffffffeeeeeeeeecccccccctttttttsssssssnin

Page 28: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

•MXML–Used to define the GUI

–Create objects declaratively

– XML based tags

The Basics

• ActionScript

– Ecma-based scripting language

–Object-oriented

Page 29: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

MXML & ActionScript

Page 30: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Flex Builder

Demo

Page 31: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS API for Flex

• Collection of ActionScript classes

• Provides–Map canvas – Various GIS objects • e.g. Graphics, Geometry, Layers

–Utilities• e.g. Toolbars

• Uses the REST API

Flash Application

Flex API

ArcGIS Server ArcGIS Online

ArcIMS

REST

Page 32: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

ArcGIS Server Functions

•Maps (layers)–ArcGISDynamicMapServiceLayer–ArcGISTiledMapServiceLayer–ArcGISImageServiceLayer–ArcIMSMapServiceLayer–GPResultImageLayer

• Tasks– Find–GeometryService–Geoprocessor– Identify– Locator–Query

Flash Application

Flex API

ArcGIS Server ArcGIS Online

ArcIMS

REST

Page 33: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Some Demos

City of Greeley, Colorado

Maryland iMAP

Page 34: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Using the API

• Delivered as a SWC• Included in the Flex Build Path

Page 35: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Step 1: Get Flex Builder

• Available as download from Adobe• 60 day eval period

Page 36: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Step 2: Product Home Page

• Address:– http://resources.esri.com/arcgisserver/apis/flex

• API Download• Documentation• Samples

Page 37: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Flex Sample Viewer• Template• Available in two forms:

–Compiled– Source code…

Page 38: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Silverlight API

Page 39: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Features

• Designed for the Silverlight and WPF Platform• Integrate ArcGIS Server and Microsoft Virtual Earth Services and

capabilities• Create rich, interactive and expressive web applications

–Use Maps, Locators, and Geoprocessing models–Use with Silverlight components• Standard in the box components• Sivlerlight Control Toolkit• Any Silverlight library

• WPF supports native 64 bit (x64) platforms– Pure managed code

Page 40: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Requirements

• Microsoft Silverlight Platform

• Tooling–Microsoft Visual Studio 2008 SP1• Any version, Express on up to Team Suite• .NET 3.5 SP1

– Silverlight Tools for Visual Studio 2008 SP1 (add-on)– Silverlight Toolkit (CodePlex)

• Other Products– Expression Blend 2 SP1

Page 41: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Libraries

• ESRI.ArcGIS.dll–Core Library.–Contains map, ArcGIS Service Layers, Graphics, Geometry, and

Symbol components• ESRI.ArcGIS.VirtualEarth.dll– Virtual Earth Library–Adds support for using Virtual Earth layers and services

• ESRI.ArcGIS.Widgets.dll*–Common set of controls for navigating and interacting with the map• Navigation Control, Scalebar, toolbar, etc.

*Widget source code to be made available soon– CodePlex or Code Gallery – we need you to tell us!

Page 42: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Roadmap

• V1 - Public Beta – NOW!– http://resources.esri.com/arcgisserver/apis/silverlight/–Download libraries and begin building your web sites today

• Snapshots every 4-6 weeks or sooner• Final Target: July, 2009

• Silverlight 3 beta support now–We are actively working with Microsoft on Silverlight 3 support

• Would like your feedback!

Page 43: Building Mashups Using the ArcGIS Web APIs · ArcGIS Server Functions • Maps –Tiled Maps • Cached • Accesses tiles from a cache instead of dynamically rendering images –Dynamic

Thank you for attending.Please fill out a session survey.

Questions?