OpenLayers not displaying map from WMS layer in GeoServer

المشرف العام

Administrator
طاقم الإدارة
I've adapted the working example from geo-solutions website but still it is not working, it seems the problem is with jetty. below is the previous question

I'm using Geoserver with jetty web server, I've published WMS layer in GeoServer and when i call it from QGIS it works perfectly, but when i call it with OpenLayers it is not loading, it says HTTP ERROR: 404 Not found, both my html file (with the OpenLayers script) and GeoServer are running on localhost:8083.

Counties of enschede #map-id { width: 512px; height: 300px; } Counties of enschede

var bounds = new OpenLayers.Bounds( 760709.059251067, 6834146.95621378, 775589.940002763, 6845228.94005499 );

var options = { controls: [], maxExtent: bounds, maxResolution: 0.02741796875, projection: "EPSG:3857", units: 'm' }; map = new OpenLayers.Map('map-id', options); var ccounties = new OpenLayers.Layer.WMS( "Map - Enschede", "http://localhost:8083/geoserver/thesis/wms", { srs: 'EPSG:3857', layers: 'thesis:Ensche', styles: '', format:'image/png' }, {singleTile: true, ratio: 1} ); map.addLayer(ccounties); // build up all controls map.addControl(new OpenLayers.Control.PanZoomBar({ position: new OpenLayers.Pixel(2, 15) })); map.addControl(new OpenLayers.Control.Navigation()); map.addControl(new OpenLayers.Control.Scale()); map.addControl(new OpenLayers.Control.MousePosition()); map.zoomToExtent(bounds);



أكثر...
 
أعلى