Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error While Trying to draw a rectangle using react-leaflet-draw with Vite "Uncaught ReferenceError: assignment to undeclared variable type" #178

Open
markosbahgat opened this issue Aug 13, 2023 · 1 comment

Comments

@markosbahgat
Copy link

Hello There,
Im getting an error while trying to draw a rectangle "Uncaught ReferenceError: assignment to undeclared variable type",
All other shapes are working fine, but the rectangle is not working, when i use Vite, it throws this error, when i use webpack it's working very good

here's my code JSX code:

<FeatureGroup> <EditControl onDrawStart={_onDrawStart} position='topleft' onEdited={_onEdited} onCreated={_onCreated} onDeleted={_onDeleted} draw={{ polyline: { icon: new L.DivIcon({ iconSize: new L.Point(8, 8), className: 'leaflet-div-icon leaflet-editing-icon' }), shapeOptions: { guidelineDistance: 10, color: 'navy', weight: 3 } }, rectangle: true, circlemarker: false, circle: false, polygon: false }} /> </FeatureGroup>

Screenshot of a comment on a GitHub issue showing an image, added in the Markdown, of an Octocat smiling and raising a tentacle.

@Abhik-Ray
Copy link

Abhik-Ray commented Aug 17, 2023

It seems to be an issue with leaflet-draw rather than react-leaflet-draw, which is also an unmaintained package, although some people seem to have found a workaround for this particular bug here (#1026).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants