[OpenLayers-Users] Quick eval() question

Ian iansgis at gmail.com
Tue Jul 1 15:59:55 EDT 2008


I'm using a javascript object to keep track of the current WMS layer a user
is querying against:

myObj.query.layer = 'volcanoes';

and am using eval to convert this string back to the layer variable name for
a getFeatureInfo request:

var queryLyr = eval(window.myObj.query.layer);

but know that using eval() is generally frowned upon and am wondering if
there is another way to do this?
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080701/ad07dc1f/attachment.html


More information about the Users mailing list