ArcGIS Server Javascript API Gotcha: Identify

Tue, Nov 18, 2008 One-minute read

I ran into an odd problem after I installed SP1 (actually a few odd problems) with a site using the ArcGIS Server javascript API.  Basically, the identify task broke in IE only.  All was well in Firefox, so I was stumped, as I didn’t receive any error messages.  So, I cranked open Fidder which revealed that the HTTP request was never happening.  Strange, I thought, so I copied the HTTP request that was working in Firefox from the Firebug Net tab and pasted it into the IE address bar, yet it wouldn’t let me paste the whole URL.  So, the URL was too long…but why?  As it turns out the IdentifyParameters use a geometry, and that geometry has a spatialReference, which comes from the map.  The spatialReference we use is WKID 2913, which is one of the Oregon State Plane projected systems.   When the API sets this value on the javascript map object, it uses the Well-Known Text (WKT) version, which is a REALLY long string.  So, I overwrite the spatialReference on the geometry before executing the identify task with a light object that just has the WKID.  Like so:

Once the URL wasn’t too long, identify started working in IE again.

Anyone else having any issues after installing AGS 9.3 SP1?