Identify Out of Memory IE9

923
2
06-17-2011 01:51 AM
AndrewCorcoran
New Contributor III
Just upgraded to IE9 and using JavaScript API 2.3. I'm doing a simple point identify on a polygon with lots of vertices with the 'returnGeometry' option set to true. IE9 falls over with an 'Error: Out of Memory' exception.

It's definitely the 'returnGeometry' option that is causing this as it works when it's set to false, but it doesn't happen in IE8, IE7 or Firefox when 'returnGeometry' is set to true. Any ideas if there's a setting in IE9 or IIS that I need to tweak to take care of the memory issue?
0 Kudos
2 Replies
StephenLead
Regular Contributor III
Try setting the maxAllowableOffset parameter on the query, to reduce the size of the returned geometry:

var query = new esri.tasks.Query();
query.returnGeometry = true;
query.maxAllowableOffset = 1000;


There's a sample at http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/fl_generalize.html which explains how to do this for a feature layer - it's the same principle for the query, so you could set the offset as a factor of the current extent.

This should improve the performance in any browser, incidentally.
0 Kudos
AndrewCorcoran
New Contributor III
That worked! Thanks very much. Hadn't ever used this option before but it's probably good practice to. Strange that identify/query works without the option in IE7 and IE8 though. Good old IE :rolleyes:
0 Kudos