Skip to content

Unable to add more that two WFS layers #20

Open
@dameattrio

Description

@dameattrio

I saw another similar issue had been closed a couple years ago (#11), but I'm facing the same problem. Was there ever any resolution? I'm hosting postGIS, GeoServer and Leaflet via nginx all on docker. I've got multiple layers in Geoserver and whenever I do a L.Geoserver.wfs() request more than twice, I get the same error in console. I'm attempting to call several different layers, no two layers are the same. I'll have two working and introduce a third, and the second one stops working, etc.

wfs-related snippet, can provide more

var countyBoundary = L.Geoserver.wfs('https://example.com/geoserver/ows?service=WFS&', {
	layers: "ccps:countyBoundary",
	style: {
		color: "black",
		fillOpacity: 0,
		opacity: 0.75,
		dashArray: (10, 10),
	},
}).addTo(map);

var magisterialDistricts = L.Geoserver.wfs('https://example.com/geoserver/ows?service=WFS&', {
	layers: "ccps:magisterialDistrict",
	style: {
		color: "green",
		opacity: 0.75,
		dashArray: (10, 10),
	},
	onEachFeature: function (feature, layer) {
		layer.bindPopup(feature.properties.magdistnam);
	},
}).addTo(map);

var elementaryBoundary = L.Geoserver.wfs('https://example.com/geoserver/ows?service=WFS&', {
	layers: "ccps:elementaryBoundary",
	style: {
		color: "blue",
		opacity: 0.75,
		dashArray: (10, 10),
	},
	onEachFeature: function (feature, layer) {
		layer.bindPopup(feature.properties.schoolname);
	},
}).addTo(map);

console error:
parsererror Error: getJson was not called
Uncaught ReferenceError: getJson is not defined
Uncaught TypeError: that._map is undefined

What other info would be helpful?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions