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

No popup when clicking on specific icons (BeautifyIcon plugin) #1948

Open
EmanuelCastanho opened this issue May 13, 2024 · 5 comments
Open
Labels
not our bug The bug cannot be fixed in folium but needs to be solved somewhere else plugin This issue/PR is about an existing or new plugin

Comments

@EmanuelCastanho
Copy link

Hi!

I was checking the BeautifyIcon plugin demo and I don't understand why when I click on the plane icon the popup doesn't show up.
Here is the example: https://python-visualization.github.io/folium/latest/user_guide/plugins/beautify_icon.html

Is this a font-awesome related problem?

@hansthen
Copy link
Collaborator

I can confirm the issue. In the browser console I see the following stack trace:

Uncaught TypeError: Cannot read properties of undefined (reading 'x')
    at p._add (Point.js:55:19)
    at p.add (Point.js:50:23)
    at e._updatePosition (DivOverlay.js:303:45)
    at e.update (DivOverlay.js:189:8)
    at e.onAdd (DivOverlay.js:113:8)
    at e.onAdd (Popup.js:135:30)
    at e._layerAdd (Layer.js:114:8)
    at e.whenReady (Map.js:1477:13)
    at e.addLayer (Layer.js:172:8)
    at e.openOn (DivOverlay.js:63:8)

@EmanuelCastanho
Copy link
Author

I think the problem is inside Point.js, here:

_add: function (point) {
    // destructive, used directly for performance in situations where it's safe to modify existing point
    this.x += point.x;
    this.y += point.y;
    return this;
},

At least according to the console.

@Conengmo Conengmo added bug An issue describing unexpected or malicious behaviour plugin This issue/PR is about an existing or new plugin labels May 18, 2024
@Conengmo Conengmo changed the title No popup when clicking on specific icons No popup when clicking on specific icons (BeautifyIcon plugin) May 18, 2024
@EmanuelCastanho
Copy link
Author

Any suggestions on how to solve this?

@Conengmo
Copy link
Member

This is likely an issue with the underlying Leaflet plugin we wrap around: https://github.com/masajid390/BeautifyMarker. Someone would have to go look at that library and see what the issue is. My theory would be that Leaflet updated something somewhere in the last few years that broke the behavior for this plugin.

@Conengmo Conengmo added not our bug The bug cannot be fixed in folium but needs to be solved somewhere else and removed bug An issue describing unexpected or malicious behaviour labels Jun 16, 2024
@thisisvk45
Copy link

The popup issue with the BeautifyIcon plugin demo is due to an undefined point in Point.js during the _add function call, likely caused by a Leaflet update that broke compatibility with the BeautifyMarker plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not our bug The bug cannot be fixed in folium but needs to be solved somewhere else plugin This issue/PR is about an existing or new plugin
Projects
None yet
Development

No branches or pull requests

4 participants