Leaflet.DistortableImage icon indicating copy to clipboard operation
Leaflet.DistortableImage copied to clipboard

Readme misses mentioning that leaflet-toolbar & its CSS files are peer dependencies

Open raph-topo opened this issue 4 months ago • 1 comments

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:

Image

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

raph-topo avatar Aug 15 '25 15:08 raph-topo

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!

Aayushdev18 avatar Oct 26 '25 16:10 Aayushdev18

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!

subhu339 avatar Dec 17 '25 05:12 subhu339