The problem is resolved. I found that the 'id' of a layer is not same as its 'name'. While using ArcIMS to create a map, only name of every layer is displayed. I just mistook the 'name' of layer for its 'id'.
The 'id' of each layer can be gotten by opening the map configuration file '*.axl' with NotePad. carls wrote: > > I tried the ArcIMS layer and ArcXML provided by Ticket#213 sucessfully. > But when I setQuery to a layer, it seems no effect to the result. > > the code is listed below. > > /********************************************************/ > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <title>Local ArcIMS Example</title> > <link rel="stylesheet" href="./OpenLayers/theme/default/style.css" > type="text/css" /> > <link rel="stylesheet" href="style.css" type="text/css" /> > <script src="OpenLayers/lib/OpenLayers.js"></script> > <!--<script src="OpenLayers/lib/Proj4js/proj4js.js"></script> --> > <script type="text/javascript"> > var lon = (-122.496415 - 122.384637) / 2; > var lat = (37.728692 + 37.794956) / 2; > var zoom = 10; > var map, layer; > > function init(){ > //OpenLayers.ProxyHost = "proxy.ashx?url="; //only necessary > for cross-domain access > map = new OpenLayers.Map( 'map' ); > > var options = { > serviceName: "SF", > async: true, > displayOutsideMaxExtent: true, > layers: [ > { > id: 'stores',visible: > true, > query: { where: '1>2' > } > } > ] > }; > > layer = new OpenLayers.Layer.ArcIMS( "local Map", > > "http://localhost:8080/servlet/com.esri.esrimap.Esrimap", options); > > map.addLayer(layer); > > map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); > } > </script> > </head> > <body onload="init()"> > <h1 id="title">ArcIMS Example</h1> > > <div id="tags"> > </div> > <p id="shortdesc"> > Shows the basic use of openlayers using an ArcIMS layer > </p> > > <div id="map" class="smallmap"></div> > > <div id="docs"> > This is an example of how to add an ArcIMS layer to the OpenLayers > window. > </div> > > </body> > </html> > /********************************************************/ > > Could somebody help me? > > Thanks very much. > ----- Regards, Carl SHE -- View this message in context: http://n2.nabble.com/setQuery-to-ArcIMS-layer-is-not-available--tp2325774p2326265.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
