Locate nearby restaurants registered in the database through google maps

Asked

Viewed 1,165 times

5

I could use some help. I have a PHP system with a mysql database with several registered restaurants, with fields such as: id, name, address, longitude and latitude and I am creating an application with Ionic using Angularjs.

In this application I needed to make the user when placing the address in which he is (through the google maps api), appear the restaurants registered in the database closest to the user’s address, listed by proximity.

Does anyone know any tutorial or logic on how to make this application?

For example: it is possible through the google maps api to make an application like this: http://www.starbucks.com/store-locator/search/?

  • I think you better develop with native code, java, xml, google maps API key and etc.

  • A tip, you can use the language and structure you want! To search, send the current location to php server, in it do the calculation of havesine (Search here in stackoverflow even, have great answers! ) After a die(json_encode($variavel))

  • All frotend languages, mobile or not, work very well with json to render content

1 answer

1

First you have to use the Cordova to catch the longitude and the latitude of the cell , via GPS, if it is to type there becomes easier , with this data you increase how many kms you want, extending the longitude and the latitude, making a radius of how many kms need. To calculate you have this one https://gist.github.com/rafaellyra/5180762

Browser other questions tagged

You are not signed in. Login or sign up in order to post.