How to add a geoserver layer to openlayers?

المشرف العام

Administrator
طاقم الإدارة
I am trying to add a geoserver layer with 2 points on the openlayers. But I only get the map without the points. This is what I try:

OpenLayers Example
var map = new OpenLayers.Map('map'); var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} ); var cabin= new OpenLayers.Layer.WMS( "Cabins", "http://localhost:8080/geoserver/wms", {layers: "cite::eek:bj_geom", transparent: false, TILED: false, styles: "point" }, {isBaseLayer: false, displayInLayerSwitcher: true, format: "image/png", visibility: false, displayOutsideMaxExtent: false, projection: new OpenLayers.Projection("EPSG:900913") } ); map.addLayers([wms,cabin]); map.zoomToMaxExtent();



What am I doing wrong? I thought it was the projections but I changed it to EPSG:900913, the same with the openlayers map projection.



أكثر...
 
أعلى