[OpenLayers-Users] NGA National Grid WMS Example

Tom Kunicki tkunicki at usgs.gov
Wed Oct 31 19:09:34 PDT 2012


Doug,

Looks like you are hitting the wrong ArcGIS endpoint:

Try this:

var layer2 = new OpenLayers.Layer.ArcGIS93Rest(
	"ArcGIS Server Layer",
	"http://maps1.arcgisonline.com/ArcGIS/rest/services/NGA_US_National_Grid/MapServer/export",
	 {layers: "show:0,1,2,3,4,5,6,7,8,9,10,11,12,28"}); 

Tom Kunicki
Center for Integrated Data Analytics
U.S. Geological Survey
8505 Research Way
Middleton, WI  53562

On Oct 31, 2012, at 8:21 PM, Doug Kunzman <dkunzman at usgs.gov> wrote:

> Hi - 
> 
> I've looked on line and don't see what I'm doing wrong.  This is my debug info... with error code. 
> 
>  URL: 
>     http://maps1.arcgisonline.com/ArcGIS/rest/services/NGA_US_National_Grid/MapServer/5/export?LAYERS=show%3A0%2C1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C28&SRS=4269&ISBASELAYER=true&VISIBILITY=true&FORMAT=png&BBOX=-81.5625%2C39.375%2C-78.75%2C42.1875&SIZE=256%2C256&F=image&BBOXSR=4326&IMAGESR=4326 
>   
>   
>     Request Method: 
>     GET 
>   
>   
>     Status Code: 
>     HTTP/1.1 400 Bad Request 
> 
> And this is my test program. 
> 
> <!DOCTYPE html> 
> <html> 
>   <head> 
>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
>     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> 
>     <meta name="apple-mobile-web-app-capable" content="yes"> 
>     <title>OpenLayers Basic Single WMS Example</title> 
>     <link rel="stylesheet" href="../theme/default/style.css" type="text/css"> 
>     <link rel="stylesheet" href="style.css" type="text/css"> 
>     <script src="OpenLayers.js"></script> 
>     <script type="text/javascript"> 
>         var map, layer; 
>         function init(){ 
>             map = new OpenLayers.Map( 'map' ); 
>                          layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
>                     "http://imselev.cr.usgs.gov/wmsconnector/com.esri.wms.Esrimap/USGS_EDC_Elev_NED?", 
>                     {layers: 'NED.CONUS_NED',  srs: "4326",  format: "image/png"} ); 
>             //map.addLayer(layer); 
>             //map.zoomToMaxExtent(); 
>           //"http://maps1.arcgisonline.com/ArcGIS/rest/services/NGA_US_National_Grid/MapServer/5/export", 
>                         var layer2 = new OpenLayers.Layer.ArcGIS93Rest( "ArcGIS Server Layer",                     
>                                         "http://maps1.arcgisonline.com/ArcGIS/rest/services/NGA_US_National_Grid/MapServer/5/export", 
>                     {layers: "show:0,1,2,3,4,5,6,7,8,9,10,11,12,28", srs: "4269", isBaseLayer: true, visibility: true}); 
>             layer2.isBaseLayer = true; 
>                         layer2.wrapDateLine = true; 
>                         map.addLayer(layer2); 
>                                  map.zoomToMaxExtent(); 
>                         map.setCenter(new OpenLayers.LonLat(lon=-77.44555646516,lat=39.500732399862), 7); 
>         } 
>     </script> 
>   </head> 
>   <body onload="init()"> 
>     <h1 id="title">Basic Single WMS Example</h1> 
> 
>     <div id="tags"> 
>         basic, simple, minimal, cleanup 
>     </div> 
> 
>     <div id="shortdesc">Show a Simple Map</div> 
> 
>     <div id="map" class="smallmap" style="border:1px solid blue;width:512px;height:256px;"></></div> 
> 
>     <div id="docs"> 
>         <p>This example shows a very simple layout with minimal controls. 
>         This example uses a single WMS base layer.</p> 
>     </div> 
>   </body> 
> </html> 
> 
> Thanks, 
> Douglas Kunzman
> 12201 Sunrise Valley Drive
> Reston, VA 20192
> dkunzman at usgs.gov
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users





More information about the Users mailing list