I wanted to include html in popup="some text here", I have found that by default the folium module would escape all html syntax, so that it would display the actual syntax in the browser rather than processing it, so for example
'<' will becomes '&-l-t-;' without the dashes
I do not understand java whatsoever, so what I have done is: after the 'map.html' file is generated, I'd run another script to change the escape back into html syntax, this is dirty, the code is super bad, but its working for what I wanted to do.
def writeHTML(inputfile, outputfile):
readfile_first = open(inputfile,'r')
writefile_first = open(outputfile, 'w')
for line in readfile_first:
writefile_first.write(line.replace('<','<'))
readfile_first.close()
writefile_first.close()
readfile_second = open(outputfile, 'r')
writefile_second = open(inputfile, 'w')
for line in readfile_second:
writefile_second.write(line.replace('"','"'))
readfile_second.close()
writefile_second.close()
readfile_third = open(inputfile, 'r')
writefile_third = open(outputfile, 'w')
for line in readfile_third:
writefile_third.write(line.replace('>','>'))
readfile_third.close()
writefile_third.close()