JS - Detect Touch device didnt work API 3
<p>I try to detect if the user device is a touch screen but when i do with <code>'ontouchstart' in window</code> condition dont work well.</p>

<p>I try to desable the dragg only for touch screen device <em>(I hope this is the better solution for a full width gmap in mobile for avoid the scroll bug in touch)</em></p>

<p>Can you help me to find the problem ? I've checked a lot of Starkoverflow subject but in dont find the good solution i'm blind maybe.</p>

<pre><code> function initMap() {
    var map;
    var bounds = new google.maps.LatLngBounds();

    if ('ontouchstart' in window){
    var isDraggable = !("ontouchend" in document);
    }
    else {
    var isDraggable = !('ontouchstart' in document.documentElement);
    }
    var mapOptions = {
        mapTypeId: 'roadmap',
        styles: WHITE,
        draggable: isDraggable,
        scrollwheel: false,
    };
</code></pre>

<p>Thanks for helping !</p>