Last active
August 29, 2015 14:25
-
-
Save dboutote/d0d8ccb08b2cb3d50002 to your computer and use it in GitHub Desktop.
Build a link to Google Maps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Build a link to Google Maps | |
* | |
* @since 1.0 | |
* | |
* @param string $lat the requested Latitude of the location. Required, default is empty. | |
* @param string $lng the requested Longitude of the location. Required, default is empty. | |
* @return mixed The url if successful. Empty otherwise. | |
*/ | |
function _get_google_map_url( $lat = '', $lng = '' ){ | |
if( !$lat || !$lng ){ | |
return ''; | |
} | |
$url = '//www.google.com/maps/dir//'.$lat.','.$lng.'/@'.$lat.','.$lng.',13z'; | |
return $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment