Hi
Here is some background.
The additional WMS layers are added by the following code in media/jquery.indiciaMapPanel.js
$.each(this.settings.indiciaWMSLayers, function(key, value)
{
div.settings.layers.push(new OpenLayers.Layer.WMS(key, div.settings.indiciaGeoSvc + 'wms', {layers: value, transparent: true}, {singleTile: true, isBaseLayer: false, sphericalMercator: true}));
});
This is calling the constructor for an OLpenLayers WMS Layer http://dev.openlayers.org/docs/files/Op … MS-js.html
The first parameter of the constructor is a name for the layer which is given the value of the key to the array of indiciaWMSLayers.
The array of indiciaWMSLayers is an option of the map_panel() function in client_helpers\map_helper.php which is passed in from the option you have set.
The value you set is converted to an array in the iform_map_get_map_options() function of client_helpers\prebuilt_forms\include\map.php.
if (!empty($args['indicia_wms_layers'])) {
$options['indiciaWMSLayers'] = explode("\n", $args['indicia_wms_layers']);
}
I see no way to influence this behaviour without using code: either applying your own javascript to modify the output or updating the server-side code to allow you to supply a name for the layer.
One question. How many layers do you want to show? The Distribution Map 3 allows for 3 named layers and the Quick Species Map allows user selection of up to 4 species layers (https://indicia-docs.readthedocs.org/en … -maps.html).
Assuming neither of these works for you, how about the following modification to map.php which would allow you to specify the additional WMS layers in a name=layer format.
if (!empty($args['indicia_wms_layers'])) {
$wmsLayers = explode("\n", $args['indicia_wms_layers']);
// Layers may be in the form name = layer or the layer on its own.
foreach ($wmsLayers as $layer) {
$separatorPos = strpos($layer, '=');
if ($separatorPos !== FALSE) {
$name = trim(substr($layer, 0, $separatorPos - 1));
$layer = trim(substr($layer, $separatorPos + 1));
$options['indiciaWMSLayers'][$name] = $layer;
}
else {
$options['indiciaWMSLayers'][] = $layer;
}
}
}
Jim Bacon.