Prevent maps from being draggable on iphone
This topic contains 16 replies, has 4 voices, and was last updated by jack3 10 years, 5 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: Maps iphone draggable
-
AuthorPosts
-
February 3, 2015 at 9:12 am #29654
Hi all,
We try to prevent the map on the homescreen from hijacking ipad an smartphone-users.
Google advices to set the option draggable on False, but we cant find the right spot in de code or database to change this.
-Does anyone have a solution to solve this?
Thanks in advance!
February 3, 2015 at 9:14 am #29656Hi, u kinda need them to be dragable or they will be useless…? What exactly is the problem?
Stiofan
February 3, 2015 at 9:22 am #29660Hi Stiofan,
Try to visit http://www.iamyogi.nl with a mobile device. You’ll experience that its very annoying for a user to scroll to the bottom of the page, because you naturally place your thumb ON the map. So instead of scrolling a page, you scroll the map.We understand that we have to make a difference for mobile vs computer-visitors, but given the fact that almost half of the dutch internetusage is being generated from mobile devices we have to change this.
But the relevant code for it seems invissible;-) any advice on the correct file?Thanks again
February 3, 2015 at 10:35 am #29665OK, there are several solutions, if you have the latest GD then u can go into the map widget settings and set the height to “50vh” this will set the height of the map to 50% of the visual height of the browser window, this will mean users can use the map and also scroll past it (u can set the height to “70vh” being 70% of the height, etc…)
You could also hide the map with CSS for mobile but i don’t know of a solution for making it basically “broken” for mobile where it does not scroll..
Thanks,
Stiofan
February 3, 2015 at 10:54 am #29670Hi Stiofan,
Thanks!
our developer wants to try something out in a separate development-environment, but he cannot find the right spot for the relevant files. Can you tell where we can find it?February 3, 2015 at 11:32 am #29678Did u try my solution?
Files for what?
February 3, 2015 at 12:11 pm #29693Well, we prefer to let users be dumb, so creating an area where they can scroll is not really nice, because it creates human errors and thus irritations…
We are looking for the specific file where the behaviour of the google-maps is managed. There should be one, but we cannot find it. Am i clear enough, or too vague?
February 3, 2015 at 1:09 pm #29703Yes still to vague, what setting in google maps are u trying to change?
Stiofan
February 3, 2015 at 7:36 pm #29785Hi Stiofan,
this is what we have found:
https://developers.google.com/maps/documentation/javascript/referenceIf you look at it, somewhere in the end (in a table called PROPERTIES) you see that Google offers a way to prevent the map from being dragged. We think that this would be by far the best way to prevent users on smartphones (AND ipads) to get insane.
Our theory is that somewhere in a wp-geodirectory-related file we should add some lines of code to try whether it really works as we like.
But: where? Which file is related to the behavior of the google map on the homepage?
We searched and searched, with no happy ending yet, and we hope that it’s just a simple question…February 3, 2015 at 7:45 pm #29788The map in home page is a widget and can be found in :
geodirectory-widgets/home_map_widget.php
Starting from there your developer can recreate a new widget (possibly in a child theme) that behaves exactly as you wish.
Thanks
February 3, 2015 at 8:15 pm #29801Thanks we will try it!
February 4, 2015 at 4:15 pm #29976This reply has been marked as private.February 4, 2015 at 4:24 pm #29979ok thanks for the suggestion, i have added this to our PM and it will be looked at when we are optimising maps, but there is no set date for when this will happen yet.
Thanks,
Stiofan
February 10, 2015 at 5:16 pm #30574This has been added to core and will be in the next ver.
Thanks,
Stiofan
February 10, 2015 at 6:36 pm #30592Super!!!
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket