Using Openlayers, I would like to initialize the map in a position where it shows all the features in a vector layer. How to do that?
This is a little sharp/rough
map.zoomToExtent(yourVectorLayer.getDataExtent());
This may be smoother
map.panTo(yourVectorLayer.getDataExtent().getCenterLonLat());
map.zoomTo(yourVectorLayer.getDataExtent().getZoomExtent());