I think your code is correct but the underlying data in that service is a little wonky. If you do where 1=1, you see the vdate come back with lots of spaces:
{
"displayFieldName": "vdate",
"fieldAliases": {
"vdate": "vdate"
},
"fields": [{
"name": "vdate",
"type": "esriFieldTypeString",
"alias": "vdate",
"length": 25
}],
"features": [{
"attributes": {
"vdate": " 2012\/04\/26-00Z"
}
}, {
"attributes": {
"vdate": " 2012\/04\/26-00Z"
}
}, {
"attributes": {
"vdate": " 2012\/04\/26-00Z"
}
}
<snip>
I got it work at the REST endpoint with vdate like '%2012/04/26%' Here's a request that uses that: http://www.ncddc.noaa.gov/arcgis/rest/services/Models/NWS_AirTempForecasts/MapServer/1/query?text=&g...You might post this question over the in REST forum to see if someone over there has any additional input.Edit: Here's a working page:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title></title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dijit/themes/tundra/tundra.css" />
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/esri/dijit/css/Popup.css" />
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
#map{ margin: 0; padding: 0; }
</style>
<script>var dojoConfig = { parseOnLoad: true };</script>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.8"></script>
<script>
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.map");
var map;
function init() {
var ext = new esri.geometry.Extent({"xmin":-11077893,"ymin":4210843,"xmax":-7969046,"ymax":5570810,"spatialReference":{"wkid":102100}});
map = new esri.Map("map",{ extent: ext, wrapAround180: true });
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
map.addLayer(basemap);
var imgParams = new esri.layers.ImageParameters();
var layerDefs = [];
layerDefs[1] = "vdate like '%2012/04/26%'";
imgParams.layerDefinitions = layerDefs;
imgParams.layerIds = [1];
imgParams.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW;
imgParams.transparent = true;
var dyn = new esri.layers.ArcGISDynamicMapServiceLayer("http://www.ncddc.noaa.gov/arcgis/rest/services/Models/NWS_AirTempForecasts/MapServer", {
"imageParameters": imgParams
});
map.addLayer(dyn);
dojo.connect(map, "onLoad", function() {
dojo.connect(dijit.byId("map"), "resize", map, map.resize);
});
}
dojo.ready(init);
</script>
</head>
<body class="tundra">
<div data-dojo-type="dijit.layout.BorderContainer"
data-dojo-props="design:'headline',gutters:false"
style="width: 100%; height: 100%; margin: 0;">
<div id="map"
data-dojo-type="dijit.layout.ContentPane"
data-dojo-props="region:'center'">
</div>
</div>
</body>
</html>