<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>Create Map</title> <link rel="stylesheet" type="text/css" href="lib/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" type="text/css" href="lib/dojox/grid/resources/Grid.css"> <link rel="stylesheet" type="text/css" href="lib/dojox/grid/resources/tundraGrid.css"> <script type="text/javascript" src="../src/dojo.js.uncompressed.js" ></script> <script type="text/javascript" src="serverapi.js"></script> <script type="text/javascript"> dojo.require("esri.map"); dojo.require("esri.tasks.query"); var map; function init() { map = new esri.Map("map"); var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("your server"); map.addLayer(dynamicMapServiceLayer).hide(); } function SetLayer(){ var test1 = []; test1[0] = 44; map.setVisibleLayers([44]).show(); } dojo.addOnLoad(init); </script> </head> <body class="tundra"> <div id="map"></div> <input type="button" value="Set Layer" onclick="return SetLayer();" /> </body> </html>