7vingt
7vingt

Reputation: 301

Leaflet get the current style of a layer

In leaflet javascript library i can't get the style value of a layer. I have looked at the documentation but i can't see any way to do this!

Here how i set the style :

layer.setStyle({
    weight: 5,
    color: '#666',
    dashArray: '',
    fillOpacity: 0,
    opacity: 0.9,
});

There is a methode setStyle but not getStyle ... How can i check for those values? I need this to know the state of a layer to know what to do if the layer is "red" etc ...

Thank you!

Upvotes: 7

Views: 7598

Answers (1)

Mics
Mics

Reputation: 1430

layer.options contains those values.

Upvotes: 28

Related Questions