Turn off adding markers by right clicking (or touching map) and dragging

New home Forums Visitor Generated Markers Turn off adding markers by right clicking (or touching map) and dragging

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #60709
    Pieter
    Participant

    Is it possible to turn off adding markers by right clicking (or touching map) and dragging? I would really like to turn it off on the map so users can only add markers by filling out the form.

    #60710
    Steven
    Moderator

    Hi Pieter,

    Thank you so much for getting in touch, we really appreciate your time.

    Could I kindly ask you to copy the below custom script:

    jQuery(document.body).on(‘init.wpgmza’, function(e){
    google.maps.event.clearListeners(WPGMZA.maps[0].googleMap, ‘click’);
    });

    Please then navigate to -> Maps -> Settings -> Advanced -> Please paste this into the Custom JS field and click save.

    Please then confirm once complete if this helps?

    Kindest Regards,
    Steven De Beer

    #60714
    Pieter
    Participant

    Hi Steven,
    Thanks so much for your reply. It solved the challenge!
    Best regards,
    Pieter

    #60716
    Pieter
    Participant

    Hi Steven,

    It doesn’t seem to work for mobile/ touch unfortunately. I’d love to know how I could turn that off and only let them do that via the location field in the form. At first touch on the map it still drops a pin, that’s not user friendly in my case.

    Many thanks!

    Pieter

    #60728
    Steven
    Moderator

    Hi Pieter,

    Thank you so much for getting back to me.

    It seems mobile uses a different event to register the click so if I could kindly ask you to add the following in addition to the previous provided? This should help with mobile, however, I cannot directly test this until it’s been added and saved.

    jQuery(document.body).on(‘init.wpgmza’, function(e){
    google.maps.event.clearListeners(WPGMZA.maps[0].googleMap, ‘ontouchstart’);
    });

    Please confirm once complete?

    I look forward to hearing back from you.

    Kindest Regards,
    Steven De Beer

    #60738
    Pieter
    Participant

    Hi Steven,

    It doesn’t seem to work. I am so sorry.

    Pieter

    #60739
    Pieter
    Participant

    Hi Steven,

    It doesn’t seem to work. I am so sorry.

    Pieter

    #60744
    Steven
    Moderator
    This reply has been marked as private.
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.