mirror of
https://github.com/friendica/friendica
synced 2025-01-22 16:19:46 +00:00
The Map class is now done
This commit is contained in:
parent
ea10a7c002
commit
5a0260a10f
1 changed files with 18 additions and 12 deletions
|
@ -1,18 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @file src/Util/Map.php
|
||||||
|
*/
|
||||||
|
namespace Friendica\Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Leaflet Map related functions
|
* Leaflet Map related functions
|
||||||
*/
|
*/
|
||||||
|
class Map {
|
||||||
function generate_map($coord) {
|
public static function byCoordinates($coord) {
|
||||||
$coord = trim($coord);
|
$coord = trim($coord);
|
||||||
$coord = str_replace(array(',','/',' '),array(' ',' ',' '),$coord);
|
$coord = str_replace(array(',','/',' '),array(' ',' ',' '),$coord);
|
||||||
$arr = array('lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => '');
|
$arr = array('lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => '');
|
||||||
call_hooks('generate_map',$arr);
|
call_hooks('generate_map',$arr);
|
||||||
return (($arr['html']) ? $arr['html'] : $coord);
|
return ($arr['html']) ? $arr['html'] : $coord;
|
||||||
}
|
}
|
||||||
function generate_named_map($location) {
|
|
||||||
|
public static function byLocation($location) {
|
||||||
$arr = array('location' => $location, 'html' => '');
|
$arr = array('location' => $location, 'html' => '');
|
||||||
call_hooks('generate_named_map',$arr);
|
call_hooks('generate_named_map',$arr);
|
||||||
return (($arr['html']) ? $arr['html'] : $location);
|
return ($arr['html']) ? $arr['html'] : $location;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue