Expected user behavior is that when user selects the County from a drop-down, the map should zoom to its max extents. I am using SQL View (Postgis on 9.3) and since I do not know the bounds, I gave the Max Bounds of the FL State. Not able to create layer without giving bounds. Can the boundaries be inferred from the SQL? The SQL for the view is as shown below:
select ST_XMin(b.geom) as xmin,ST_YMin(b.geom) as ymin, ST_XMax(b.geom) as xmax,
ST_YMax(b.geom) as ymax, a.zcta5ce10, a.geom
from us_zip a, tl_2013_us_county b
where b.statefp='12'
and lower(b.name)='%COUNTY_NAME%'
and ST_contains(b.geom,a.geom) order by zcta5ce10
If it is not possible, I'm thinking of getting the max bounds for the selected county before invoking the OpenLayers map.