[OpenLayers-Users] National Elevation Data -EROS

Arnd Wippermann arnd.wippermann at web.de
Thu Oct 25 13:06:37 PDT 2012


you have to declare a width and heght for your map div.
 
ugly way:
    <div id="map" class="smallmap" style="border:1px solid
blue;width:512px;height:256px;"></div>

and try this init() function:
 
        function init(){
            map = new OpenLayers.Map( 'map' );
            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
 
"http://imsref.cr.usgs.gov:80/wmsconnector/com.esri.wms.Esrimap/USGS_EDC_Ele
v_NED?",
                    {layers: 'NED.HI_NED',
exceptions:'application/vnd.ogc.se_inimage', format:'image/png'} );
            map.addLayer(layer);
            //map.zoomToMaxExtent();
            map.setCenter(new
OpenLayers.LonLat(lon=-155.44555646516,lat=19.500732399862), 7); //Hawai
        }

Arnd

  _____  

Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Doug
Kunzman
Gesendet: Donnerstag, 25. Oktober 2012 01:45
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] National Elevation Data -EROS


I'm trying to display a layer from the EROS national elevation dataset
hosted by the USGS in openlayers. 

this code isn't working... 

<!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://imsref.cr.usgs.gov/wmsconnector/com.esri.wms.Esrimap/USGS_EDC_Elev_N
ED?>
http://imsref.cr.usgs.gov:80/wmsconnector/com.esri.wms.Esrimap/USGS_EDC_Elev
_NED?", 
                    {layers: 'NED.HI_NED'} ); 
            map.addLayer(layer); 
            map.zoomToMaxExtent(); 
        } 
    </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"></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> 

Can someone please tell me what I'm doing wrong?  I don't appear to be
getting a response in firebug. 

Douglas Kunzman
12201 Sunrise Valley Drive
Reston, VA 20192
Phone: 703 648-4234
dkunzman at usgs.gov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121025/da32880e/attachment.html>


More information about the Users mailing list