AnsweredAssumed Answered

Prevent rendering of a layer until time definition is applied

Question asked by stephen.gregory on Jan 27, 2015
Latest reply on Jan 27, 2015 by khutchins-esristaff

I want to add layers to a map, with some criteria. Before the layer is drawn, I want to a set a time definition on the client-side to limit the data being rendered.

I've tried setting the time definition prior to calling map.addLayer, but the API seems to ignore the time definition when the layer is added to the map.

So briefly:

  1. FeatureLayer object created (in SNAPSHOT mode)
  2. setTimeDefinition called for FeatureLayer
  3. FeatureLayer object added to map via addLayer.

When 3 happens, a request is sent to the service but the time definition is not sent in the request.

${service url}/query?f=json&where=1%3D1&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=*&outSR=102100

as opposed to

${service url}/query?f=json&where=1%3D1&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=*&outSR=102100&time=1422030483999%2C1422030484000

Thoughts on what is happening? Is there another ordering I should try?