Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    In this case you only should define a new attribute in the map’s creation, to prevent dragging the map. Please, follow the steps below:

    1. Open the cpm.js file, located in “/wp-content/plugins/codepeople-post-map/js/cpm.js”, with the text editor your choice.

    2. Go to the snippet of code:

    me.map = new google.maps.Map($(‘#’+me.id)[0], {
    zoom: me.data.zoom,
    center: m[c].latlng,
    mapTypeId: google.maps.MapTypeId[me.data.type],

    // Show / Hide controls
    panControl: me.data.zoompancontrol,
    scaleControl: me.data.scalecontrol,
    zoomControl: me.data.zoompancontrol,
    mapTypeControl: me.data.typecontrol,
    streetViewControl: me.data.streetviewcontrol,
    scrollwheel: me.data.mousewheel
    });

    and modify it like follow:

    me.map = new google.maps.Map($(‘#’+me.id)[0], {
    zoom: me.data.zoom,
    center: m[c].latlng,
    mapTypeId: google.maps.MapTypeId[me.data.type],
    draggable: false,
    // Show / Hide controls
    panControl: me.data.zoompancontrol,
    scaleControl: me.data.scalecontrol,
    zoomControl: me.data.zoompancontrol,
    mapTypeControl: me.data.typecontrol,
    streetViewControl: me.data.streetviewcontrol,
    scrollwheel: me.data.mousewheel
    });

    Note: Pay attention, I’ve only inserted the line of code: draggable:false,

    3. Finally, clear your browser’s cache, and try again.

    That’s all.
    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Disable Scrolling on Mobile’ is closed to new replies.