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

Conflict with "leaflet-topography": "Uncaught TypeError: invalid 'instanceof' operand L.MarkerCluster" #1064

Open
RobRover opened this issue May 25, 2022 · 1 comment

Comments

@RobRover
Copy link

Hope someone can help me: I'm getting an error using Laravel 9 and Vue 3.

Looks like a conflict with leaflet-topography even tough I'm not using it there, just importing it. When I comment app.js all works correctly. I tried to create a route "/#close" but did not work

Error chrome:
Uncaught TypeError: Right-hand side of 'instanceof' is not an object

Error firefox:
[Vue Router warn]: No match found for location with path "/#close"

Source map error: Error: request failed with status 404
Resource URL: http://localhost/js/app.js
Source Map URL: leaflet-src.js.map
Uncaught TypeError: invalid 'instanceof' operand L.MarkerCluster
    _animationZoomIn MarkerClusterGroup.js:1252
    eachLayer LayerGroup.js:122
    _animationZoomIn MarkerClusterGroup.js:1251
    _mergeSplitClusters MarkerClusterGroup.js:1061
    _zoomEnd MarkerClusterGroup.js:906
    fire Events.js:203
    _moveEnd Map.js:1246
    _onZoomTransitionEnd Map.js:1733
    setTimeout handler*_animateZoom Map.js:1712
    _tryAnimatedZoom Map.js:1677
    x Util.js:231
    _tryAnimatedZoom Map.js:1674
    setView Map.js:195
    setZoomAround Map.js:249
    _performZoom Map.ScrollWheelZoom.js:83
    setTimeout handler*_onWheelScroll Map.ScrollWheelZoom.js:57
    o DomEvent.js:108
    Ei DomEvent.js:123
    S DomEvent.js:34
    addHooks Map.ScrollWheelZoom.js:33
    enable Handler.js:23
    addHandler Map.js:731
    e Class.js:114
    callInitHooks Class.js:81
    initialize Map.js:156
    i Class.js:24
    map Map.js:1748
    <anonymous> (index):247
[MarkerClusterGroup](https://unpkg.com/[email protected]/src/MarkerClusterGroup.js)
@BrokenDuck
Copy link

BrokenDuck commented Nov 9, 2023

I don't think this has anything to do with leaflet-topography. During the execution data.layer instanceof L.MarkerCluster throws an error as L.MarkerCluster becomes undefined. This is due to it being removed from the L object during the code execution (see images). I don't know why this happens though.

Regular behavior:
image
Error behavior:
image

Using the build of this branch solved the issue for me.

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