Leaflet / Leaflet.toolbar

Flexible, extensible toolbars for Leaflet maps.
MIT License
197 stars 70 forks source link

this.contructor.baseClass does not find L.Toolbar.baseClass static #32

Closed cmulders closed 9 years ago

cmulders commented 9 years ago

Hi,

I am trying to use Leaflet.toolbar with the current dev version of leaflet. Unfortunately, I cannot create a subToolbar with proper styling because the class becomes 'undefined-1'.

See example: http://playground-leaflet.rhcloud.com/rol/edit?html,output Check in the dom of the unstyled items.

It seems that this.constructor.baseClass does not find the original L.Toolbar.baseClass, while the other extended toolbars (L.Toolbar.Control and L.Toolbar.Popup) they are found..

http://playground-leaflet.rhcloud.com/kay/edit?html,console

Any advice how to deal with this? Or maybe solve this bug? The examples shown in this repo are primarily based on Leaflet.Draw and are not very helpful when creating subToolbars.

Thanks!

cmulders commented 9 years ago

By extending the L.Toolbar the baseClass is available.. and has the leaflet-toolbar-1 class as expected

var subToolbar = L.Toolbar.extend({})

justinmanley commented 9 years ago

@cmulders - I'm going to close this, since it seems like you resolved it. Feel free to reopen if need be.

You raise a good point, though - Leaflet.toolbar could use a few examples of how to create subToolbars that don't depend on Leaflet.draw.