I need to make a distinction if a vector layer that's added to a leaflet map is a line or an area. My goal is to automatically generate a legend that has lines (colored by the color
attribute and styled by dashArray
of the layer.options
) or areas (colored by the fillColor
attribute), depending on the chosen layer. The Documentation doesn't say anything about a layer's type (or at least I didn't find anything).. so is this possible?
I tried typeof layer
(that's object
) and layer.constructor
(function e()
)..