Having trouble styling the layers received from a server. I've tried using the layer.setStyle() function and defining the style when creating the layer, but nothing seems to work. Here's how my code looks:
var stateStyle = {
"color": "#3D5229",
"weight": 1,
"opacity": .90,
"fillOpacity": .90
};
var mywms2 = L.tileLayer.wms("http://someserver/geoserver/somepage/wms", {
layers: 'SomeMaps:view_table_geom',
format: 'image/png',
transparent: true,
style: stateStyle , //not working
version: '1.1.0'
});
//not working either
mywms2.setStyle(stateStyle);
Can't figure out what the problem is. It shouldn't be an issue.
Created a plunker to showcase the issue, although for some reason the map isn't displaying properly. If you copy-paste the code into an HTML file, you'll see what's going on: https://plnkr.co/edit/38VVojm8zLKhdXu10nQC?p=preview