D3 map – How do I include SVG image files in JSON data to create custom location markers?

I’m trying to figure out how to include svg icon images in with my json data so the relevant icon will appear as a marker at the corresponding coordinates. I’ve got the data in files separated by what shape of object was sighted (I’m mapping ufo sightings through the 20th century), and I created an svg image file for each shape as well. I’m not sure what the best way is to connect the images to the data though. (I’m a relative beginner). here’s a visual to help explain what I mean: { “date”: “10/21/1989”, “shape”: “Triangle”, “latitude”: -41.05446, “longitude”: -130.72728, “color”: “violet” }, then I’ve got a corresponding ‘Triangle.svg’ icon in an ‘icons’ folder. I’m sure the solution is not a complicated one, I’m just not seeing it. Can anyone help?

Read More…
D3 map – How do I include SVG image files in JSON data to create custom location markers?

Updated: July 25, 2021 — 10:26 pm