question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Usage of popup with a string value

See original GitHub issue

This is my code sample;

import folium
import pandas

data = pandas.read_csv("volcanoes.txt")

lat = list(data["LAT"])
longt = list(data["LON"])
names = list(data["NAME"])

map = folium.Map(location=[38.58, -99.09], zoom_start=6, tiles="Mapbox Bright")

fg = folium.FeatureGroup(name="My Map")

for lt, ln, name in zip(lat, longt, names):
    **fg.add_child(folium.Marker(location=[lt, ln], popup=str(name), icon=folium.Icon(color='green')))**

map.add_child(fg)

map.save("Map4.html")

python

Problem description

I have a code sample like that but in popup if I assing like popup=‘Sample’ it runs, but if I assign popup=str(name) like in my sample code(line 15) it doesn’t run.

How Should I use that with a string?

Thank you

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ocefpafcommented, Feb 5, 2018

If you have special characters in your popup text you must parse it as HTML. See http://nbviewer.jupyter.org/gist/ocefpaf/76f228951d264d0e4dcb091f9e7435fa

0reactions
paulochfcommented, Feb 5, 2018

I would prefer to remove the chars, so one can use HTML with it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to pass string values from base popup page to ... - MSDN
I am trying to assign a string value to the lable which is there in the parent page from popup page. I have...
Read more >
Adding A popup in javascript when a string is a specific value
For this code here I am trying to add a pop up window When masterChemRow.chemicalName.equals("Unknown" || "unknown") I want an alert to pop...
Read more >
Getting value of selected string in Popup menu.
I am trying to make a GUI. Depending on the option selected in popup menu 3 the selected operation should be performed on...
Read more >
pop-up-string-dialog
Displays a modal dialog that prompts for one modifiable string. Returns three values. The first is the modified string, the second is nil...
Read more >
Message Popup Step
Use a Message Popup step to display messages to the user and to receive response strings from the user. For example, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found