var wwaLyr:ArcGISDynamicMapServiceLayer = map.getLayer("WWA") as ArcGISDynamicMapServiceLayer; var stringDef:String = "beginDate <= timestamp'2010-03-11 19:50:00'"; //This does not work var stringDef:String = "beginDate <= date'2010-03-11'"; //This works wwaLyr.layerDefinitions = [stringDef]; wwaLyr.refresh();
You'll need to be using a ArcGIS Server 10 hosted service since it has added a new syntax for the layerDefs parameter that allows :'s in the definition value. The old syntax uses :'s as a layer id separator.Reference:http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/export.html
var nDate:Date = new Date(); var qTime:Number = nDate.time; var wwaLyr:ArcGISDynamicMapServiceLayer = map.getLayer("WWA") as ArcGISDynamicMapServiceLayer; var stringDef:String = "beginDate <= to_timestamp(qTime)"; wwaLyr.layerDefinitions = [stringDef]; wwaLyr.refresh();
What versions of ArcGIS Server and ArcGIS API for Flex are you using?
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.