public static function BuildLatAndLongCoordFromGeoObjects($objects, $latPropName, $lngPropName) {
        $coordinates = array();
        foreach ($objects as $object) {
            if (self::CheckCoordinateValue($object->$latPropName()) && self::CheckCoordinateValue($object->$lngPropName())) {
                $coordinate = array(
                    "lat" => $object->$latPropName(),
                    "lng" => $object->$lngPropName()
                );
                array_push($coordinates, $coordinate);
            }
        }
        return $coordinates;
    }
public static function BuildLatAndLongCoordFromGeoObjects($objects, $latPropName, $lngPropName) {
        $coordinates = array();
        foreach ($objects as $object) {
            if (self::CheckCoordinateValue($object->$latPropName()) && self::CheckCoordinateValue($object->$lngPropName())) {
                $coordinate = array(
                    "lat" => $object->$latPropName(),
                    "lng" => $object->$lngPropName()
                );
                array_push($coordinates, $coordinate);
            }
        }
        return $coordinates;
    }
public static function BuildLatAndLongCoordFromGeoObjects ( $ objects , $ latPropName , $ lngPropName ) { $ coordinates = array ( ) ; foreach ( $ objects as $ object ) { if ( self :: CheckCoordinateValue ( $ object -> $ latPropName ( ) ) && self :: CheckCoordinateValue ( $ object -> $ lngPropName ( ) ) ) { $ coordinate = array ( "lat" => $ object -> $ latPropName ( ) , "lng" => $ object -> $ lngPropName ( ) ) ; array_push ( $ coordinates , $ coordinate ) ; } } return $ coordinates ; }
Retrieve the lattitudes and longitudes from a list of objects
based the lattitude and longitude property names filter.

Build as an output an associative array in the Google Maps API format

@param array $objects
The array of objects of a given type

@param string $latPropName
The lattitude property name of a given object type

@param string $lngPropName
The longitude property name of a given object type

@return array $coordinates
The array in Google Maps API format
Retrieve the lattitudes and longitudes from a list of objects based the lattitude and longitude property names filter .