You are here

function _gmap_str2coord in GMap Module 6.2

Same name and namespace in other branches
  1. 5 gmap_parse_macro.inc \_gmap_str2coord()
  2. 6 gmap_parse_macro.inc \_gmap_str2coord()
  3. 7.2 gmap_parse_macro.inc \_gmap_str2coord()
  4. 7 gmap_parse_macro.inc \_gmap_str2coord()

Parse "x.xxxxx , y.yyyyyy (+ x.xxxxx, y.yyyyy ...)" into an array of points. @internal

1 call to _gmap_str2coord()
_gmap_parse_macro in ./gmap_parse_macro.inc

File

./gmap_parse_macro.inc, line 48
GMap macro parsing routines.

Code

function _gmap_str2coord($str) {

  // Explode along + axis
  $arr = explode('+', $str);

  // Explode along , axis
  $points = array();
  foreach ($arr as $pt) {
    list($lat, $lon) = explode(',', $pt);
    $points[] = array(
      (double) trim($lat),
      (double) trim($lon),
    );
  }
  return $points;
}