Closed wailashraf71 closed 3 years ago
I'm trying this example:
$response = (new \GoogleMaps\GoogleMaps)->load('directions') ->setParam([ 'origin' => 'place_id:ChIJ685WIFYViEgRHlHvBbiD5nE', 'destination' => 'place_id:ChIJA01I-8YVhkgRGJb0fW4UX7Y', ])->containsLocation(55.86483, -4.25161); return dd($response); //
But getting this error on laravel
### ErrorException count(): Parameter must be an array or an object that implements Countable vendor\alexpechkarev\geometry-library\PolyUtil.php:99 tan($lat3) >= self::tanLatGC($lat1, $lat2, $lng2, $lng3) : MathUtil::mercator($lat3) >= self::mercatorLatRhumb($lat1, $lat2, $lng2, $lng3); } public static function containsLocation($point, $polygon, $geodesic = false) { **$size = count( $polygon );** if ($size == 0) { return false; }
How are you calculating a polygon with only an origin and a destination?
I'm trying this example:
But getting this error on laravel