I have a geojson with some data which I loaded into Openlayers.
When I try to get the getExtent of the data source I get awkward values not corresponding to the extent of the data.
The following image shows the dataset in blue and the extent points, calculated with the gjsonLayer.getSource().getExtent()
in red.
When I click in the polygons in the Chatham islands (on the right side of the image) I get the coordinates [183.49365234375, -43.905808356157394], out of the range -180, 180. Probably that's the reason why the method getExtent() returns messed up values.
Just to show that the problem is the data crossing the dateline, below is an image showing the dataset without those polygons on the right (in the Chatham islands) that pass the dateline. The red points are the result of the getExtent() method and they are correct.
Any idea how to make the getExtent() method return correct values when using a dataset in which some data passes the dateline?