• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
FOSS4G 2011: Mixing It Up with OpenLayers, ArcGIS Server and JavaScript Widgets
 

FOSS4G 2011: Mixing It Up with OpenLayers, ArcGIS Server and JavaScript Widgets

on

  • 7,665 views

Presented at the Free and Open Source Software for Geospatial (FOSS4G 2011) conference by Allan Glen and David Youngerman.

Presented at the Free and Open Source Software for Geospatial (FOSS4G 2011) conference by Allan Glen and David Youngerman.

Statistics

Views

Total Views
7,665
Views on SlideShare
4,863
Embed Views
2,802

Actions

Likes
1
Downloads
0
Comments
0

10 Embeds 2,802

http://blog.allanglen.com 2762
http://feeds2.feedburner.com 20
http://translate.googleusercontent.com 6
http://feeds.feedburner.com 5
http://webcache.googleusercontent.com 3
http://www.feedspot.com 2
http://ranksit.com 1
http://cache.baidu.com 1
http://www.linkedin.com 1
https://www.google.com.co 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Let’s say you’re running your GIS on a vendor platform…
  • Keep in mind that it wasn’t very long ago
  • That interfaces were mostly proprietary and it was hard to mix and match
  • To build maps as embeddable widgets..
  • ..that can easily be embedded into an existing page.This is very different from the normal approach with an API like Google Maps, the ESRI JavaScript API, or Open Layers where you actually build the mapping application into the page.. With a widget we’re providing the entire mapping app from another location and then allowing the result to be easily embedded into any page. The page doesn’t care about the mapping API we’re using..
  • So you’ve seen the widget concept before.. Here is an example from Vimeo that provides snippet to embed a flash object.
  • Here is another example from YouTube that uses an IFRAME to embed a video.
  • And here is another example from Twitter. This is a JavaScript widget which is the technique that we will be talking about.So why would you want to do this with maps?
  • Here is a common use case which is also our use case.
  • Choosing a JS Mapping API
  • Examples, in case demo doesn’t work.
  • Examples, in case demo doesn’t work.
  • Examples, in case demo doesn’t work.

FOSS4G 2011: Mixing It Up with OpenLayers, ArcGIS Server and JavaScript Widgets FOSS4G 2011: Mixing It Up with OpenLayers, ArcGIS Server and JavaScript Widgets Presentation Transcript

  • Mixing It Up
    with OpenLayers, ArcGIS Server
    and JavaScript Widgets
    Allan Glen,
    David Youngerman
    City and County of Denver
  • Let’s say you’re running your GIS on a vendor platform…
    http://www.sxc.hu/photo/1360623
  • Desktop
    Cloud
    Server
    SOAP
    REST
    etc..
    Mobile
    Android
    Web
    iOS
    Windows
    Phone
    Silverlight
    API
    JavaScript
    API
    Flex
    API
    http://www.sxc.hu/photo/375836
  • ..but you want to mix and match some pieces.
    open source?
    http://www.sxc.hu/photo/1056131
  • It wasn’t long ago…
    http://www.sxc.hu/photo/374039
  • …that it was really hard to connect to proprietary GIS systems.
    Based on http://www.sxc.hu/photo/941284
  • …but times have changed.(mostly)
    Based on http://www.sxc.hu/photo/1223568
  • Google Trends: REST API
    Source: http://www.google.com/trends?q=rest+api
  • Google Trends: XML vs. JSON
    http://blog.programmableweb.com/2010/12/03/json-continues-its-winning-streak-over-xml/
    Source: http://www.google.com/trends?q=xml,json
  • Google Trends: jQuery
    Source: http://www.google.com/trends?q=jquery
  • ArcGIS Server REST API
    • Launched June 2008 (ArcGIS 9.3)
    • Image Services
    • Geometry/Feature Services
    • Geocoding
    • Geoprocessing
    • Formats: json, xml, image, kml, wms (wfs/wcs)…
  • Our goal:
    To build maps as embeddable widgets..
    http://www.sxc.hu/photo/1052928
  • ..that could easily be inserted into existing pages.
    HTMLsnippet
    http://www.sxc.hu/photo/1281812
  • A Flash widget
  • An IFRAME widget
  • A JavaScript widget
    (the technique we are using)
  • What we wanted to avoid…
    Main Website
    “GIS Map Viewer”
    http://www.sxc.hu/photo/1114801
  • Mapping Apps as Widgets
    • Maps in context
    • Copy/paste deployment
    • Interaction between map and page
    • Embed in external websites
  • ESRI ArcGIS ServerJavaScript API
    OpenLayers
    Google Maps
    Bing Maps
    Lots of options
    for JS mapping APIs..
    http://www.sxc.hu/photo/1070609
  • Why choose OpenLayers?
  • http://www.sxc.hu/photo/1100324
  • Debuggable
    http://getfirebug.com
  • Easy to modify
    http://www.sxc.hu/photo/480
  • # Custom OpenLayers build for Denver Maps
    [first]
    OpenLayers/SingleFile.js
    OpenLayers.js
    OpenLayers/BaseTypes.js
    OpenLayers/BaseTypes/Class.js
    OpenLayers/Util.js
    Rico/Corner.js
    [last]
    [include]
    # Controls
    OpenLayers/Control.js
    OpenLayers/Control/PanZoomBar.js
    OpenLayers/Control/Navigation.js
    OpenLayers/Control/Attribution.js
    OpenLayers/Control/Panel.js
    OpenLayers/Control/Button.js
    OpenLayers/Control/SelectFeature.js
    OpenLayers/Control/DragFeature.js
    # Layers
    OpenLayers/Layer.js
    OpenLayers/Layer/ArcGIS93Rest.js
    OpenLayers/Layer/Google.js
    OpenLayers/Layer/Google/v3.js
    # Filters
    OpenLayers/Filter.js
    OpenLayers/Filter/Comparison.js
    OpenLayers/Filter/Spatial.js
    # Rules
    OpenLayers/Rule.js
    Custom build system – use only what you need
  • Easy to bootstrap
  • Works well with the
    ArcGIS Server REST API
    • Dynamic map services
    • Cached map services
    • REST API
    • Raw tiles (but not bundles)
    Geometry (custom AgsJsAdapter.js)
    http://trac.osgeo.org/openlayers/ticket/2748
    Wrench icon from http://ipholio.deviantart.com
  • Broad Format Support
    • OGC Web Map Service (WMS)
    • XYZ layers
    • OpenStreetMap (OSM)
    • Bing, Google Maps
    • GeoJSON, GeoRSS, KML, WFS, Text
    • MapGuide, MapServer
    • etc.
  • Avoid vendor lock-in
    http://www.sxc.hu/photo/1339522
  • Use your favorite JS library
    etc..
  • Active Community
    • History
    • Launched in 2005
    • Last release was 2.11 on 9/11/2011
    • Organization support
    • Helped add recent support for mobile devices
    • In active development
    • See http://trac.osgeo.org/openlayers/timeline
  • Demo
  • Embed a fully interactive map in a page with a small snippet of code. Supports address and intersection search,
    auto-complete, and a Google basemapmashup with points projected on the fly from the ArcGIS Server REST API.
    <script language="javascript"
    src="http://www.denvergov.org/maps/api/js/v1?key=479480FE-34A7-4D73-8313-30C8A41AF903"></script>
    <div id="map" style="width: 590px; height: 450px;"></div>
    <script language="javascript">
    DenverMaps.load("map", { app: “Parks" });
    </script>
  • An example showing a “skinned” Denver Maps application versus the default OpenLayers map. The look and feel of an OpenLayers map is easy to customize using CSS. The graphics from the controls were modified from the theme provided by MapBox at http://support.mapbox.com/kb/mapping-101/openlayers-themes.
  • An example showing our parks map overlaying detailed park facilities using an ArcGIS Server Cached Map Service. The tiles have transparency allowing the details to be displayed seamlessly on top of the Google Maps base map. This example uses the XYZ layer type to access tiles through the ArcGIS Server REST API.
  • An example showing our traffic conditions map that uses raw ArcGIS Server tiles provided by the Colorado Department of Transportation (CDOT) through www.cotrip.org. This example uses the ArcGISCache layer type which accesses ArcGIS tiles without using the ArcGIS Server REST API.
  • An example showing our zoning map that use an ArcGIS Server Dynamic Map Service (export image). This example uses the ArcGIS93Rest layer type. Image transparency can be set on the client using OpenLayers.
  • Using JSONP avoids the same-origin policy for cross domain communications, allowing widgets to be embedded on domains other than the domain they are provided from. This example uses a callback (the callback parameter is cut off in the screenshot) to tell ArcGIS Server to return the JSON padded in a callback.
  • An example showing how JavaScript map widgets can be used to provide full interactivity with a host page.
    In this example, the page executes an address search on the map, causing the map to zoom and display a popup.
  • References
    • http://www.openlayers.org
    • http://openlayers.org/dev/examples/arcgis93rest.html
    • http://trac.osgeo.org/openlayers/ticket/2748 (AgsJsAdapter)
    • http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/index.html