[OpenLayers-Users] vendorParams in wmsGetFeatureInfo
Bart van den Eijnden
bartvde at opengeo.org
Mon Apr 16 10:47:26 EDT 2012
I think your only option right now is unfortunately to provide a custom findLayers function for your WMSGetFeatureInfo control.
Best regards,
Bart
--
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.
On Apr 12, 2012, at 11:11 AM, vrbikdan wrote:
> Hi all,
> I'll try to explain my problem. I have a few layers and only one is visible
> and I need to use wmsGetFeatureInfo for another layer (this layer is not
> visible). But I need to change layer for WMSGFI dynamicaly (after every
> click in my map). So I am able to store name of this layer I need in some
> variable and I need to push this variable to WMSGFI. I tried to use
> vendorParams in beforegetfeatureinfo, but from some reason it doesn't work.
> Can you tel me, wich way I can achieve my goal, changing layer in WMSGFI?
> Code is below.
>
> function infoDrillD(){
>
> infoDrillVarD = new OpenLayers.Control.WMSGetFeatureInfo({
> url: "http://192.168.1.92:8080/geoserver/zk/wms",
> queryVisible: false,
> eventListeners: {
> beforegetfeatureinfo: function(ev){
> this.vendorParams= {layers: [layers[variable]]};//this variable store
>
> //layer I want to use
> },
> getfeatureinfo: function(event) {
> for (var i = 0; i < event.features.length; i++) {
> feature = event.features[i];
> var attDrill = feature.attributes;
> zona=attDrill.zona;
> xx=attDrill.id;
> alert(xx);
> }}}
> });
>
> map.addControl(infoDrillVarD);
> infoDrillVarD.activate();
>
> }
>
> I hope that I explain it well :) Thanks for your help,
> Dan
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/vendorParams-in-wmsGetFeatureInfo-tp4848746p4848746.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120416/d88c50c8/attachment-0001.html
More information about the Users
mailing list