New home › Forums › Visitor Generated Markers › Turn off adding markers by right clicking (or touching map) and dragging
Tagged: VGM
- This topic has 4 replies, 2 voices, and was last updated 3 years, 3 months ago by Steven.
-
AuthorPosts
-
September 2, 2020 at 10:59 am #60709PieterParticipant
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.
September 2, 2020 at 12:00 pm #60710StevenModeratorHi 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 BeerSeptember 2, 2020 at 4:22 pm #60714PieterParticipantHi Steven,
Thanks so much for your reply. It solved the challenge!
Best regards,
PieterSeptember 2, 2020 at 7:59 pm #60716PieterParticipantHi 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
September 3, 2020 at 12:04 pm #60728StevenModeratorHi 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 BeerSeptember 4, 2020 at 12:09 am #60738PieterParticipantHi Steven,
It doesn’t seem to work. I am so sorry.
Pieter
September 4, 2020 at 12:09 am #60739PieterParticipantHi Steven,
It doesn’t seem to work. I am so sorry.
Pieter
September 4, 2020 at 8:34 am #60744StevenModeratorThis reply has been marked as private. -
AuthorPosts
- You must be logged in to reply to this topic.