Conversation
There was a problem hiding this comment.
Pull request overview
Updates ArcGIS REST image/tile export request parameter casing to match Esri’s documented (and now case-sensitive) expectations, fixing failures against newer ArcGIS Server instances.
Changes:
- Switch request query parameter keys to Esri-documented casing (e.g.,
BBOX→bbox,FORMAT→format,DPI→dpi). - Update default parameter values’ casing (e.g.,
PNG32→png32,IMAGE→image). - Update browser tests to assert the new query parameter casing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/browser/spec/ol/source/TileArcGISRest.test.js | Updates expected export URL query parameter casing for tiled ArcGIS REST requests. |
| test/browser/spec/ol/source/ImageArcGISRest.test.js | Updates expected export URL query parameter casing for single-image ArcGIS REST requests. |
| src/ol/source/arcgisRest.js | Changes dynamic request params (bbox, size, dpi, etc.) and loader defaults to new casing. |
| src/ol/source/TileArcGISRest.js | Updates default request params casing for tile export requests. |
| src/ol/source/ImageArcGISRest.js | Updates JSDoc parameter casing guidance for image export requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| expect(queryData.get('format')).to.be('png'); | ||
| expect(queryData.get('transparent')).to.be('false'); | ||
| }); | ||
|
|
Comment on lines
+45
to
51
| params['size'] = imageSize[0] + ',' + imageSize[1]; | ||
| params['bbox'] = extent.join(','); | ||
| params['bboxSR'] = srid; | ||
| params['imageSR'] = srid; | ||
| params['dpi'] = Math.round( | ||
| params['dpi'] ? params['dpi'] * pixelRatio : 90 * pixelRatio, | ||
| ); |
Comment on lines
101
to
107
| const params = { | ||
| 'F': 'image', | ||
| 'FORMAT': 'PNG32', | ||
| 'TRANSPARENT': true, | ||
| 'f': 'image', | ||
| 'format': 'png32', | ||
| 'transparent': true, | ||
| }; | ||
| Object.assign(params, options.params); | ||
|
|
Comment on lines
237
to
243
| // Apply default params and override with user specified values. | ||
| const baseParams = { | ||
| 'F': 'image', | ||
| 'FORMAT': 'PNG32', | ||
| 'TRANSPARENT': true, | ||
| 'f': 'image', | ||
| 'format': 'png32', | ||
| 'transparent': true, | ||
| }; | ||
| Object.assign(baseParams, this.params_); |
| expect(queryData.get('dpi')).to.be('108'); | ||
| delete options.params.dpi; | ||
| }); | ||
|
|
'LAYERS' still appeared in caps in the comments Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Newer ArcServer instances are returning errors for 'export' requests from ImageArcGISRest and TileArcGISRest layers. In particular, they are now case-sensitive about the
bboxfield, and do not recognize OpenLayers'BBOXvalue. This patch updates the ArcGISRest files and their tests to use the capitalization as laid out in [Esri's documentation] (https://developers.arcgis.com/rest/services-reference/enterprise/export-map/):BBOX->bboxLAYERS->layersSIZE->sizeBBOXSR->bboxSRIMAGESR->imageSRFORMAT->formatF->fDPI->dpiThis also changes some of the default values' cases:
PNG32->png32IMAGE->imageIn response to issue openlayers#17205, it seems to have been a long time since ArcREST required uppercase fields, and newer versions seem to require lowercase for some fields (at least
bbox) for export map queries. This issue is also found on Esri forums as well.