Su sekilde bir degisiklik yapip denedim;
public function index()
{
$address = \DB::table('allestates')
->get();
foreach($address as $addr) {
try {
$location = Mapper::location($addr->address)->map();
Mapper::marker($location->getLatitude(), $location->getLongitude());
} catch (MapperSearchResultException $e) {
$notFound[] = $addr->address;
}
}
return view('welcome');
}
Isaret ettiginiz satirdan kurtulup "map" asagi gonderdim.
fakat bu sefer su sekilde bir argument hatasi aldim:
"Call to undefined method Cornford\Googlmapper\Mapper::getLatitude()"
Bu arada acaba DB table'da adreslerin bulundugu column'u isaret etmedigim icin mi sorun oluyor diyerek, bu sekilde de denedim:
public function index()
{
$address = \DB::table('allestates')
->where('address')
->get();
$notFound = [];
foreach($address as $addr) {
try {
$location = Mapper::location($addr->address)->map();
Mapper::marker($location->getLatitude(), $location->getLongitude());
} catch (MapperSearchResultException $e) {
$notFound[] = $addr->address;
}
}
return view('welcome');
}
yalniz bu kez hic bir sey olmamis gibi sayfa hatasiz bir ve haritasiz bir sekilde geliyor...
Edit: ek olarak getlatitute hatasi yuzunden Mapper::marker'i kullanmayarak(silip) denedim.
bu sekilde direk olarak beni daha onceki hataya yonlendiriyor.
Cornford \ Googlmapper \ Exceptions \ MapperSearchResultException
No results found for the location search.
ama herhalde marker:: hatasi en basta haritayi bulamamasi yuzunden kaynaklaniyordur, diye dusunuyorum.
nihayetinde sorun DB'den adresleri cekip gosterememek.