ResultList setVendorSpecific
From MapbenderWiki
User:Karim Malhas (Module maintainer)
- resultList
- Version >= 2.7
Contents |
english
user story
This element can be used to send Vendorspecific parameters to a WMS that has been coupled with a WFSConfig. The User searches for a featureCollection and then clicks on a row in the result List. This action zooms the Map to the feature, and configures the WMS containing that feature with a vendorspecifc parameter.
usage
Configure your WMS Server to accept a VendorSpecific Parameter, and load the WMS into your GUI. Now load your WFS, configure it for searching, and couple it to your WMS. The Vendorspecific parameters must be named as one ore more of the WFS featuretype properties. Note down the ID of your WFS Configuration.
Now Import the following sql into your gui,
INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height,
e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url)
VALUES('<GUI NAME>e','resultList_setVendorSpecific',2,1,,,'div',,,NULL ,NULL ,NULL ,NULL ,NULL ,,,,'../plugins
/mb_resultList_setVendorspecific.js',,'resultList,gazetteerWFS',,);
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui_digitize', 'resultList_setVendorSpecific',
'featuretype_properties', , ,'var');
make sure you replace <GUI NAME> with the gui you want to load the SQL into and that this gui contains a ResultList element called 'resultList. Open the "Element Variable"-Dialog for your resultList_Popup and add it's confgiration. for exmaple like this:
[
{ ftId: 1, fields: ["vendor_1", "vendor_2"] },
{ ftId: 2, fields: ["foo", "bar"] }
]
When searching for a featureType configured with ID 1, and then clicking on the result, this will send the parameters 'vendor_1' and 'vendor_2' to the WMS that is coupled to the WFS Configuration.
When their configuration is not active 'vendor_1' and 'vendor_2' are set to 'NULL'.
pitfalls
A single WMS should not be configured to get vendorspecific parameters that have the same name. This can happen when two WFS configurations share a property name, and are coupled with the same WMS. It works, but one parameter will simply be overwritten
