markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

Not getting click event on Tablet #207

Closed harjitdotsingh closed 8 years ago

harjitdotsingh commented 9 years ago

Hi there,

I have the following piece of code

map = new Datamap({ scope: 'usa', responsive: true, geographyConfig: { highlightOnHover: false, borderColor: 'orange' }, element: document.getElementById('map'), done: function (datamap) {

            FPOC.INIT.handleMapClick(datamap)

        }

    })

I don't get any clicks when touching a map area on a tablet ? Any clues why ?

justmarkup commented 9 years ago

@harjitdotsingh What does the function FPOC.INIT.handleMapClick(datamap) do?

Just tested with

done: function(datamap) {
    datamap.svg.selectAll('.datamaps-subunit').on('click', function(geography) {
        alert(geography.properties.name);
    });
},

on an iPad and an Android Device (Nexus 7) and it worked as expected.