New home › Forums › Pro Add-on › General queries › Force Safari to Open in Google Maps
Tagged: Apple Maps, Google Maps, iOS
- This topic has 5 replies, 2 voices, and was last updated 3 years, 2 months ago by Perry.
-
AuthorPosts
-
October 31, 2017 at 1:21 pm #31766[email protected]Member
I notice that in IOS on Iphone it opens Apple Maps when GetDirections is clicked, and not Google Maps. The biggest problem is then that the “from” input field is empty and cannot be populated automatically. It is generally accepted where I live that Apple Maps is a 100% sure way to get lost never to be seen by human kind again. Is there a way to force WPGMaps to open in Google maps on IOS device? It works 100% on Android.
Thx
Armand
- This topic was modified 3 years, 2 months ago by [email protected].
October 31, 2017 at 3:53 pm #31772PerryModeratorHi Armand,
Thanks for reporting this, “lost never to be seen” did make me laugh!
I’ll add an option to force this in future releases, in the mean time, would you be comfortable editing some Javascript yourself? If you’re not familiar with the language, could you give me login details for the site so I can force it manually?
Kind regards
– PerryNovember 1, 2017 at 7:15 am #31787[email protected]MemberThanks Perry
I am comfortable with Javascript, so I would be happy if you could give me pointers on how to do it.
Regards
Armand
November 1, 2017 at 10:12 am #31792PerryModeratorHi Armand,
Please open /wp-google-maps-pro/js/core.js and do a search for “apple”. This will take you to the relevant block.
Please delete or comment out if/else block leaving the window.open(“http://maps.google …
Let me know if that works for you?
Kind regards
– PerryNovember 1, 2017 at 3:01 pm #31803[email protected]MemberPerry
It works perfect thanks
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
window.open(“http://maps.google.com/maps?daddr=”+latLong+”&ll=”);
} else {jQuery(“#wpgmaps_directions_edit_”+wpgmzamid).show();
jQuery(“#wpgmaps_directions_editbox_”+wpgmzamid).show();
jQuery(“#wpgmza_input_to_”+wpgmzamid).val(end.length > 0 ? end : latLong);
jQuery(“#wpgmza_input_from_”+wpgmzamid).focus().select();
}Thanks for the great support.
Regards
Armand
November 6, 2017 at 2:08 pm #31903PerryModeratorThis reply has been marked as private. -
AuthorPosts
- You must be logged in to reply to this topic.