laptop and a wrench

Bug

Add support for https to VE (Virtual Earth) tiled layer.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM074516
SubmittedOctober 24, 2011
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found10.1
Version FixedArcGIS.c
StatusFixed

Workaround

Use esri.setRequestPreCallback() to modify requests for Bing tiles to use https or modify the VETiledLayer prototype.Using setRequestPreCallback: esri.setRequestPreCallback(function(ioArgs) { if(ioArgs.url.search("<a href="http://serverapi.arcgisonline.com/veadaptor/" target="_blank">serverapi.arcgisonline.com/veadaptor/</a>") > 0) { ioArgs.url = ioArgs.url.replace("http:", "https:"); } return ioArgs; }); //Creates the Virtual Earth layer to add to the map veTileLayer = new esri.virtualearth.VETiledLayer({ bingMapsKey: 'Ah29HpXlpKwqVbjHzm6mlwMwgw69CYjaMIiW_YOdfTEMFvMr5SNiltLpYAcIocsi', mapStyle: esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL }); dojo.connect(veTileLayer, "onLoad", function(veTileLayer) { veTileLayer.tileServers = dojo.map(veTileLayer.tileServers, function(tileServer) { return tileServer.replace("http:", "https:"); }); });Modifying the prototype: var ve_gti = esri.virtualearth.VETiledLayer.prototype._getTileInfo; esri.virtualearth.VETiledLayer.prototype._getTileInfo = function () { this.url = "<a href="https://serverapi.arcgisonline.com/veadaptor/production/services/imagery/getmetadata" target="_blank">https://serverapi.arcgisonline.com/veadaptor/production/services/imagery/getmetadata</a>"; this._url = esri.urlToObject(this.url); return ve_gti.apply(this, arguments); }; var ve_il = esri.virtualearth.VETiledLayer.prototype._initLayer; esri.virtualearth.VETiledLayer.prototype._initLayer = function (response) { if (response) { response.imageUri = response.imageUri.replace("http:", "https:"); } return ve_il.apply(this, arguments); }; var veTileLayer = new esri.virtualearth.VETiledLayer({ bingMapsKey: '<key>', mapStyle: esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL });

Steps to Reproduce

Bug ID: NIM074516

Software:

  • No Product Found

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