[OpenLayers-Dev] layer class for ArcGIS Server MapServer Object web service

Brian Hatchl brian.r.hatchl at saic.com
Wed Nov 29 23:28:33 EST 2006


Hello all,

I'm working toward creating a layer class for the ArcGIS Server 9.1
MapServer Object web service.  So far I've created the AGS layer class by
extending OpenLayers.Layer.Grid and it seemed that I also needed to create
an AGS tile class by extending OpenLayers.Tile.Image.

I used the WMS class as a model for the new AGS class as far as what methods
should be overridden or overloaded.  The biggest change I had to make was to
change the getURL() method to issue an asynchronous ExportImage SOAP request
(with dynamic bounds and tile size parameters) that would return the URL to
the resulting image in the response.  The model I used to generate the SOAP
request was the Ajax loadURL() method used for WFS and GeoRSS.  The callback
method for the ExportImage request is modeled on the requestSuccess() method
of the WFS tile class, and basically pulls the URL for the output image out
of the SOAP response.

Because the URL for the tile image cannot be generated client-side, as it
could for WMS and other tiled image services, I had to modify the getURL()
method to take a custom AGS tile object instead of just the bounds
parameter.  This was so I could assign the image URL to the tile after the
asynchronous SOAP request returned.  The custom AGS tile object was
necessary because I needed to override the draw() and moveTo() methods of
the Tile.Image class to pass the actual tile object around rather than just
the tile bounds.  I also had to make much more judicious use of the AGS
layer getURL() method, because it makes a request to the server, rather than
just concatenating a URL string.

Well that's my basic methodology so far.  When the OpenLayers map is
initialized everything looks good and the AGS layer is rendered accurately.
The problem I have is when I start panning, once I reach the edge of the
initial buffer, the loading of tiles is incorrectly offset and seemingly
repeated from the initial grid load.  As I've fudged around with the code,
sometimes the Ajax requests go on and on, much longer than I'd expect to
fill the new buffer.  I haven't gotten far enough worry much about zooming
support, but that's not working either.  However, the initial map is
accurate no matter what zoom level I start with.

I'm looking for any suggestions as to where I might be going wrong.  Maybe I
need to move the SOAP request away from a getURL() method and into the tile
draw() method like the WFS tile class?  Or maybe there's another inherited
method that I need to override to get the proper behavior?  Any guidance
would be appreciated.  Maybe the OL development team already has some ideas,
as the approach should be similar to adding an ArcIMS ArcXML request layer
to OL, which I see has an open ticket.

Thanks much,
Brian

p.s. I'm really impressed with the slippy map goodness of OpenLayers.




More information about the Dev mailing list