4 * Description: Use Google Maps for displaying locations. After activation the post location just beneath your avatar in your posts will link to Google Maps.
6 * Author: Michael Vogel <https://pirati.ca/profile/heluecht>
9 use Friendica\Core\Hook;
10 use Friendica\Core\Logger;
12 function googlemaps_install()
14 Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
16 Logger::log("installed googlemaps");
19 function googlemaps_location($a, &$item)
22 if(! (strlen($item['location']) || strlen($item['coord']))) {
26 if ($item['coord'] != ""){
27 $target = "http://maps.google.com/?q=".urlencode($item['coord']);
29 $target = "http://maps.google.com/?q=".urlencode($item['location']);
32 if ($item['location'] != "") {
33 $title = $item['location'];
35 $title = $item['coord'];
38 $item['html'] = '<a target="map" title="'.$title.'" href= "'.$target.'">'.$title.'</a>';