I am attempting to create a web map in OpenLayers by pulling in layers from GeoServer which is running on an Amazon EC2 instance. The prepackaged layers from GeoServer seem to show up fine when I substitute their URL in the map code. However I have a PostGIS layer that I am wanting to use as the basis for the map which is not showing up no matter what I try.
I have read several threads that seem to indicate it's a problem with mismatched projections. But I'm not sure where or how to "reproject" the layer or if that is my problem. It does shows up in the GeoServer OpenLayers preview (as a single tile, but not "tiled" for some reason). The declared SRS when I originally published the layer in GeoServer is EPSG:404000. I'm not sure why it is that. Changing it doesn't seem to help.
<!DOCTYPE html>
<html>
<head>
<title>Tiled WMS</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<script src="https://openlayers.org/en/v4.6.4/build/ol.js"></script>
</head>
<body>
<div id="map" class="map"></div>
<script>
var layers = [
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.TileWMS({
url: 'http://ec2-18-221-107-236.us-east-2.compute.amazonaws.com:8080/geoserver/Prospect1/wms',
params: {'LAYERS': 'prospect_leases', 'TILED': true},
serverType: 'geoserver',
isBaseLayer: false,
projection: 'EPSG:404000'
})
})
];
var map = new ol.Map({
layers: layers,
target: 'map',
view: new ol.View({
center: ol.proj.transform([-97.3311, 33.0649], 'EPSG:4326', 'EPSG:3857'),
zoom: 16
})
});
</script>
</body>
</html>