[OpenLayers-Dev] page does not show any thing
mkabeer
mkabeer at tamimicg.com
Tue Jul 14 03:19:55 EDT 2009
Hi Tim,
First of all Thank you very much.
i did as you said i copied the 1-basics.html into goeserver/www folder then
i run from web
http://localhost:8910/geoserver/www/1-basics.html
it does not show
if type wrong html file name like
http://localhost:8910/geoserver/www/1-b.html
the server is there is no file that means the server can read html file now
but inside html file there is some thing wrong can you please look at the
code here following
<html>
<head>
<script src="openlayers/lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init() {
map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS(
"Blue Marble",
"http://localhost/geoserver/wms",
{layers: 'world'}
);
map.addLayers([wms]);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<div id="map" style="width: 600px; height: 300px"></div>
</body>
</html>
Thanks
Kabeer
Tim Schaub wrote:
>
> Hey-
>
> mkabeer wrote:
>> Dear All,
>>
>> i am new to open layers and geoserver, as per documents i installed
>> geoserver and tested its working
>> then i created following html page and copied as 1-basics.html and copied
>> into /geoserver/1-basics.html
>> and running through the firefox but nothing is displaying. page is empty.
>> here is the following code
>>
>
> I assume you access GeoServer via a URL like
> http://localhost:8080/geoserver
>
> If so, then http://localhost/geoserver/wms (used below) will only
> resolve to your WMS endpoint if you set up a proxy.
>
> If you don't want to set up a proxy, you can dump things in the www
> directory in GeoServer's config directory. Assuming you place a page in
> there called basic.html, it will be accessible via a URL like
> http://localhost:8080/geoserver/www/basic.html
>
> If your html uses relative URLs to pull in additional resources (like
> OpenLayers.js), then those resources must be located relative to your
> basic.html page.
>
> None of this is really OpenLayers specific, but if you have additional
> trouble getting OpenLayers to load, send more detail.
>
> Tim
>
>> <html>
>> <head>
>> <script src="openlayers/lib/OpenLayers.js"></script>
>> <script type="text/javascript">
>>
>> var map;
>> function init() {
>> map = new OpenLayers.Map('map');
>>
>> var wms = new OpenLayers.Layer.WMS(
>> "Blue Marble",
>> "http://localhost/geoserver/wms",
>> {layers: 'world'}
>> );
>>
>> map.addLayers([wms]);
>> map.zoomToMaxExtent();
>> }
>>
>> </script>
>> </head>
>>
>> <body onload="init()">
>> <div id="map" style="width: 600px; height: 300px"></div>
>> </body>
>> </html>
>>
>>
>> some one please help me in this
>>
>> Thanks
>> Kabeer
>
>
> --
> Tim Schaub
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
>
--
View this message in context: http://n2.nabble.com/page-does-not-show-any-thing-tp3250852p3254474.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.
More information about the Dev
mailing list