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>
11 use Friendica\Core\Hook;
12 use Friendica\Core\Logger;
14 function googlemaps_install()
16 Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
18 Logger::notice('installed googlemaps');
21 function googlemaps_location(&$item)
23 if (!(strlen($item['location']) || strlen($item['coord']))) {
27 if ($item['coord'] != '') {
28 $target = 'http://maps.google.com/?q=' . urlencode($item['coord']);
30 $target = 'http://maps.google.com/?q=' . urlencode($item['location']);
33 if ($item['location'] != '') {
34 $title = $item['location'];
36 $title = $item['coord'];
39 $item['html'] = '<a target="map" title="' . $title . '" href= "' . $target . '">' . $title . '</a>';