}
-// gets coordinates and returns an array of coordinate pairs, e.g.
+// gets coordinates and returns an array of lon/lat coordinate pairs, e.g.
// 47.12 N 11.87 E
// 47.13 N 11.70 E
// ->
-// array(array(47.12, 11.87), array(47.13, 11.70))
+// array(array(11.87, 47.12), array(11.70, 47.13))
function geo_to_coordinates($input) {
$matches = array();
$num_matches = preg_match_all('/(\d+\.?\d*)\s*N?\s+(\d+\.?\d*)\s*E?\s*/', $input, $matches);
$result = array();
for ($i=0; $i!=$num_matches; ++$i) {
- $result[] = array(floatval($matches[1][$i]), floatval($matches[2][$i]));
+ $result[] = array(floatval($matches[2][$i]), floatval($matches[1][$i]));
}
return $result;
}
return $output;
}
-
}
+
// <wrmap> tag
class WrMap extends WrBaseMap {
}