Skip to content

tonekk/Leaflet-Extended-Div-Icon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet-Extended-Div-Icon

License

L.ExtendedDivIcon - Adds the ability to set the id and style of the element created by L.DivIcon

I always found it quite uncomfortable that you can only set classes for L.DivIcon, so I built this thing. Maybe somebody else needs this.

Usage example

var marker = L.marker(L.latLng(lat, lng), {
                      icon: L.extendedDivIcon({

                        // Set classes here, as usual
                        className: 'class-a class-b class-c',

                        // Set id here (new!)
                        id: 'my-awesome-id'

                        // Set style here (new!)
                        style: {
                          backgroundColor: '#fff'
                        }
                      })
                    });

About

L.ExtendedDivIcon - Add styling and ids to your div icons

Resources

License

Stars

Watchers

Forks

Packages

No packages published