I'm developing a responsive website and using the Google Maps API to generate the company's location map.
I would like when the user was accessing the site by a mobile device and clicking on the map or even a link, was redirected to the Google Maps application and passed the route, so he would not have to type the address and search.
var myCenter = new google.maps.LatLng(-7.0995734, -34.8410316);
function initialize()
{
var mapProp = {
center: myCenter,
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
var marker = new google.maps.Marker({
position: myCenter,
});
marker.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);