public static function fromArray($native)
    {
        $keys = array(
            array(0, 1, 2),
            array('lat', 'lng', 'alt'),
            array('latitude', 'longitude', 'altitude'),
        );

        foreach ($keys as $key) {
            if (isset($native[$key[0]]) && isset($native[$key[1]])) {
                return new static(
                    $native[$key[0]],
                    $native[$key[1]],
                    empty($native[$key[2]]) ? null : $native[$key[2]]
                );
            }
        }

        throw new \InvalidArgumentException('LatLng format not supported');
    }
public static function fromArray($native)
    {
        $keys = array(
            array(0, 1, 2),
            array('lat', 'lng', 'alt'),
            array('latitude', 'longitude', 'altitude'),
        );

        foreach ($keys as $key) {
            if (isset($native[$key[0]]) && isset($native[$key[1]])) {
                return new static(
                    $native[$key[0]],
                    $native[$key[1]],
                    empty($native[$key[2]]) ? null : $native[$key[2]]
                );
            }
        }

        throw new \InvalidArgumentException('LatLng format not supported');
    }
public static function fromArray ( $ native ) { $ keys = array ( array ( 0 , 1 , 2 ) , array ( 'lat' , 'lng' , 'alt' ) , array ( 'latitude' , 'longitude' , 'altitude' ) , ) ; foreach ( $ keys as $ key ) { if ( isset ( $ native [ $ key [ 0 ] ] ) && isset ( $ native [ $ key [ 1 ] ] ) ) { return new static ( $ native [ $ key [ 0 ] ] , $ native [ $ key [ 1 ] ] , empty ( $ native [ $ key [ 2 ] ] ) ? null : $ native [ $ key [ 2 ] ] ) ; } } throw new \ InvalidArgumentException ( 'LatLng format not supported' ) ; }
Create LatLng from array.

@param array $native Native array.
Following keys are supported:
- Numeric keys 0-2
- Short names "lat", "lng", "alt"
- Long names "latitude", "longitude", "altitude".

@return LatLng
@throws \InvalidArgumentException If format is not supported.
Create LatLng from array .