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:
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: