[OpenLayers-Dev] Creating custom 3rd party Layers

Andrea Battisti battisti at actgate.com
Tue Jan 29 08:16:57 EST 2008


[...]

>> Basically for each tile I have to build a formatted request string 
>> specifying the spatial bounds, projection and some options, submit the 
>> request using http, reading and parsing the reply and extracting from it 
>> an url pointing to the actual image data to be displayed.
>>     
>
> Yep, you want to subclass WMS, and probably just override the getURL
> method: you'll be passed a bounds, and yu'll have 'this' available with
> all the properties of your laayer to take advantage of.
>
>   

Thanks for the clarifications!

I wrote a test class, (following the WMS one) and reimplemented the 
getURL() method.
The image retrieving works well, but the interface gets kind of 
"stuck"as soon as zooming or panning is performed.
The interface stays frozen until the image is retrieved and displayed.

My guess is that the getURL is meant to be called asynchronously just to 
get the link to the image and then exit immediately; then the actual 
network transfer is deferred to later methods / calls maybe ?
Instead, in my case, in order to get the link to the actual image, I 
first need (synchronously) to talk with the server, passing the bbox and 
image size parameters and then parsing the response. Probably this 
blocks the UI interaction until the transfers are done.

How can I fit this model into the way OpenLayers works?
Is there a way to defer the network transfers to when the image is 
actually downloaded?

Thanks again,

-- 
Andrea Battisti
Applied Coherent Technology Corp.





More information about the Dev mailing list