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

Arnd Wippermann arnd.wippermann at web.de
Fri Jan 25 03:29:01 EST 2008


Hi,

Try mergeNewParams:

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

aLyr.mergeNewParams({ID: yourValue}); 

Mit freundlichen Grüssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/




-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Maria Panagou
Gesendet: Freitag, 25. Januar 2008 02:02
An: users at openlayers.org
Betreff: Re: [OpenLayers-Users] getFeatureInfo request in new window + new
map?


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

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list