laptop and a wrench

Bug

ArcGIS API for JavaScript 2.3 cannot overlay the Web Mapping Service (WMS) and cached Map Service.

Last Published: December 8, 2014 ArcGIS API for JavaScript
Bug ID Number NIM070310
SubmittedJuly 8, 2011
Last ModifiedJune 5, 2024
Applies toArcGIS API for JavaScript
Version found2.3
Program languageJavaScript
Operating SystemWindows OS
Operating System VersionXP
StatusNon-Reproducible

Additional Information

Cannot reproduce using 3.11

Workaround

1) The map displays in ArciGIS for API for JavaScript 2.3 if it comments out the WMS layer map.addLayers([wmsLayer]);2) wmsLayer.getImageUrl = function (_c, _d, _e, _f) { if (!this.visibleLayers || this.visibleLayers.length === 0) { _f(this._blankImageURL); return; } var _12 = _c.xmin; var _13 = _c.xmax; var _14 = _c.ymin; var _15 = _c.ymax; var _16 = {}; _16.SERVICE = "WMS"; _16.REQUEST = "GetMap"; _16.FORMAT = this.imageFormat; _16.TRANSPARENT = this.imageTransparency ? "TRUE" : "FALSE"; _16.STYLES = ""; _16.VERSION = this.version; _16.LAYERS = this.visibleLayers ? this.visibleLayers.toString() : null; _16.WIDTH = _d; _16.HEIGHT = _e; if (this.maxWidth < _d) { _16.WIDTH = this.maxWidth; } if (this.maxHeight < _e) { _16.HEIGHT = this.maxHeight; } var _17 = _c.spatialReference ? _c.spatialReference.wkid : NaN; if (!isNaN(_17)) { if (this.version == "1.3.0") { _16.CRS = "EPSG:" + _17; } else { _16.SRS = "EPSG:" + _17; } } if (this.version == "1.3.0" && this._useLatLong(_17)) { _16.BBOX = _14 + "," + _12 + "," + _15 + "," + _13; } else { _16.BBOX = _12 + "," + _14 + "," + _13 + "," + _15; } var _18 = this.getMapURL; _18 += (_18.indexOf("?") == -1) ? "?" : ""; for (var key in _16) { _18 += (_18.substring(_18.length - 1, _18.length) == "?") ? "" : "&"; _18 += key + "=" + _16[key]; } _f(_18); }; map.addLayers([wmsLayer]);Please open the ‘layers_Workaround_23.html’ page in he web browser. It implements the workaround. It displays the map inspite of using ArcGIS API for JavaScript 2.3

Steps to Reproduce

Bug ID: NIM070310

Software:

  • ArcGIS API for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options