I am writing a Leaflet plugin that extends Leaflet.Draw. When trying to write something like:

L.SRTM.Draw.Feature = L.Draw.Feature.extend({ ... }); 

the following crashes:

Uncaught TypeError: Cannot read property 'Feature' of undefined

When writing:

 L.SRTM.Draw.Feature = L.Class.extend({ ... includes: L.Draw.Feature, ... }); 

the same thing happens.

What is the problem?

    1 answer 1

    The answer in the error description: the class L.Draw does not exist. There is L.Control.Draw . However, I advise you to forget about Leaflet.draw (it hasn’t been updated for almost a year, and most likely will be poorly compatible with Leaflet 1.0), and use Leaflet.Editable .