/** * * Creates EGMapCoords (bounds) from a string representation * of Lat,Lon values * @param string $string ((48.82415805606007,%202.308330535888672),%20(48.867086142850226,%202.376995086669922)) */ public static function createFromString($string) { preg_match('/\\(\\((.*?)\\), \\((.*?)\\)\\)/', $string, $matches); if (count($matches) == 3) { $sw = EGMapCoord::createFromString($matches[1]); $ne = EGMapCoord::createFromString($matches[2]); if (!is_null($sw) && !is_null($ne)) { return new EGMapBounds($sw, $ne); } return null; } }