FeatureLayer not showing image in Internet Explorer 8 or 9

5077
25
02-22-2011 09:39 PM
JoseSousa
Occasional Contributor III
Dear ArcGIS Javascript API Team,

I have configured a secured MapService with a single layer (Picture Marker Symbol) using the proxy page from Esri.

I have configured everything as told on the Javascript documentation about the proxy and if I use the mapservice as an ArcGISDynamicMapService it works fine and the proxy is triggered correctly.

When I create a FeatureLayer pointing to the map service layer and add it to the map, I have realized that Internet Explorer 8 or 9 cannot show the images (Base64). The proxy page is being triggered and I believe is missing something in the response code.

Google Chrome shows perfectly well all symbology.

Can please someone provide me guidance on this?

Cheers,
José Sousa
0 Kudos
25 Replies
AlexanderMardirossian
New Contributor II
Hi all, I also have the same problem and need urgent solution.

I have tried (a customized and optimized version of ) the source code provided by cminde7,

but don't seem to be able to figure out which event to point it to.
I have tried to put it to onUpdateStart - with a doubful success. One ever 4 times or so , some of the images appear. The rest of the time They are gone...

Help!
0 Kudos
AlexanderMardirossian
New Contributor II
Actually it works now. It did not work before due to some misconfiguration in IIS.

Here we go the code that I put to work for me:

function init() { // called with dojo.onLoad
// `map` is the main map with basemap both already set....
         dojo.connect(map, "onLoad", function() {
                template = new esri.InfoTemplate();
  template.setTitle("mytitle");
  template.setContent(getTextContent);
  var HGLayerURL2 = [myfeaturelayer's url];
// note that below i don't declare the HGLayerMap - it is already declared outside this function
  HGLayerMap = new esri.layers.FeatureLayer(HGLayerURL2, {
      mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
      infoTemplate:template,
      outFields: [list of my fields hrere...]
  });
  map.addLayer(HGLayerMap);
                dojo.connect(map,"onUpdateStart",function(){
         // some of my code comes here...
   fixIELayers();  // the fixer...
  });
  // some more code here.....
});

return true;
}  // end of init()

dojo.addOnLoad(init);
// END INIT PART!

function fixIELayers(evt)
{
// IE FIX FOR IMAGES NOT SHOWING IN FEATURE LAYER!!!
if (dojo.isIE)
{
   var currentLayer = HGLayerMap; //map.getLayer(map.layerIds);
   if(currentLayer && currentLayer.renderer && currentLayer.renderer.infos)
   {   
    for (var i=0; i<currentLayer.renderer.infos.length; i++)
    {
     var url1=currentLayer.renderer.infos.symbol.url;
     var url2=esri.config.defaults.io.proxyUrl+'?';
     if (url1.indexOf(url2) != -1)
      continue;
     var url3=url2+url1;
     currentLayer.renderer.infos.symbol.url = url3;
    }
   }
}
}

That's all folks.

I hope this helps someone...

Cheers
0 Kudos
OzanEmem
New Contributor II
i am having a very similar problem.
feature services are secure and using proxy for the connection. All works fine in IE9, Chrome and FF including editing etc.
however symbols are not showing up on the screen in IE8 and IE7 for featurelayer.
when i check the request using fiddler, i can see that IE8 and IE7 are requesting images from secure services without proxy. eventually it gets redirection from server and doesnt show .
i tried your solution folks, but no joy.
any idea?
by the way i am using Javascript API 2.3 and AGS 10 SP2.
0 Kudos
TatianaTen
New Contributor III
Hi all,
I'm working on something similar here, tried out a sample code for defaultediting from arcgis.com (javascript api samples) with my secure services. Strangely, everything worked for me.
I'm using ArcGIS Server 10.0 and JavaScript API 2.3 (<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3"></script>)
Tried it on IE 8, 9 browsers and also in IE7 mode.
For the Picture Marker Symbol image, I used .bmp image file.

What file are you using?

Can you run the IE debugger to see if it gives you any error?
0 Kudos
DanielYim
New Contributor II
If it's not a proxy page issue, I've had a problem with FeatureLayers in IE because they are drawn on a strange graphics layer.

To fix this, make sure your explicitly set the CSS on your map's div to text-align: left;.

Reference to my post that solved this issue that Derek graciously helped me with.
0 Kudos
SebastianRoberts
Occasional Contributor III
Thanks cminde7 and Sashom,
  I was having the same problem, and your solution fixed it.  I had to make a change because I symbolize my layer with only one marker symbol (instead of categories or class breaks), so I don't have an array of infos.  So the code below might be more robust and be able to deal with both situations.

function fixIELayers(evt)
{
  // IE FIX FOR IMAGES NOT SHOWING IN FEATURE LAYER!!!
  if (dojo.isIE)
  {
    var currentLayer = Hydrants; //map.getLayer(map.layerIds);
    if(currentLayer && currentLayer.renderer && currentLayer.renderer.infos)
    {   
     for (var i=0; i<currentLayer.renderer.infos.length; i++)
     {
      var url1=currentLayer.renderer.infos.symbol.url;
      var url2=esri.config.defaults.io.proxyUrl+'?';
      if (url1.indexOf(url2) != -1)
       continue;
      var url3=url2+url1;
      currentLayer.renderer.infos.symbol.url = url3;
     }
    }else if(currentLayer && currentLayer.renderer && currentLayer.renderer.symbol)
    {
     var url1=currentLayer.renderer.symbol.url;
      var url2=esri.config.defaults.io.proxyUrl+'?';
      if (url1.indexOf(url2) == -1)
      {
       var url3=url2+url1;
       currentLayer.renderer.symbol.url = url3;
      }
    }
  }
}
0 Kudos
__Rich_
Regular Contributor
Could it be the developers forgot about proxies when building the URLs to retrieve images from the server for older browsers?

Surely not.  (same issue with legends btw)
0 Kudos
BenSayers
New Contributor II
I'm having the same trouble yet none of the fixes suggest here or on other posts work.
The legend symbols work fine in Firefox and Chrome, but not in IE.
I am using AGS10.04 and JSAPI v2.8.
It is definitely something to do with the secure layers as before switching to a token service they worked fine.
If anyone has found a way around this please let me know.
Many thanks,
Ben
0 Kudos
__Rich_
Regular Contributor
@Ben - apologies if you've already checked this and/or posted the results but have you monitored the network traffic from IE using either the built-in tool (ie9 only) or Fiddler?
0 Kudos
DonCaviness
New Contributor III
Has anyone found a solution to this IE8 issue?  I am having the same trouble trying to display a featureLayer that are points (polygons and lines work like they should).  I am getting all of the data returned from the server but all that is being displayed is a hollow square in place of the point symbol.  I am using simple points.  I have tried the solutions found here but none work.  Everything works as it should in IE9, Firefox or Chrome.
0 Kudos