1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
4 <link rel="stylesheet" href="style.css" type="text/css" />
5 <script src="../lib/OpenLayers.js"></script>
6 <script type="text/javascript">
12 maxExtent: new OpenLayers.Bounds(-174,18.4,-63.5,71),
14 projection: "EPSG:4326"};
15 map = new OpenLayers.Map( 'map', mapOptions );
16 layer = new OpenLayers.Layer.ArcGIS93Rest( "ArcGIS Server Layer",
17 "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export",
18 {layers: "show:0,2"});
21 map.addControl( new OpenLayers.Control.MousePosition() );
23 map.setCenter(new OpenLayers.LonLat(-115, 45), 0);
26 function enableFilter() {
27 layer.setLayerFilter(2, "STATE_NAME LIKE '%" + document.getElementById('filterValueField').value + "%'");
30 function disableFilter() {
31 layer.setLayerFilter(2, null);
34 function updateButton() {
35 document.getElementById('filterButton').value = "Show '" +
36 document.getElementById('filterValueField').value + "' States";
40 <body onload="init()">
41 <h1 id="title">ArcGIS Server 9.3 Rest API Example</h1>
46 Shows the basic use of openlayers using an ArcGIS Server 9.3 Rest API layer
49 <div id="map" class="smallmap"></div>
52 This is an example of how to add an ArcGIS Server 9.3 Rest API layer to the OpenLayers window.
54 <input id="filterValueField" type="textfield" value="A"/>
55 <input id="filterButton" type="button" onclick="enableFilter();" value="Filter States"/>
56 <input type="button" onclick="disableFilter();" value="Show All States"/>
58 (Filter is case sensitive.)