Readme misses mentioning that leaflet-toolbar & its CSS files are peer dependencies
Describe the bug:
Readme is incomplete: misses a mention that leaflet-toolbar & its CSS files are peer dependencies, i.e. not automatically added by yarn add and the like, neither automatically imported.
Reproduce the behavior:
1
import 'leaflet-distortableimage'
import 'leaflet-distortableimage/dist/leaflet.distortableimage.css'
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'Action')
at 941 (__dir__/src/edit/actions/EditAction.js:4:34)
at <anonymous> (__dir__/webpack/startup:3:1)
at ../leaflet-distortableimage/dist/leaflet.distortableimage.js (__dir__/leaflet-distortableimage/dist/leaflet.distortableimage.js:2:83840)
at __webpack_require__ (__dir__/webpack/bootstrap:22:1)
at fn (__dir__/webpack/runtime/hot module replacement:61:1)
at ./src/index.js (localhost꞉3000/index.bundle.js?3457720cccda14f87b35=:108909:84)
at __webpack_require__ (__dir__/webpack/bootstrap:22:1)
at <anonymous> (__dir__/webpack/startup:6:1)
at <anonymous> (localhost꞉3000/index.bundle.js?3457720cccda14f87b35=:110466:12)
2
import 'leaflet-distortableimage'
import 'leaflet-distortableimage/dist/leaflet.distortableimage.css'
import 'leaflet-toolbar'
Same error
3
import 'leaflet-toolbar'
import 'leaflet-distortableimage'
import 'leaflet-distortableimage/dist/leaflet.distortableimage.css'
Shows distortable image overlay, but:
4
import 'leaflet-toolbar'
import 'leaflet-toolbar/dist/leaflet.toolbar.css'
import 'leaflet-distortableimage'
import 'leaflet-distortableimage/dist/leaflet.distortableimage.css'
Works!
Found thanks to #463 & #714.
Readme should mention that you have to import (or similar) leaflet-toolbar & its CSS files before importing leaflet-distortableimage, e.g. 4.
Browser, version, and operating system: any
Hello! I’m interested in contributing to this issue. Can you please assign it to me, or let me know how I can help? Thanks in advance!
Hi! I’d like to work on this issue by updating the README to document leaflet-toolbar and its CSS as peer dependencies, with an example import order. If that’s okay, I’ll open a PR shortly. Thanks!