Is your entire site running over https? Your html, css and js, as well as your ArcGIS Server services, need to be served using https.Here's a simple page that uses the legend dijit, version 2.8 of the API and https: http://servicesbeta.esri.com/demos/https/legend-using-https-2.8.html It works without issue in IE.
esri.dijit.Legend.prototype._legendUrl = 'https://www.arcgis.com/sharing/tools/legend'
Sorry about that, the line tweaking the legend dijit's prototype shouldn't have been in there. The link I posted previously no longer uses arcgis.com for the legend. Can you confirm it works in IE?Can you post a screen shot of what you're seeing in IE?
How's this look: https://servicesbeta.esri.com/demos/https/legend_id_manager_https.html
It appears that I am using Base64, as the requests for my images in Internet Explorer look like: https://www.efafrica.com/rest/services/EFAv3/EFA_Mainv3/MapServer/1/images/3b55578fHow do I force the actual image request rather that the Base64?
Coincidentally, once I have right-clicked on the red x image and copied the image URL then logged in through the ArcGIS Server REST API Login screen that one image appears in the legend but none of the others, would you expect this to happen? I feel we are getting a little closer to solving the problem<snip>
Just to pile on, i can replicate this as well. On my secure service (entire app is secure, so layers are not), the legend shows red x's in IE onlyThe non base64 encoding is definitely the difference.The source path to the image in the legend is not getting the token appended on it If i sniff the token using fiddler, and then append the ?token=LqGIFsRUz8nkeM3XKjYT4W1U0xfLvBT7cEkYZcT3jZU. to the end of the image request in IE for the legend the legend item appears.
Jeff�?? are you on 2.8 as well?
I also am using a .jsp proxy and have ArcGIS Server for JAVA 10ps4
Would be beneficial if esri could test against proxy.jsp and a JAVA base install.
Let me see what I can do...might take a bit of searching to find a Java instance configured with SSL and appropriate services.
Thanks Jeff. That URL redirects to what looks like a resource on your local network and 404's for me. Here's the redirect URL I'm seeing: https://mcg-ap-arcsvr02.mcgad.local:8343/arcgis/rest/login?redirect=https%3A%2F%2Fwww.mymanatee.org%2Farcgis%2Frest%2Fservices%2Futilities-infrastructure%2Firrigation%2FMapServer%2F
https://www.mymanatee.org/arcgis/rest/services/utilities-infrastructure/irrigation/MapServer/?token=UbUqrFQqf4LxwkwbMzefuTVv47Hfu_3vVxXBP5iykzI.not sure how long that token is good for.
That circumvents the purpose of using the Identity Manager. Is that what you're doing in your app?
The error we are seeing is in the default legend widget using the identity manager.
Thanks for clarifying. I'm still waiting to hear back about testing this with a JSP proxy on a AGS Java instance + SSL.
dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.AccordionContainer"); dojo.require("esri.map"); dojo.require("esri.dijit.Legend"); dojo.require("esri.arcgis.utils"); dojo.require("dijit.form.CheckBox"); dojo.require("esri.IdentityManager"); var map; var legendLayers = []; function init() { esri.config.defaults.io.proxyUrl = "proxy/proxy.ashx"; map = new esri.Map("map", { extent: new esri.geometry.Extent({"xmin":-12034010,"ymin":4487877,"xmax":-11965751,"ymax":4525561,"spatialReference":{"wkid":3857}}) }); //Add the terrain service to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service var basemap = new esri.layers.ArcGISTiledMapServiceLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"); map.addLayer(basemap); var trailsService = new esri.layers.ArcGISDynamicMapServiceLayer("https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/Trails/MapServer", { id: "Trails" }); /** // This will work. var conditions = new esri.layers.FeatureLayer("https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/FeatureServer/0",{ id: "Conditions", mode: esri.layers.FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); **/ // This will fail. var layerURL = "https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/MapServer"; var conditions = new esri.layers.ArcGISDynamicMapServiceLayer(layerURL); legendLayers.push({ layer: trailsService, title: 'Trails' }); legendLayers.push({ layer: conditions, title: 'Conditions' }); dojo.connect(map,'onLayersAddResult',function(results){ console.log("layers add result: ", results, legendLayers); var legend = new esri.dijit.Legend({ map: map, layerInfos: legendLayers },"legendDiv"); legend.startup(); }); map.addLayers([trailsService, conditions]); dojo.connect(map, 'onLayersAddResult', function(results) { //add check boxes dojo.forEach(legendLayers, function(layer){ var layerName = layer.title; var checkBox = new dijit.form.CheckBox({ name: "checkBox" + layer.layer.id, value: layer.layer.id, checked: layer.layer.visible, onChange: function(evt) { var clayer = map.getLayer(this.value); clayer.setVisibility(!clayer.visible); this.checked = clayer.visible; } }); //add the check box and label to the toc dojo.place(checkBox.domNode,dojo.byId("toggle"),"after"); var checkLabel = dojo.create('label',{'for':checkBox.name, innerHTML:layerName},checkBox.domNode,"after"); dojo.place("<br />",checkLabel,"after"); }); }); dojo.connect(map, 'onLoad', function(theMap) { //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map,map.resize); }); } dojo.addOnLoad(init);
I was able to confirm Ben's findings that the error seems to be isolated to DynamicMapService layer swatches. The following defect has been logged for the request. [#NIM081725 Legend swatches for secure Dynamic Map Service layers are not returned in Internet Explorer only when application uses Identity Manager and is hosted on HTTPS. ]Please don't hesitate to contact Esri technical support to add your name to the list of customers requesting that the issue be resolved.
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 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); } }
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.