I am working on a project that uses OpenLayers to show shapefiles from the GeoServer and then show them on Google Maps. The only problem is when the page loads, I want to go to the spatial coordinate and zoom to the shapefile that is loaded on map. Is there any way to do this? I want to go to the coordinates around 32 and 50 in zone 39N. Can you help me about this problem?
I tried this code:
var dataExtent = states.getDataExtent();
map.zoomToExtent(dataExtent);
But it does not work, where is my mistake?
This is the result:
h++p://173.244.165.194/
It loads many maps of world. I have to zoom to go to my location :( Here is exact place that I want to zoom when page loads:
http://173.244.165.194/?zoom=12&lat=31.62211&lon=51.48708&layers=B00T