.target {filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)}
img[src$=".jpg"]{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)}but i can't seem to find a way to set the image format for a ArcGISTiledMapServiceLayer layer.
#map_layer0{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1) }
<img id="map_layer0_tile_2_0_1" class="layerTile" style="left: 450px; top: -126px; width: 256px; height: 256px; visibility: visible; " src="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/2/0/1" >
Hmm...one problem is that URLs for tiles don't have a file extension, see: http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/2/0/0
They are added via img tags though so you might be able to do this...here's an example of the HTML for a tile in a tiled service(taken from http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=jsapi):<img id="map_layer0_tile_2_0_1" class="layerTile" style="left: 450px; top: -126px; width: 256px; height: 256px; visibility: visible; " src="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/2/0/1" >
img[id*='map_layer'] {filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1) } .esriBasemapGalleryNode{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); font-size:small; } #map_layer0{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1) }
There was a cool demo from this year's UC that does exactly this: http://na.arcgis.com/UCdemo/traffic.html
<svg xmlns="http://www.w3.org/2000/svg"> <filter id="grayscale"> <feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"/> </filter> </svg>
osm = new esri.layers.OpenStreetMapLayer({ id: 'osmLayer' });
#map_osmLayer img { filter: url(filters.svg#grayscale) !important; /* Firefox 3.5+ - notice the svg from above */ filter: gray !important; /* IE5+ */ -webkit-filter: grayscale(1) !important; /* Webkit Nightlies; Chrome Canary */ }