I'm creating a Leaflet map of the State of Wisconsin and the counties. I have a layer for the entire US, one for the state of Wisconsin and one for each individual county. I have 3 different styles and I'm setting them appropriately. Everything works as you would think.
function setStyle(feature) {
return {
opacity: 1,
color: "#fff",
fillColor: "#c5050c",
fillOpacity: 1
}
}
function setUS(feature) {
return {
opacity: .5,
color: "#a5a5a5",
fillColor: "#ebebeb",
fillOpacity: 0.2
}
}
function setState(feature) {
return {
opacity: 1,
color: "#fff",
fillOpacity: .1
}
}
L.geoJson(state, { style: setState}).addTo(map);
L.geoJson(states, { style: setUS}).addTo(map);
L.geoJson(Adams, { style: setStyle}).addTo(map)
What I'd like to do is update the State layer to have a background image. I can't figure out how to do this Leaflet using a GeoJSON layer. Does anyone have any suggestions? I tried adding a class and giving it a background image. I tried using imageOverlay, but that only creates a rectangle.

