farhanwazir / laravelgooglemaps

Laravel Google Maps Package
MIT License
152 stars 112 forks source link

"Undefined offset: 1" #41

Open davidivab opened 4 years ago

davidivab commented 4 years ago

Hi Farhan Wazir, this package works fine, I love it, thanks a lot.

I have one problem to isMarkerInsideGeofence in laravel, my code is

$polygon = array('25.774,-80.190', '18.466,-66.118', '32.321,-64.757', '25.774,-80.190'); $latlngs = array('-12.043333,-77.028333', '-12.043333,-77.028333'); $mapStatus = GMaps::isMarkerInsideGeofence($polygon, $latlngs);

and Laravel response is private function pointStringToCoordinates($pointString) { if(strpos($pointString, ", ") !== false) $coordinates = explode(", ", $pointString); elseif(strpos($pointString, ",") !== false) $coordinates = explode(", ", $pointString); else $coordinates = explode(" ", $pointString); return array("x" => $coordinates[0], "y" => $coordinates[1]); }

"Undefined offset: 1"

Captura de Pantalla 2019-11-09 a la(s) 5 44 15 p  m

Do you have any ideas?