In my openlayers based application, I need to trigger zoom when user selects features so that all the selected features fit within the map extent.
I make use of this code:
map.getView().fit([swLong, swLat, neLong, neLat], map.getSize());
(swLong, swLat) is the south-west corner and (neLong, neLat) is the north-east corner of bounding box containing the selected features. These are in degrees.
What I am not sure is whether I need to provide these in pixels or degrees is the correct way?