javascriptjvectormap

Is there anyway to link a jvector map to a search result?


So my requirement is that when user click on a specific country on a continent map(http://jvectormap.com/maps/world/south-america/), it needs to be redirect to a search result page with the items in related country. Can anyone help me to write the JS code?(Note: Im writting this custom JS for a shopify web)


Solution

  • You have to use the event listener onRegionClick

    onRegionClick: function (event, code) {
        window.location.href = "yourpage?regionCode=" + code
    }
    

    Replace with the page you use to search results by region code.