Leaflet / Leaflet.label

Leaflet.label is plugin for adding labels to markers & shapes on leaflet powered maps.
MIT License
465 stars 225 forks source link

leaflet.label plugin error #159

Open jewelcai opened 8 years ago

jewelcai commented 8 years ago

angular-leaflet-directive v0.9

leaflet v1.0

leaflet.label plugin v0.2.4

I am using Angular leaflet directive and leaflet.label to show label on the marker, but when I follow the example given by angular-leaflet-directive, some errors come up. I don't know if I did anything wrong.

Cannot read property 'call' of undefined
    at NewClass.whenReady (leaflet-src1.js:3293)
    at NewClass.addLayer (leaflet-src1.js:3566)
    at NewClass.showLabel (leaflet.label-src.js:538)
    at NewClass.showLabel (leaflet.label-src.js:287)
    at NewClass._onMarkerAdd (leaflet.label-src.js:383)
    at NewClass.fire (leaflet-src1.js:587)
    at NewClass._layerAdd (leaflet-src1.js:3514)
    at NewClass.whenReady (leaflet-src1.js:3293)
    at NewClass.addLayer (leaflet-src1.js:3566)
    at _addMarkers (angular-leaflet-directive.js:4446)

and my code is

marker.label={
            message: data.name,
            options: {
            noHide: true
            }
        };

Thanks in advance, any advice is appreciated.

gholol commented 8 years ago

starting with Leaflet 1.0, L.Label is added to Leaflet core as L.Tooltip and this plugin is deprecrated.