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

Maria Panagou snowdrop at ath.forthnet.gr
Thu Jan 24 20:01:33 EST 2008


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 ?




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--tp15009098p15079002.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list