Opened 12 years ago

Closed 12 years ago

#103 closed enhancement (fixed)

Pass <param> to OpenLayers

Reported by: jimk Owned by: theduckylittle
Priority: minor Milestone: 2.6.1
Component: GeoMOOSE/JS Version: 2.6
Keywords: Cc:

Description

Pass unused <param name"" value""/> children of map-sources into OpenLayers. This used to work in 2.4.

Currently implemented for the TMS layer in 2.6. This should be expanded in a uniform way across other map-source types.

Change History (5)

comment:1 by theduckylittle, 12 years ago

Owner: changed from jimk to theduckylittle
Status: newassigned

Actually this is

comment:2 by theduckylittle, 12 years ago

Status: assignedtesting

Actually this is working ....

htdocs/geomoose/GeoMOOSE/MapSource/WMS.js:47

     _createOLLayer: function(options) {
                this._ol_layer_name = GeoMOOSE.id();
                this._ol_layer = new OpenLayers.Layer.WMS(
                        this._ol_layer_name,
                        this.urls,
                        this.params,
                        options
                );
        },

Some layers it is more appropriate to do this than others but, GeoMOOSE is passing those params along to WMS (and subsequently MapServer), and AGS layers. I'm not sure which others are appropriate but the consistency appears to be there.

comment:3 by theduckylittle, 12 years ago

Also relevant is htdocs/geomoose/GeoMOOSE/MapSource.js:99

        _parseParams: function(mapbook_entry) {
                var paramsHash = {};
                var params = mapbook_entry.getElementsByTagName('param');

                for(var p = 0, len = params.length; p < len; p++) {
                        var param = params[p];
                        paramsHash[param.getAttribute('name')] = param.getAttribute('value');
                        //OpenLayers.Util.getXmlNodeValue(param);
                }
                return paramsHash;
        },

comment:4 by jimk, 12 years ago

Dazed and confused, but trying to continue....

Ok, now I remember the discussion that initially prompted this ticket. It was when I implemented passing in <param> for TMS layers in r819, I noticed that this was a common task that was being handled differently across the layer types. My thought was this code would be easier to maintain if it was refactored up to MapSource.js and inherited by all (most) layer types instead of defined slightly differently for each different layer type.

comment:5 by theduckylittle, 12 years ago

Resolution: fixed
Status: testingclosed

Enhancements from #66 made this ticket 'fall out'.

Note: See TracTickets for help on using tickets.