Select to view content in your preferred language

Default legend widget does not work over https in IE

9557
36
05-17-2012 05:38 AM
BenSayers
New Contributor II
When using the default ESRI widget the legend symbology do not show up when using Internet Explorer (IE). They show fine in Chrome, Safari and Firefox, but when using IE this all that is displayed is the browser standard red x's.

I have seen others having the same trouble in various different posts and some people have suggested various fixes for previous versions of the API, but none work for me. I am using AGS 10.04 and JS API v2.8.

Has anyone fixed this exact problem? Anyone at ESRI looked in to this?

Any help/suggestions will be greatly appreciated.

In anticipation, Ben.
0 Kudos
36 Replies
suhanatssuhanats
New Contributor
hi all,

I have found this workaround in the meantime, I hope it works for you too.

add it to the event onZoomEnd of your map.

function onZoomEnd()
{
    if (navigator.appName == 'Microsoft Internet Explorer')
    {
        timer = setTimeout(function () {
        var imgs = dojo.query('.esriLegendLayer > tbody > tr > td > img');
        for(var i=0; i<imgs.length; i++){
            imgs.src = "yourproxy" + imgs.src;
        }
        }, 100);
    }
}


Hi, can you please explain more? the dojo.query part and then setting the image source path again. Is it because the image path might be losing that token information and need to be reappended?
0 Kudos
__Rich_
Regular Contributor
Hi, can you please explain more? the dojo.query part

Find the relevant images using dojo.query.
...and then setting the image source path again.

Once found, modify their paths to include the proxy URL.

HTH
0 Kudos
suhanatssuhanats
New Contributor
Find the relevant images using dojo.query.

Once found, modify their paths to include the proxy URL.

HTH


Thanks! Finally I got it tested today and works!
0 Kudos
suhanatssuhanats
New Contributor
Hi, can you please explain more? the dojo.query part and then setting the image source path again. Is it because the image path might be losing that token information and need to be reappended?


Great, that works!
0 Kudos
__Rich_
Regular Contributor
Great, that works!

Cool, glad to have been of some help 🙂

FWIW, I worked around this issue by overriding esri.dijit.Legend.prototype._buildRow_Tools so that requests for images from the server use the proxy if a proxy has been specified, I know this will be 'frowned upon' but our application this is the most efficient fix, it's only a one line change to get it working.
0 Kudos
SaraFlecher
New Contributor

Hello,

I am having a similar issue. I am using the Javascript API and calling an ArcGIS map service in a Javascript/HTML application. The application is accessed via IE 11 and is in a locked down environment requiring everything over SSL.

All of the Javascript API libraries I call are https, the application is https, and the map services are https. When the map service is called, it fails due to the following network error:

SEC7111: HTTPS security is compromised by http://utility.arcgis.com/sharing/tools/legend?soapUrl=...

I have discovered that this is the way services published via an ArcGIS Server lower than v. 10 calls the legend service.

If I am unable to upgrade the GIS Server to 10, require accessing the application via IE, and must have everything in SSL, what are my options for working around this issue? As as note, I do not actually need to call the legend service for my application.

Thanks for the help!

Sara

0 Kudos
DavidWilton
Occasional Contributor II

I got the same issue using ArcGIS server 10 SP2 Standard Java Edition. I resolved using the below code:

                      //add the legend

                        var legendDijit = new EsriLegend({

                            map: this.map

                        }, "legendDiv");

                        //issues with ArcGIS server 10 SP2 Standard Java Edition

                        if (window.location.protocol == 'https:') {

                           legendDijit._legendUrl = legendDijit._legendUrl.replace('http:', 'https:');

                        }

0 Kudos