[OpenLayers-Users] getFeatureInfo request in new window + new map?

S.Reena reena at indiamail.com
Sat Nov 8 08:20:57 EST 2008


Hey Maria,

Just wanted to know whether you were able to make the id dynamic as I too
need to do the same :)

Cheers
Reena.


thanks for your response. If i want to set the id as a specific value e.g
ID=721 then i'm able to do that. what i really need is to set the id
dynamically, using an attribute value returned from a getFeatureInfo
request. That is to say, something like:

layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
        "http://labs.metacarta.com/wms/vmap0", {layers: 'basic', 'ID':
'[attribute_name'} );
map.addLayer(layer);

but this doesn't seem to work. does it matter if [attribute_name] is in the
header.html or in the main template ?



Arnd Wippermann wrote:
> 
> 
> It should be possible in the way you wrote. But your declaration in the
> layer have to be:
> 
> 
> layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
>         "http://labs.metacarta.com/wms/vmap0", {layers: 'basic', 'ID':
> '721'} );
> map.addLayer(layer);
> 
> and then you get this:
> http://labs.metacarta.com/wms/vmap0?LAYERS=basic&ID=721 ...
> 

-- 
View this message in context: http://www.nabble.com/getFeatureInfo-request-in-new-window-%2B-new-map--tp15009098p20396019.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list