stefanocudini / leaflet-panel-layers

Leaflet Control Layers extended with support groups and icons
https://opengeo.tech/maps/leaflet-panel-layers/
MIT License
286 stars 92 forks source link

flowfyre/ImageLayerControl #17

Closed flowfyre closed 8 years ago

flowfyre commented 8 years ago

Add Background Image to Each layer control item users are able to define a background image for each layer control item, such as:

{
    name: "Bar",
    backgroundImage: 'images/bar.png',
    layer: L.geoJson(Bar, {pointToLayer: featureToMarker })
}
stefanocudini commented 8 years ago

@flowfyre I can't merge pull request that contains specific constants values like this: https://github.com/stefanocudini/leaflet-panel-layers/pull/17/commits/35c040d5d3a87fa5760340ce98d243b47977ef13#diff-dafe98761fc68daa122e4ec53c2fb886L193

about backgound image... I think that the best way is using custom CSS class for each layer and apply the background image via CSS... for example. What do you think about this solution?

Is very important that any functionlities for this plugin remain general for large number of cases..

In any cases I'working about a general solution for solve it.

stefanocudini commented 8 years ago

@flowfyre solved adopted new option buildItem from version 0.3.0 new example using custom background here: http://labs.easyblog.it/maps/leaflet-panel-layers/examples/custom-item.html and here: http://labs.easyblog.it/maps/leaflet-panel-layers/examples/layer-thumbnails.html