Skip to content

Case sensitive arc rest#1

Open
rhodges wants to merge 3 commits intodevelopfrom
case_sensitive_arcREST
Open

Case sensitive arc rest#1
rhodges wants to merge 3 commits intodevelopfrom
case_sensitive_arcREST

Conversation

@rhodges
Copy link
Copy Markdown
Member

@rhodges rhodges commented May 1, 2026

Description

Newer ArcServer instances are returning errors for 'export' requests from ImageArcGISRest and TileArcGISRest layers. In particular, they are now case-sensitive about the bbox field, and do not recognize OpenLayers' BBOX value. 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 -> bbox
  • LAYERS -> layers
  • SIZE -> size
  • BBOXSR -> bboxSR
  • IMAGESR -> imageSR
  • FORMAT -> format
  • F -> f
  • DPI -> dpi

This also changes some of the default values' cases:

  • PNG32 -> png32
  • IMAGE -> image

In 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.

@rhodges rhodges requested a review from Copilot May 1, 2026 21:54
@rhodges rhodges self-assigned this May 1, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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., BBOXbbox, FORMATformat, DPIdpi).
  • Update default parameter values’ casing (e.g., PNG32png32, IMAGEimage).
  • 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 thread src/ol/source/arcgisRest.js Outdated
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants