You are here

public function GmapMacroToolbox::getCoord in GMap Module 7.2

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

Return value

array former _gmap_str2coord($str)

File

lib/Drupal/gmap/GmapMacroToolbox.php, line 138
Contains GmapMacroToolbox.php

Class

GmapMacroToolbox

Namespace

Drupal\gmap

Code

public function getCoord() {

  // Explode along + axis.
  $arr = explode('+', $this->coordString);

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