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.

Binding SVG to map

See original GitHub issue

Short question Is there a way to bind a SVG-image to particular coordinates on the map?

Description I’m working on a small project using Folium. And I have a problem. I have a SVG-image something like:

import pygal

b_chart = pygal.Bar(show_legend=False)
b_chart.title = "Destiny Kill/Death Ratio"
b_chart.add("Dijiphos", [0.94])
b_chart.add("Punisherdonk", [1.05])
b_chart.add("Musclemuffins20", [1.10])

svg_image = b_chart.render()

Is there a way to bind such image to particular coordinates on the map?

The only thing I found is how to insert it into a popup like this:

iframe = folium.IFrame(html=svg_image)
popup = folium.Popup(iframe)

It works but it’s not exactly what I need. I also tried something like this:

folium.map.Marker(
    [0,0],
    icon=DivIcon(
        html=svg_image,
        )
    ).add_to(m)

But it obviously did not work.

Output of folium.__version__

0.7.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
OneAddercommented, May 13, 2019

Okay, thanks, I’ll make a PR tomorrow

1reaction
OneAddercommented, May 13, 2019

Thanks 😃 Sorry for the late response (I really need to configure notifications). I’ll think of some non-linguistic example and make a notebook (probably tomorrow).
But where exactly do I need to send it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

d3.js- noob- how to bind data to path from external svg by path ...
I'm attempting to make a chloropleth map using an SVG file of the counties and ... //Bind data and create one path per...
Read more >
How to publish a map with your SVG markers in Web GIS
There are two ways to bind SVG markers to layer objects so that they are not lost when you publish your project to...
Read more >
SVG Maps With HTML, JavaScript and Svelte - Strani Anelli
I can, for example, create an input element of type range , by binding its value to the scale variable. <script>.
Read more >
IMPORT SVG MAP WITH TEXT - Visualizations & Dashboards
Hi, I created SVG Map for mall and import to Dundas BI and defined shapes works perfectly fine. Now I required to import...
Read more >
B JavaScript Functions for SVG Maps - Oracle Help Center
This API contains predefined functions that can be called from outside the SVG map, typically from the HTML document in which the SVG...
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