I'm trying to get ArcGIS REST API Feature Server layers working on a map application. I'm trying to query a feature server using a bbox extent or the esriGeometryEnvelope going with their documentation here https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm
The [xmin, ymin, xmax, ymax] format.
With the requests themselves looking a little like this in the network console: https://sampleserver6.arcgisonline.com/arcgis/rest/services/EmergencyFacilities/FeatureServer/0/query?f=geojson&inSR=4326&outSR=4326&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22:-135.5059441708454,%22ymin%22:26.15237520400559,%22xmax%22:-100.1189675144052,%22ymax%22:39.37701094586817,%22spatialReference%22:%7B%22wkid%22:4326,%22latestWkid%22:4326%7D%7D
Having an extent over the dateline is causing errors because the xmin/xmax value are off. Since say xmin is close 180 while the xmax is -180 since it's crossing the dateline. For example this request.
One solution may be to split the bbox extent into two as detailed here: https://community.esri.com/thread/222404-retrieving-map-extent-across-180
That would though require extra logic to check for that and sending two backend requests to the ArcGIS REST API.
However is there a way with ArcGIS REST API to change the query params so that it can handle when the extent is over the dateline? Can I get around the problem without sending two requests to ArcGIS?