I have a published postgis county table on geoserver. In the layer preview it looks like this
in my very simple JS code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Leaflet Test</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.js" crossorigin=""></script>
<script type="text/javascript">
var map;
function init() {
// create map and set center and zoom level
map = new L.map('mapid',{
crs: L.CRS.EPSG4326
});
map.setView([40.876,-74.9999],12);
var dlayer=L.tileLayer.wms('http://localhost:8080/geoserver/wms',{
layers: 'pg_world:county0',
}).addTo(map);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Highlands Leaflet Test</h1>
<div id="mapid">
</div>
</body>
</html>
what happens is when I display in the browser it looks like this
and gets all out of whack when I zoom around. I have tried setting the map view to another place and changed the zoom level and the problem remained.
I should note this layer is originally in 3424 (NJ state plane) and the reproject native to delcared. image shown below
EDIT 1
I brought a county layer that is in 4326 into geoserver and put it in place of the county0 layer and the same error occurs... does this have something to do with the tile settings?
EDIT 2
I replaced my own layer with a sample layer that came with the geoserver download 'usa:states' and the same problem occurred.
EDIT 3
I added the '?' after WMS and did not work, specified the version to 1.3.0 in the arguments. nothing is working at all. No idea why
what is going on here? why is this wrong???!!! I'm following the leaflet tutorial to a T