I guess you are missing the definition of extents and resolutions of the
map.
I kindly suggest you to open the GeoServer preview page, take a look at the
source HTML. You will be able ti find in there the correct setup of an
OpenLayers client which you can customize further lately.
Regards,
Alessio.
-------------------------------------------------------
Ing. Alessio Fabiani
Founder / CTO GeoSolutions S.A.S.
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: (+39) 0584 96.23.13
fax: (+39) 0584 96.23.13
mobile:(+39) 331 62.33.686
http://www.geo-solutions.it
http://geo-solutions.blogspot.com
http://www.linkedin.com/in/alessiofabiani
https://twitter.com/alfa7961
http://twitter.com/geosolutions_it
-------------------------------------------------------
On Wed, May 16, 2012 at 10:09 AM, Carlo Pelliconi
<[email protected]>wrote:
> Hi all,
> I'm new with Geoserver. I've installed it, on Debian, and inserted a
> new layer (call it cat_layer_layername), from shapefile, insiede a new
> workspace (call it Various_shp).
> When I enter admin panel, I can correctly see Openlayers preview of
> cat_layer_layername.
> BUT when I call it from a web page, using Openlayers syntax, I fail: I
> obtain the navigation arrows, the zoom buttons (+ and -) and a series of
> 256x256 broken images, in which geoserver server's address is correct. May
> it be a mystake in Openlayers' syntax for the request?
> Here the code:
>
> [file: web_page.html]
> <script defer="defer" type="text/javascript">
> var map = new OpenLayers.Map('map');
>
> wms = new OpenLayers.Layer.WMS(
> "Layer named cat_layer_layername",
> "http://192.168.74.114:8181/geoserver/web",
> {
> srs: 'EPSG:25832',
> layers: 'cat_layer_layername',
> format: 'image/png',
> tiled: true,
> tilesorigin: [map.maxExtent.left, map.maxExtent.bottom]
> }
> );
> map.addLayer(wms);
> map.zoomToMaxExtent();
> </script>
>
> [geoserver server's configuration]
> workspaces:
> 1. Various_shp
> 2. Another_one
> layers:
> 1. workspace: Various_shp | store: cat_layer_storename | layer name:
> cat_layer_layername | enabled: yes | native SRS: EPSG:25832
> 2. workspace: Another_one | store: another_layer_storename | layer
> name: another_layer_layername | enabled: yes | native SRS: EPSG:25832
>
> Thank you very much.
> Regards, Carlo
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users