Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Search for places using GPS
Started by rhmueed Oct 24 2013 12:57 PM

5 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

rhmueed

[GLOBAL: userInfoPane.html]
rhmueed
  • Enthusiast

  • 73 posts
  • Corona SDK

Hi,

I need some help realted to GPS through corona. What I want to do is to search nearby driving schools and then clculate the distance between the current location and the school. I have gone through the code how to calculate the user's current location and how to find distance between two points. But I need some help related to searching for nearby schools. Is it possible to search for nearby schools and then get their location through code?

 

Thanks



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

What do you have for your data?  Where are you getting the data?



[TOPIC: post.html]
#3

rhmueed

[GLOBAL: userInfoPane.html]
rhmueed
  • Enthusiast

  • 73 posts
  • Corona SDK

Hi Rob,

Thanks for reply. Actually I am new to working with GPS so please excuse me if my question seems a bit weird.

What I need to know that, is it possible to search for nearby schools through code. Like on Map if I write driving school in search box it will show me nearby driving schools and then I get their location. Now can it be done through code that App automatically finds driving schools near to user location and get their coordinates or I have to manually store data (like names and adresses) inside app for driving schools for some specific country and then we calculate the ditance between user's current location and nearby driving schools with the help of GPS. I hope I have made my point clear.

 

Thanks



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

I guess I didn't make my point clear.   You have to have a source of data that has the addresses of all the schools (and hopefully the latitude and longitude's).  Code can't make that up.  Where are you getting the data for the schools?  Once you have the data, the rest should be pretty easy to do.



[TOPIC: post.html]
#5

AlanPlantPot

[GLOBAL: userInfoPane.html]
AlanPlantPot
  • Contributor

  • 733 posts
  • Corona SDK

Is it possible to do something like this using Google Maps?  

 

Can you search for "driving schools near me" and have those results appear on a mapview?



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,042 posts
  • Enterprise

You have to have a list of driving schools near you with Latitude and Longitude and some simple math to figure it out.  You would iterate over your table of locations, and take your current lat/long returned by the GPS and use Pythagorean theorem to calculate the distance.  If it's less that a certain radius you show a pin point for it.

 

Rob




[topic_controls]
[/topic_controls]