[OpenLayers-Dev] suggested patch to OpenLayers.Layer.ArcGIS93Rest

G. Allegri giohappy at gmail.com
Thu Nov 4 11:43:17 EDT 2010


I've noticed that the getUrl method in ArcGIS93Rest sets the thw
params BBOXSR and IMAGESR based on the map projection.
This is generally ok, but doesn't work if we want to use the "google
projection" (EPSG:900913). In such case we need to submit a specific
CSR to ArcGIS service: 102113
For my needs I've modified the method with the attached patch to check
if BBOXSR and IMAGESR params have been set as layer options.

giovanni
-------------- next part --------------
### Eclipse Workspace Patch 1.0
#P SigecWeb
Index: src/main/java/it/iccd/sigec/axweb/public/js/OpenLayers/2_10/lib/OpenLayers/Layer/ArcGIS93Rest.js
===================================================================
--- src/main/java/it/iccd/sigec/axweb/public/js/OpenLayers/2_10/lib/OpenLayers/Layer/ArcGIS93Rest.js	(revision 10398)
+++ src/main/java/it/iccd/sigec/axweb/public/js/OpenLayers/2_10/lib/OpenLayers/Layer/ArcGIS93Rest.js	(working copy)
@@ -141,8 +141,20 @@
         bounds = this.adjustBounds(bounds);
 
         // ArcGIS Server only wants the numeric portion of the projection ID.
+		if(this.params.BBOXSR && this.params.BBOXSR!=""){
+		var bboxsrid = this.params.BBOXSR
+		}
+		else{
         var projWords = this.projection.getCode().split(":");
-        var srid = projWords[projWords.length - 1];
+        var bboxsrid = projWords[projWords.length - 1];
+		}
+		if(this.params.IMAGESR && this.params.IMAGESR!=""){
+		var imagesrid = this.params.BBOXSR
+		}
+		else{
+        var projWords = this.projection.getCode().split(":");
+        var imagesrid = projWords[projWords.length - 1];
+		}
 
         var imageSize = this.getImageSize(); 
         var newParams = {
@@ -150,8 +162,8 @@
             'SIZE': imageSize.w + "," + imageSize.h,
             // We always want image, the other options were json, image with a whole lotta html around it, etc.
             'F': "image",
-            'BBOXSR': srid,
-            'IMAGESR': srid
+            'BBOXSR': bboxsrid,
+            'IMAGESR': imagesrid
         };
 
         // Now add the filter parameters.


More information about the Dev mailing list