Showing posts with label ArcGIS JavaScript API. Show all posts
Showing posts with label ArcGIS JavaScript API. Show all posts

Saturday, September 11, 2010

ArcGIS 10 REST API

It seems to me that the ArcGIS 10 REST API is good for -really- simple applications, but it's not something I would use in an enterprise application. Specially one that needs complex queries. Also, it has some problems and doesn't work correctly all the time. The latest problem I came up with is related to spatially querying joined tables. In my case, the spatial query didn't filter any records, it was like it wasn't even being run.

Of course, there's always the option of not using joins (and give up good database design). Not an option for me, so I'll check if there's a workaround.

Friday, September 10, 2010

esri.layers.FeatureLayer is not a constructor

I received this error when using the ArcGIS JavaScript API. After doing some digging, it turned out that esri.layers.FeatureLayer was undefined (because the API was not loaded) when I was calling it.

Al the API examples show that dojo.addOnLoad should be used but I was using Ext.onReady (another JS API). This was causing the problem because when Ext.onReady was executed the AGS JS API was not loaded. I had to use dojo.addOnLoad to make sure that when I call esri.layers.FeatureLayer it is actually loaded.