]> dev.renevier.net Git - syp.git/blob - openlayers/examples/arcgis93rest.html
initial commit
[syp.git] / openlayers / examples / arcgis93rest.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
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">
7         var map;
8         var layer;
9
10         function init(){
11             var mapOptions = {
12                 maxExtent: new OpenLayers.Bounds(-174,18.4,-63.5,71),
13                 maxResolution: 0.25,
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"});
19             map.addLayer(layer);
20
21             map.addControl( new OpenLayers.Control.MousePosition() );
22             
23             map.setCenter(new OpenLayers.LonLat(-115, 45), 0);
24         }
25         
26         function enableFilter() {
27             layer.setLayerFilter(2, "STATE_NAME LIKE '%" + document.getElementById('filterValueField').value + "%'");
28             layer.redraw();
29         }
30         function disableFilter() {
31             layer.setLayerFilter(2, null);
32             layer.redraw();
33         }
34         function updateButton() {
35             document.getElementById('filterButton').value = "Show '" +
36                 document.getElementById('filterValueField').value + "' States";
37         }
38     </script>
39   </head>
40   <body onload="init()">
41     <h1 id="title">ArcGIS Server 9.3 Rest API Example</h1>
42
43     <div id="tags">
44     </div>
45     <p id="shortdesc">
46         Shows the basic use of openlayers using an ArcGIS Server 9.3 Rest API layer
47     </p>
48
49     <div id="map" class="smallmap"></div>
50
51     <div id="docs">
52         This is an example of how to add an ArcGIS Server 9.3 Rest API layer to the OpenLayers window.
53     </div>
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"/>
57     <br>
58     (Filter is case sensitive.)
59   </body>
60 </html>
61
62
63
64