QGIS – How to Set Target URL for Each Feature in a Web Map

leafletqgisqgis2weburl

I have a QGIS map that displays the countries of Western Africa. My goal is to convert this map into interactive web map using QGIS2Web and Leaflet and provide the users the ability to click on a certain country, which will then take them to the target URL of that country. How can I achieve this goal? Below is a list of some of the Western African countries and their target URLs.

Nigeria: https://kaveh-ekbia.github.io/kaveh-ekbia.github.io-nigeria/#6/9.125/8.673

Mali: https://kaveh-ekbia.github.io/kaveh-ekbia.github.io-mali/#5/17.740/-3.997

Liberia: https://kaveh-ekbia.github.io/kaveh-ekbia.github.io-liberia/#7/6.458/-9.434

I know that in QGIS there is a feature called "Actions", however I am not sure if that will be helpful with my case.

The map I created contains two shapefiles. One displays the countries of Western Africa, while the other displays subdivisions within each of the countries. Below is a screenshot of my map.

Western africa QGIS map

Best Answer

This isn't the best way to achieve what you're trying to do, but atleast it will give users the ability to click on a link. Check step 5. of this guide.

It shows a way to have links and other markup show up, when hovering over a feature with the cursor.

Related Question