I would like to preposition an OpenLayers map on a country. This is, when my page loads, the map should be positioned on the country with an appropriate zoom level. This should work for a (large) list of countries.
I have a GeoServer with a shapefile layer containing country polygons. The polygons have ISO country code attributes. Another layer shows a satellite background image. When generating the country page on which the map is shown, I only know the country name (or ISO code), but not its coordinates and polygon details. (GeoServer and webserver are different machines)
My knowledge of OpenLayers and GeoServer is limited but if I understand correctly OpenLayers requests a certain map position and zoom level from GeoServer. I would thus need to retrieve position and zoom level from GeoServer in a first step, and then request this part of the map in a second one. This is if there is not a way to tell OpenLayers to zoom in on a feature I can identify by its attribute.
Any code example would be very much appreciated, but conceptual clarification would be equally valuable.