teastman / Leaflet.pattern

Plugin for leaflet that allows for use of fill patterns in Paths.
BSD 2-Clause "Simplified" License
124 stars 59 forks source link

Add legend #13

Open renatobecker-zz opened 8 years ago

renatobecker-zz commented 8 years ago

Hi,

How can I add L.StripePattern as a legend item? Thanks.

A1rPun commented 7 years ago

Create a simple .png file and add this to your legend:

background-image: url('./path/to/stripes.png'); background-repeat: repeat;
JamesWaldron commented 5 years ago

Create a simple .png file and add this to your legend:

background-image: url('./path/to/stripes.png'); background-repeat: repeat;

Could you explain how this would be done? How can you create the png file from a pattern?

A1rPun commented 5 years ago

@JamesWaldron You can find one on your favorite search engine with keywords like stripes tiled, make sure to search for transparent images. There are also some generators out there so you can choose color, direction, etc.

Do note that this is just mimicking the style of L.StripePattern. I hope this answer your questions