Looking for a resource / tutorial on how to add interactive maps on website.

I am trying to add a section where if u click on a country, the map interacts, however with a simple png, i cant do much, where can i find svg or interactive maps for free to add it in my website? Something like in the image beside. Or maybe when I hover over a country name, the country should highlight.
No description
No description
14 Replies
Jono Lewarne
Jono Lewarne2mo ago
Leaflet.js is really easy to use and has lots of tutorials available. I had never used it before and had a working map with interactive popups working within an hour. If you get stuck ChatGPT knows it really well so you can ask it for help
Zeshan Merchant
Zeshan Merchant2mo ago
Thanks mate So far its good and easy to use. Also theres a lot of control. I hope I achieve what I am looking for. Thanks once again. Either way I am enjoying it as its my first time adding map to a website
Jono Lewarne
Jono Lewarne2mo ago
I found it to be really nice to work with and you’re able to get something so slick that works really well on mobile straight out of the box. Don’t forget to donate if you’re able to, as the dev behind it has put a huge amount of work into it
Zeshan Merchant
Zeshan Merchant2mo ago
Sure man, will keep this in mind
clevermissfox
clevermissfox2mo ago
You can also use image maps with your png but I'm sure there's much easier tools these days
Zeshan Merchant
Zeshan Merchant2mo ago
thats what i was doing, but resizing is tough, because then i have to resize all the points/markers and adjust their position as well
clevermissfox
clevermissfox2mo ago
Yeah it's a chore , just wanted to make sure you were aware of the option
Chris Bolson
Chris Bolson2mo ago
You could also use an SVG with all the regions/countries defined as separate paths
Zeshan Merchant
Zeshan Merchant2mo ago
thought of this, where can i find one such svg though?
clevermissfox
clevermissfox2mo ago
Or use and image trace on your png and adjust As needed
Chris Bolson
Chris Bolson2mo ago
A map I did for to help somebody else a few months ago. This uses an SVG and links the continents with their buttons using :has(); https://codepen.io/cbolson/pen/MWRLoWb
Zeshan Merchant
Zeshan Merchant2mo ago
Well thanks for your suggestions @clevermissfox @Chris . I got what I was looking for using leaflet @Jono Lewarne thanks once again
Zeshan Merchant
Zeshan Merchant2mo ago
Want results from more Discord servers?
Add your server