Skip to content

Commit

Permalink
added popup bind and unbind to fix the bug raised in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
GiuseppeGalilei committed Dec 5, 2023
1 parent 606afc3 commit e376b56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion folium/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ class GeoJson(Layer):
mouseout: function(e) {
if(typeof e.target.setStyle === "function"){
{%- if this.popup_keep_highlighted %}
if (!{{ this.get_name() }}.isPopupOpen())
if (!e.target.isPopupOpen())
{%- endif %}
{{ this.get_name() }}.resetStyle(e.target);
}
Expand All @@ -591,11 +591,13 @@ class GeoJson(Layer):
if(typeof e.target.setStyle === "function"){
const highlightStyle = {{ this.get_name() }}_highlighter(e.target.feature)
e.target.setStyle(highlightStyle);
e.target.bindPopup(e.popup)
}
},
popupclose: function(e) {
if(typeof e.target.setStyle === "function"){
{{ this.get_name() }}.resetStyle(e.target);
e.target.unbindPopup()
}
},
{%- endif %}
Expand Down

0 comments on commit e376b56

Please sign in to comment.