<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<br>I am using OpenLayers client side with a postGIS backend and have a map of county and zip layers that are hidden (each layer has one feature).<br>I want to show them when the user requests them in a form GUI.<br><br>To do this I need to :<br>A) Obtain the centroid of the zip inputted from the features' geometry of the corresponding layer.<br>B) Loop through the layers and perform a distance query on the centroid as compared to each layer's geometry to determine if it resides within x miles.<br>C) Show the layer when the distance query returns true.<br><br>I know how to toggle layer visibility (C). And I know how to access individual layers. I could use Ajax to perform the distance queries in POSTGIS, but would like to know how to do it client side so I can gauge performance (and gain more knowledge working with OpenLayers).<br><br>Can anyone provide any
 insight or examples specifically in referencing geometries from layers and performing distance queries on them?<br></td></tr></table>