Skip to content

Commit

Permalink
Ignore warnings (#98)
Browse files Browse the repository at this point in the history
* Dynamically update zoom and center

* Add ability to dynamically add additional features via a FeatureGroup

* Fix event handling

* Add dynamic loading example

* Update notes in st_folium

* Remove beta

* Bump version

* Add another example specifically to highlight the difference

* Ignore evals

* Dynamically update zoom and center

* Merge conflicts

* Remove one eval, add comment around the other
  • Loading branch information
blackary authored Dec 8, 2022
1 parent 376aa0c commit bc45005
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion streamlit_folium/frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,14 @@ function onRender(event: Event): void {
feature_group !== window.__GLOBAL_DATA__.last_feature_group
) {
if (window.feature_group) {
eval("window.map.removeLayer(window.feature_group)")
window.map.removeLayer(window.feature_group)
}
// Though using `eval` is generally a bad idea, we're using it here
// because we're evaluating code that we've generated ourselves on the
// Python side. This is safe because we're not evaluating user input, so this
// couldn't be used to execute arbitrary code.

// eslint-disable-next-line
eval(feature_group)
window.__GLOBAL_DATA__.last_feature_group = feature_group
for (let key in window.map._layers) {
Expand Down

0 comments on commit bc45005

Please sign in to comment.