New home › Forums › Pro Add-on › Different settings for responsive interaction
Tagged: clickable markers, hover, markers, responsive
- This topic has 9 replies, 2 voices, and was last updated 5 years, 5 months ago by SupportTeam.
-
AuthorPosts
-
April 11, 2018 at 9:42 am #36530MajseMember
Hi!
For desktop I would really like to use hover on the markers. But for mobile and tablet I would like the markers to be clickable. Is there a way to do this?
Best regards
April 11, 2018 at 10:33 am #36532SupportTeamModeratorHi there,
Thank you for getting in touch with us.
If you enable hover state under Maps → Settings → InfoWindows → “Open Markere InfoWidnows by” option you should open your markers on hover. On mobile devices markers will open when you touch marker. Is this what you want?
Thank you for your time in this.
Best regards,
JarekApril 11, 2018 at 10:48 am #36539MajseMemberHi Jarek,
Thank you for the quick response. I have now set it for hover, but for some reason it won’t work on any mobile devices. You can’t click on them.
Best regards
April 11, 2018 at 11:07 am #36540SupportTeamModeratorHi there,
May I ask you to send me a temporary login details to your WordPress admin dashboard so I can login and look further into this for you? Please mark your reply as private to protect your data.
Kind regards
April 11, 2018 at 11:18 am #36543MajseMemberThis reply has been marked as private.April 11, 2018 at 12:09 pm #36553SupportTeamModeratorHi there,
I installed small plugin: Simple Custom CSS & JS and created JS code:
(function($) { function bindClickListener(marker, id) { marker.addListener("click", function() { google.maps.event.trigger(marker, "mouseover"); }); } if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { setTimeout(function() { $(window).on("load", function(event) { for(var marker_id in marker_array[1]) { bindClickListener(marker_array[1][marker_id], marker_id); } }); }, 500); } })(jQuery);
to force opening info window on click on mobile devices. Please note that this would only work for map with ID: 1. If you would like to add it to other maps we need to add more code.
Please test it and let me know if it works.
Best
April 11, 2018 at 1:07 pm #36562MajseMemberHi Jarek,
In order to customize the map for responsive interactions, I created four identical, yet seperate maps. Therefore I have three ID’s.
Best regards
Attachments:
You must be logged in to view attached files.April 11, 2018 at 1:39 pm #36565SupportTeamModeratorHi there,
I modified script a bit so it should work with other maps.
Kind regards
April 11, 2018 at 3:57 pm #36585MajseMemberBeautiful work. Thank you!
Best regards
April 11, 2018 at 4:27 pm #36590SupportTeamModeratorThank you for your kind words. I appreciate it 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.