Skip to main content

OpenLayers OpenLayers2 - Introduction tutorial problem

I have just started looking into OpenLayers and I can't seem to even get the example provided to work,. I just get a blank screen.

Am I missing something really obvious? Here's the htmlHTML I am trying to run.

<html>
<head>
  <title>OpenLayers Example</title>
  <script src="http://openlayers.org/api/OpenLayers.js"></script>
</head>
<body>
    <div style="width:100%; height:100%" id="map"></div>
    <script defer="defer" type="text/javascript">
        var map = new OpenLayers.Map('map');
        var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
            "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
        map.addLayer(wms);
        map.zoomToMaxExtent();
    </script>
</body>
</html>

OpenLayers - Introduction tutorial problem

I have just started looking into OpenLayers and I can't seem to even get the example provided to work, I just get a blank screen.

Am I missing something really obvious? Here's the html I am trying to run.

<html>
<head>
  <title>OpenLayers Example</title>
  <script src="http://openlayers.org/api/OpenLayers.js"></script>
</head>
<body>
    <div style="width:100%; height:100%" id="map"></div>
    <script defer="defer" type="text/javascript">
        var map = new OpenLayers.Map('map');
        var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
            "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
        map.addLayer(wms);
        map.zoomToMaxExtent();
    </script>
</body>
</html>

OpenLayers2 - Introduction tutorial problem

I have just started looking into OpenLayers and I can't seem to even get the example provided to work. I just get a blank screen.

Am I missing something really obvious? Here's the HTML I am trying to run.

<html>
<head>
  <title>OpenLayers Example</title>
  <script src="http://openlayers.org/api/OpenLayers.js"></script>
</head>
<body>
    <div style="width:100%; height:100%" id="map"></div>
    <script defer="defer" type="text/javascript">
        var map = new OpenLayers.Map('map');
        var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
            "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
        map.addLayer(wms);
        map.zoomToMaxExtent();
    </script>
</body>
</html>
removed thanks, improved code formatting
Source Link
nmtoken
  • 13.6k
  • 5
  • 38
  • 89

I have just started looking into OpenLayers and I can't seem to even get the example provided to work, I just get a blank screen.

Am I missing something really obvious? Here's the html I am trying to run. Many thanks!

<html>
<head>
  <title>OpenLayers Example</title>
    <script src="http://openlayers.org/api/OpenLayers.js"></script>
    </head>
    <body>
      <div style="width:100%; height:100%" id="map"></div>
      <script defer="defer" type="text/javascript">
        var map = new OpenLayers.Map('map');
        var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
            "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
        map.addLayer(wms);
        map.zoomToMaxExtent();
      </script>
 
</body>
</html>

I have just started looking into OpenLayers and I can't seem to even get the example provided to work, I just get a blank screen.

Am I missing something really obvious? Here's the html I am trying to run. Many thanks!

<html>
<head>
  <title>OpenLayers Example</title>
    <script src="http://openlayers.org/api/OpenLayers.js"></script>
    </head>
    <body>
      <div style="width:100%; height:100%" id="map"></div>
      <script defer="defer" type="text/javascript">
        var map = new OpenLayers.Map('map');
        var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
            "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
        map.addLayer(wms);
        map.zoomToMaxExtent();
      </script>
 
</body>
</html>

I have just started looking into OpenLayers and I can't seem to even get the example provided to work, I just get a blank screen.

Am I missing something really obvious? Here's the html I am trying to run.

<html>
<head>
  <title>OpenLayers Example</title>
  <script src="http://openlayers.org/api/OpenLayers.js"></script>
</head>
<body>
    <div style="width:100%; height:100%" id="map"></div>
    <script defer="defer" type="text/javascript">
        var map = new OpenLayers.Map('map');
        var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
            "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
        map.addLayer(wms);
        map.zoomToMaxExtent();
    </script>
</body>
</html>

OpenLayer OpenLayers - Introduction tutorial problem

Source Link
Loading