[OpenLayers-Users] Layer.WMTS.mergeNewParams() issue

Keith Pomakis pomakis at pobox.com
Wed Mar 5 13:00:48 PST 2014


I have an issue with the Layer.WMTS.mergeNewParams() method that I'm
hoping someone can shed some light on.  I suspect it's a bug in
OpenLayers, but I figured I'd try to find a resolution here before
logging a bug.

I'm trying to use Layer.WMTS.mergeNewParams() to change the style of a
layer in the map.  This works no problem for WMS layers, but doesn't
seem to work at all for WMTS layers.

Here are two examples of what I think should work:

http://demo.cubewerx.com/openLayersIssue/wmts-kvp.html
http://demo.cubewerx.com/openLayersIssue/wmts-rest.html

It's clear from a quick glance at the OpenLayers source code why the
second one doesn't work:

    mergeNewParams: function(newParams) {
        if (this.requestEncoding.toUpperCase() === "KVP") {
            return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(
                this, [OpenLayers.Util.upperCaseObject(newParams)]
            );
        }
    },

But is this an oversight, or is there a technical reason why the
"REST" requestEncoding isn't handled by this method?  And why does it
not work with the "KVP" requestEncoding?

For comparison, here's a WMS version that works:

http://demo.cubewerx.com/openLayersIssue/wms.html

I'd appreciate any insight into this matter.

-- 
Keith Pomakis <pomakis at pobox.com>
http://www.pomakis.com/


More information about the Users mailing list