lukestewart-esriuk-esridist

ArcGIS Online wrong item type from search

Discussion created by lukestewart-esriuk-esridist on Aug 16, 2012
When accessing items from ArcGIS Online in the JavaScript API there seems to be an error in the item type property when a tiled map service from AGOL is returned from a search (portal.queryItems(params)). Currently AGOL supports feature services and tiled map services. You can also reference other ArcGIS Server services including map services. When I query items in AGOL it returns items that have a type property. The problem is the tiled map services from AGOL have type map service as do referenced map services from other ArcGIS Servers. These two items need a different call to add them into the map e.g:

  new esri.layers.ArcGISTiledMapServiceLayer(url) OR
  new esri.layers.ArcGISDynamicMapServiceLayer(url)

Currently I am differentiating the two by doing a string search on the url for ???tiles??? but this method does not seem to be very robust.
Does anyone know why this is the case? If there is a better way to differentiate the two item types or if this is a bug that will be fixed?
Thanks,

Luke

Outcomes