buche / leaflet-openweathermap

A JavaScript library for including OpenWeatherMap's layers and OWM's current city/station data in leaflet based maps without hassle.
259 stars 132 forks source link

property 'call', 'removeControl' of undefined Leaflet 1.0.3 #23

Closed drunkod closed 6 years ago

drunkod commented 7 years ago

leaflet.js:6 Uncaught TypeError: Cannot read property 'call' of undefined at e.whenReady (leaflet.js:6) at e.addLayer (leaflet.js:6) at e._onInputClick (leaflet.js:9) at HTMLInputElement.h (leaflet.js:6)

leaflet-openweathermap.js:319 Uncaught TypeError: Cannot read property 'removeControl' of null at e.onRemove (leaflet-openweathermap.js:319) at e.removeLayer (leaflet.js:6) at e._onInputClick (leaflet.js:9) at HTMLInputElement.h (leaflet.js:6)

buche commented 7 years ago

Do you have more information WHEN this happens? What have you done to get get this error? Can you reproduce it?

Dimm38Rus commented 7 years ago

Have same problem, error occurs when trying to choose weather overlay. Leaflet 1.0.3. Fixed by replacing L.OWM.Current = L.Class.extend to L.OWM.Current = L.Layer.extend

buche commented 7 years ago

ok, you're using Leaflet 1.0.3. Haven't updated Leaflet myself, yet. Will look into it in about three weeks 'cause I'vo got no time now.

buche commented 6 years ago

I'm updating the example to leaflet 1.2.0 and adapting my code to it.