Select to view content in your preferred language

GeometryService call not working in IE8

566
2
02-28-2013 01:20 AM
SarahGolding
New Contributor
In both Firefox and Chrome the following code uses a geometry service to label states on a map as intended, but in IE8 nothing seems to happen. Any idea why this isn't working in IE8?

 function addStateLabels(p_StateLayer, p_LabelLayer){
  var t_GeometryArray = new Array();
  for (var i=0; i<p_StateLayer.graphics.length; i++) {
   t_GeometryArray = p_StateLayer.graphics.geometry;
  }
  m_GeometryService.simplify(t_GeometryArray ,function (p_Geometries) { 
   m_GeometryService.labelPoints(p_Geometries, function(p_LabelPoints) {
    var font = new esri.symbol.Font("15px", esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL, esri.symbol.Font.WEIGHT_BOLDER);
     for (var i=0; i<p_LabelPoints.length; i++) {
       var t_TextSymbol = new esri.symbol.TextSymbol(p_StateLayer.graphics.attributes.STATE_ABBR, font, new dojo.Color.fromHex("#FFFFFF"));
       p_LabelLayer.add(new esri.Graphic(p_LabelPoints,t_TextSymbol));
     }
   });
  });
 }
0 Kudos
2 Replies
by Anonymous User
Not applicable
Are you getting any error messages at all?

If you have access to IE9, you might want to open the application in that version of the browser to do your debugging.  If you open the JavaScript console in IE9 (press F12), you can click on the "Browser Mode" button in the header of the console and choose IE8.  Once the application reloads, you should be able to do some debugging (e.g., detect any errors or logging to the console tab, and capture and examine HTTP requests in the network tab).
0 Kudos
KyleMorgan
Deactivated User
We've had to ditch support for IE8 due to all the weird JS issues it has.  Windows 7 has IE9 and XP is just becoming too long in the tooth to support.  For those users, we recommend Firefox or Chrome if their IT shop allows it.  Otherwise, we recommend Google Chrome Frame and place code in our headers that implement Chrome Frame without anything on the user end.

With IE-9, you can force it to use IE9 as it's standard mode or use Google Chrome Frame by placing the following code in the header.


<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
0 Kudos