WMS Imagery provider with multiple URLS

315 views
Skip to first unread message

Toby R

unread,
Dec 6, 2013, 10:25:07 AM12/6/13
to cesiu...@googlegroups.com
Hello,

got a pretty simple WMS but was looking at ways to speed it up, and thought I'd just try the openlayers theory of multiple URLS; (to avoid the browsers limitation to make a certain amount of simultaneous requests  (6?) to the same URL).

 smWMS = new Cesium.WebMapServiceImageryProvider({
            layers: layerArray,
                 parameters: {
                transparent: 'true',
                format: 'image/png'
            },
            proxy: new Cesium.DefaultProxy(proxy)
        });


Now, this does  actually display images (surprising, the actual requests look pretty strange), but I don’t know if it is actually any faster - I presume not as this isn’t intended to be done? 

Toby

Kevin Ring

unread,
Dec 6, 2013, 10:27:09 AM12/6/13
to cesiu...@googlegroups.com
Hey Toby,

The WebMapServiceImageryProvider doesn't currently support grabbing images from multiple URLs.  It would probably be pretty easy to add support, though.  Take a look at BingMapsImageryProvider for an example of how it can be done.  If you add this feature, we'd love to see a pull request with it.

Kevin


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Toby R

unread,
Dec 6, 2013, 11:08:36 AM12/6/13
to cesiu...@googlegroups.com
Ok, I'll do my very best - will have to get on the github learning curve.. 

I'll add it as a feature request on github and ask some additional questions there.. 

T

On Friday, 6 December 2013 15:27:09 UTC, Kevin Ring wrote:
Hey Toby,

The WebMapServiceImageryProvider doesn’t currently support grabbing images from multiple URLs.  It would probably be pretty easy to add support, though.  Take a look at BingMapsImageryProvider for an example of how it can be done.  If you add this feature, we'd love to see a pull request with it.

Kevin
On Fri, Dec 6, 2013 at 10:25 AM, Toby R <ramo…@gmail.com> wrote:
Hello,

got a pretty simple WMS but was looking at ways to speed it up, and thought I'd just try the openlayers theory of multiple URLS; (to avoid the browsers limitation to make a certain amount of simultaneous requests  (6?) to the same URL).

 smWMS = new Cesium.WebMapServiceImageryProvider({
            layers: layerArray,
                 parameters: {
                transparent: 'true',
                format: 'image/png'
            },
            proxy: new Cesium.DefaultProxy(proxy)
        });


Now, this does  actually display images (surprising, the actual requests look pretty strange), but I don’t know if it is actually any faster - I presume not as this isn’t intended to be done? 

Toby

--
You received this message because you are subscribed to the Google Groups “cesium-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+…@googlegroups.com.

Scott Hunter

unread,
Dec 6, 2013, 11:09:00 AM12/6/13
to cesiu...@googlegroups.com
One other thing to mention is that since you're using a proxy to request tiles, the actual requests look like:


So you'll need to make your WMS servers properly support the CORS header, and removing the need for the proxy at all (preferred option), or you'll need to have multiple proxy servers available in order to get above 6 concurrent requests to the same origin.

You can easily implement your JavaScript proxy class that round-robins using a set of proxy servers, instead of using DefaultProxy.  All you need to do is pass an object with a getURL function which returns the proxied url.  For example:

var myProxy = {
  counter : 0,
  getURL : function(url) {
     var proxy = this.proxies[++this.counter % this.proxies.length];
     return proxy + '?' + encodeURIComponent(url);
  }
};





Kevin Ring

unread,
Dec 6, 2013, 11:12:13 AM12/6/13
to cesiu...@googlegroups.com
Great, let us know if you have any questions.


To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages