Using OpenLayers with ArcGIS Server REST API
March 25, 2009 25 Comments
Here is my user presentation from the 2009 ESRI Developer Summit. Feel free to email me with questions or post below. You can get the instructions and code (including a zip file with everything ready to work out of the box) online. Many people have told me that they are very interested in working with ArcGIS Server and OpenLayers so some really great things should be happening soon.

Dude – some day you will look back at that slide show -and like a 70′s leisure suit and pleather jacket say … what were we thinking. interesting content. whack presentation style.
I remember there was buzz about this from the time Jack mentioned OpenLayers at the 2008 FedUC. Thanks for closing the loop.
very interested to hear the audio – will ESRI be posting this on the resource pages? Can you post link here, when they do?
Looks good.
Thanks for the presentation, it is awesome
Can’t wait to listen the cast of whole presentation.
Yes as soon as ESRI posts the audio, I’ll go ahead and post that. I was told about a week.
James, great presentation. Glad you were able to highlight the Long Island Index map project. We’re a week or two away from deploying another OpenLayers/ArcGIS combo, this time an upgrade of an old ArcIMS site. I’ll keep you posted when we launch the beta version.
Btw, love the “restful” photo — those La-Z-Boy sofas are great.
Looks like Dave Bouwman gave you a run for your money in terms of crazy photos: http://www.slideshare.net/dbouwman/unit-testing-101?type=powerpoint
Dave’s talk was way beyond mine. As always he kicks ass…
We all know though, “It’s not the amount of crazy photos that makes the talk, it’s how you use them”.
Pingback: James Fee GIS Blog » Blog Archive » Reflections on the 2009 ESRI Developer Summit
Pingback: Fernando Quadro - Usando OpenLayers com a ArcGIS Server RESTFul API
Is it possible to consume AGS REST cached services using OpenLayers?
Yes, ArcGIS Tiled map services are supported at 2.8
ArcGIS tiled map services are not supported in OpenLayers 2.8.
So that AGS REST stuff didn’t make the trunk?
Well if that is the case you can download a patched version here that supports ArcGIS Server REST API, including the tile service:
http://mkgeomatics.com/apps/REST_Dev/
The REST stuff is in trunk, and will be included in 2.8, but it isn’t about accessing map caches; it uses the export service.
http://mkgeomatics.com/apps/REST_Dev/arcgis93rest.html doesn’t use tiles: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export?LAYERS=show%3A0%2C2&TRANSPARENT=true&FORMAT=png&BBOX=-110%2C34.4%2C-94%2C50.4&SIZE=256%2C256&F=image&BBOXSR=4326&IMAGESR=4326is the image it is loading. (That service on the sample server doesn’t have pre-cooked tiles to compare to.) Pre-cooked tiles look more like: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer/tile/7/45/20 . Using the export service in a non-single tiled mode is generally a mistake due to performance.
Of course, it has always been possible to consume ArcGIS Server’s tile services to some extent, and that’s still true (and even easier) in 2.8: http://openlayers.org/dev/examples/xyz-esri.html is a simple example. But there is no specific support for ESRI tiling, and I expect that anyone who tried to use this seriously would find themselves in trouble from some aspect of it that doesn’t take ESRI-specifics into account.
(My previous comment disappeared; perhaps due to moderation. trying again.)
The REST stuff is in trunk, and will be included in 2.8, but it isn’t about accessing map caches; it uses the export service.
The mkgeomatics arcgis93rest.html page doesn’t use tiles: the images it is loading are cooked on the fly. (That service on the sample server doesn’t have pre-cooked tiles to compare to.) Pre-cooked tiles look more like: “ESRI_LandBase_WebMercator/MapServer/tile/7/45/20″ . Using the export service in a non-single tiled mode is generally a mistake due to performance.
Of course, it has always been possible to consume ArcGIS Server’s tile services to some extent, and that’s still true (and even easier) in 2.8: the xyz-esri.html in the examples is a simple example. But there is no specific support for ESRI tiling, and I expect that anyone who tried to use this seriously would find themselves in trouble from some aspect of it that doesn’t take ESRI-specifics into account.
I guess by that definition you are correct, but there is already a way to handle this.
http://trac.openlayers.org/ticket/1967
I suppose 2.9 here we come…
That code won’t read tiles from an ArcGIS 9.3 Map Cache either. That’s only for 9.2 caches.
True, but it does read Tile Caches.
The person asking the question said he wanted to read REST Cached layers. 2.8 will do that. If you want to directly read the ESRI Map Cache, you’ve got work ahead of you even if you want to read 9.2 or 9.3.
2.8 will do that in the same what that 2.7 did that: by treating ESRI map caches as a set of static tiles. If you’re expecting that there’s a switch to flip that says “download data from the metadata and display my layer automatically”, you’re out of luck no matter what version you’re at; OpenLayers has no support for reading ESRI caches. It can read any set of custom tiles in a planar projection: http://docs.openlayers.org/library/spherical_mercator.html#custom-tiles has described that for a long time, and that’s not changing.
Pingback: James Fee GIS Blog » Blog Archive » OpenLayers 2.8 Released
Pingback: James Fee GIS Blog » Blog Archive » Give your own talk at the 2010 ESRI Developer Summit
Pingback: James Fee GIS Blog » Blog Archive » ESRI Tries to Answer, “Which ESRI Web Mapping API Should I Use?”
i am still confused about the Licensing of ArcGIS REST Services.
can anyone give me a hint where to find terms & conditions??
as for the JSAPI there is
http://resources.esri.com/arcgisserver/apis/flex/display/esri.html
or the google maps extension
http://www.esri.com/legal/pdfs/g-599_arcgis_api_lic_agmt.pdf
so, where is that ESRI REST License??