[OpenLayers-Dev] Why I cant open WMS layer?

Xurxo Mendez xmendez at udc.es
Fri Oct 29 02:44:17 EDT 2010


I think it's not you but the server layer who's causing the error (assuming
that you refer to 'jpl_wms' layer). If you replace 'landsat7' layer with
'overview' layer you'll notice that there's no error, just a blank image,
which means that even the server is OK but not is the layer. You would try
with another WMS server

Best regards,

Xurxo Méndez Pérez

http://www.sonxurxo.com


2010/10/28 Malik Shahzad <malik.rsgis at gmail.com>

> Dear I am new to Open layers and need some information.
>
> I am trying to add some WMS layers but failed to do :( I am following one
> tutorial and write following code.
>
>
> <html>
> <head>
> <title>OpenLayers Example</title>
>  <script src="http://openlayers.org/api/OpenLayers.js"></script>
> <script defer="defer" type="text/javascript">
>  function init()
> {
> var map = new OpenLayers.Map('map');
>  var wms = new OpenLayers.Layer .WMS( "OpenLayers WMS",
> "http://labs.metacarta.com/wms/vmap0",
>  {layers: 'basic'}
> );
> map.addLayer (wms);
>  map.zoomToMaxExtent();
>
> var lon = 100.4;
> var lat = 13.1;
>  var zoom = 5;
> map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
>
>
> map.addControl( new OpenLayers.Control.LayerSwitcher() );
>
> var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
>  "http://t1.hypercube.telascience.org/cgi-bin/landsat7" ,
> {layers: "landsat7"}
>  );
> map.addLayer(jpl_wms);
> }
>
> </script>
> </head>
>
> <body onload=init()>
>
> <div style="width: 800px; height: 475px" id="map">
>
> Hello My Map
>
> </div>
> </body>
> </html>
>
>
>
>
> waiting for your kind response.
> Malik
>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20101029/bf4e3e1e/attachment.html


More information about the Dev mailing list