[OpenLayers-Commits] r12260 - trunk/openlayers/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Aug 18 06:15:45 EDT 2011


Author: fredj
Date: 2011-08-18 03:15:44 -0700 (Thu, 18 Aug 2011)
New Revision: 12260

Modified:
   trunk/openlayers/examples/arcgiscache_jsonp.html
Log:
update the arcgiscache_jsonp example to use OpenLayers.Protocol.Script instead of the JSONP from jquery

Modified: trunk/openlayers/examples/arcgiscache_jsonp.html
===================================================================
--- trunk/openlayers/examples/arcgiscache_jsonp.html	2011-08-18 09:54:42 UTC (rev 12259)
+++ trunk/openlayers/examples/arcgiscache_jsonp.html	2011-08-18 10:15:44 UTC (rev 12260)
@@ -7,20 +7,17 @@
     <link rel="stylesheet" href="style.css" type="text/css">
 
     <script src="../lib/OpenLayers.js"></script>
-    <script src="../lib/OpenLayers/Layer/ArcGISCache.js" type="text/javascript"></script>
     
-    <!-- This is to simplify making the JSONP request for this example -->
-    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
-    
     <script type="text/javascript">
         var map,
             layerURL = "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer";
         
         function init() {
-            var jsonp_url = layerURL + '?f=json&pretty=true&callback=?';
-            $.getJSON(jsonp_url, function(data) {                
-                initMap(data);
-            });
+            var jsonp = new OpenLayers.Protocol.Script();
+            jsonp.createRequest(layerURL, {
+                f: 'json', 
+                pretty: 'true'
+            }, initMap);
         }
 
         function initMap(layerInfo){
@@ -93,7 +90,7 @@
         <p>
         This method automatically configures the layer using the capabilities object 
         generated by the server itself.  This page shows how to construct the url for the server capabilities object,
-        retrieve it using JSONP (and jQuery), and pass it in during construction.  Note that in this case, 
+        retrieve it using JSONP, and pass it in during construction.  Note that in this case, 
         the layer is constructed before the map.  This approach greatly simplifies the
         configuration of your map, and works best when all your tiles / overlays are similarly laid out.
         If you are using a live AGS map server for your layer, it can be helpful to check your



More information about the Commits mailing list