Create a Layer class to access the ArcGIS 9.3 Map Export service. Patch by
Jeff Adams, from Avencia. r=me. Tested with the default service, and several other example map services from ESRI (like http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/export). Note that I don't believe this takes advantage of map caches; if we create a seperate layer for that, we should probably create a Layer.ArcGIS. namespace. (Closes #1749) git-svn-id: http://svn.openlayers.org/trunk/openlayers@8917 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
64
examples/arcgis93rest.html
Normal file
64
examples/arcgis93rest.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
var map;
|
||||
var layer;
|
||||
|
||||
function init(){
|
||||
var mapOptions = {
|
||||
maxExtent: new OpenLayers.Bounds(-174,18.4,-63.5,71),
|
||||
maxResolution: 0.25,
|
||||
projection: "EPSG:4326"};
|
||||
map = new OpenLayers.Map( 'map', mapOptions );
|
||||
layer = new OpenLayers.Layer.ArcGIS93Rest( "ArcGIS Server Layer",
|
||||
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export",
|
||||
{layers: "show:0,2"});
|
||||
map.addLayer(layer);
|
||||
|
||||
map.addControl( new OpenLayers.Control.MousePosition() );
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(-115, 45), 0);
|
||||
}
|
||||
|
||||
function enableFilter() {
|
||||
layer.setLayerFilter(2, "STATE_NAME LIKE '%" + document.getElementById('filterValueField').value + "%'");
|
||||
layer.redraw();
|
||||
}
|
||||
function disableFilter() {
|
||||
layer.setLayerFilter(2, null);
|
||||
layer.redraw();
|
||||
}
|
||||
function updateButton() {
|
||||
document.getElementById('filterButton').value = "Show '" +
|
||||
document.getElementById('filterValueField').value + "' States";
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1 id="title">ArcGIS Server 9.3 Rest API Example</h1>
|
||||
|
||||
<div id="tags">
|
||||
</div>
|
||||
<p id="shortdesc">
|
||||
Shows the basic use of openlayers using an ArcGIS Server 9.3 Rest API layer
|
||||
</p>
|
||||
|
||||
<div id="map" class="smallmap"></div>
|
||||
|
||||
<div id="docs">
|
||||
This is an example of how to add an ArcGIS Server 9.3 Rest API layer to the OpenLayers window.
|
||||
</div>
|
||||
<input id="filterValueField" type="textfield" value="A"/>
|
||||
<input id="filterButton" type="button" onclick="enableFilter();" value="Filter States"/>
|
||||
<input type="button" onclick="disableFilter();" value="Show All States"/>
|
||||
<br>
|
||||
(Filter is case sensitive.)
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user