1
1
Fork 0
friendica_2019-12_sharedHos.../src/Util/Map.php
Adam Magness 11cf36105c Update Addon functions and calls
Update function names and calls for Addon class.
2018-01-20 07:48:22 -05:00

27 lines
706 B
PHP

<?php
/**
* @file src/Util/Map.php
*/
namespace Friendica\Util;
use Friendica\Core\Addon;
/**
* Leaflet Map related functions
*/
class Map {
public static function byCoordinates($coord) {
$coord = trim($coord);
$coord = str_replace([',','/',' '],[' ',' ',' '],$coord);
$arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => ''];
Addon::callHooks('generate_map',$arr);
return ($arr['html']) ? $arr['html'] : $coord;
}
public static function byLocation($location) {
$arr = ['location' => $location, 'html' => ''];
Addon::callHooks('generate_named_map',$arr);
return ($arr['html']) ? $arr['html'] : $location;
}
}