Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
586 B

  1. <?php
  2. /**
  3. * Leaflet Map related functions
  4. */
  5. function generate_map($coord) {
  6. $coord = trim($coord);
  7. $coord = str_replace(array(',','/',' '),array(' ',' ',' '),$coord);
  8. $arr = array('lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => '');
  9. call_hooks('generate_map',$arr);
  10. return (($arr['html']) ? $arr['html'] : $coord);
  11. }
  12. function generate_named_map($location) {
  13. $arr = array('location' => $location, 'html' => '');
  14. call_hooks('generate_named_map',$arr);
  15. return (($arr['html']) ? $arr['html'] : $location);
  16. }