I started learning the OpenLayers and GeoServer. The layer is added at GeoServer using the OSM shape file which is indicated as EPSG:4326
with bounds [68.5094575, 6.6791812, 97.0315678, 35.3123975]
. Using OpenLayers this layer is obtained as WMS and getting displayed.
For displaying the map the following line of code is used:
map.getView().fit(bounds, map.getSize());
Now the map is getting displayed. But when I use the below code, the map is not getting displayed:
map.getView().fit(bounds, map.getSize());
map.getView().setCenter(ol.proj.transform[77.216574, 28.627671], 'EPSG:4326', 'EPSG:3857'));
map.getView().setZoom(5);
Thanks in advance.
bounds
? Is it the array[68.5094575, 6.6791812, 97.0315678, 35.3123975]
? - geocodezip