I want to be able to change the url for a layer in code.
The reasons is that I am implementing local caching.
When local caching is Not enabled, we use 4 servers to deliver tiles to run parallel http requests.
However, when the caching is enabled, it caches tiles for the four servers. There is no guarantee that the request for the same tile will be for the same server, so, potentially, the local cache may end up four times the size it needs to be. (and four copies of the same tile will be in the cache)
To counter this, we have set up another server to be used only for users who are using the local cache to guarantee that the cache will always return a tile if it is there (simply because the server is always the same)
I have experimented with layer.getFullRequestString( { }, url );
I am able to actually retrieve the request string if I use this syntax:
layer.getFullRequestString( { } ) (note, it errors if you do not put the {} )
but have not been able to actually cause a change in the layers fetch url. The function seems to ignore the supplied url completely.
I have tried a single url and a url array to no avail.
Openlayers Documenmtation is as follows:
getFullRequestString:function( newParams, altUrl ) Combine the layer’s url with its params and these newParams.
Add the SRS parameter from projection -- this is probably more eloquently done via a setProjection() method, but this works for now and always.
Parameters newParams {Object} altUrl {String} Use this as the url instead of the layer’s url Returns {String}
Any thoughts or better ways to address this very much appreciated
Thanks