Current Location without a MAP?

Hoping somebody can help - I’m brand new to corona but loving it…

I am trying to get the user’s current address. And I see there’s an event for MapAddress that can provide this. However, I don’t want to display a map.

I also see that there’s a location event but it just provides the latitude and longitude.

So what is the best way to reverse geo code their location. Should I just use MapAddress and hide the map? [import]uid: 68228 topic_id: 25117 reply_id: 325117[/import]

I had the same issue, but worked around it (thanks to help of the IRC channel!) by “displaying” the map outside the user view.

So, all you (probably) need is to set your map coordinates outside the normal range.

So yeah, hiding the map outside the area is the best way to go, since the native mapview will always be on top of others. [import]uid: 106658 topic_id: 25117 reply_id: 102079[/import]

Thanks.

Funny part is that I actually realized I was thinking about it wrong anyway. I need the lat and lng data to be sent to the web service so that I can apply the distance formula in the SQL query to see which results to display.

This also requires all my addresses in my database to be geocoded already so I have lat and lng data for all of them pre-setup in columns. If anyone is curious, I found Yahoo’s PlaceFinder which allows 50,000 geocodes per day (to google’s 15,000). [import]uid: 68228 topic_id: 25117 reply_id: 102123[/import]

@chipallen2

I am definitely interested, where do I go to get PlaceFinder and how do you interface to it in Corona?

I too was looking at code to display the address one is at, like a checkin function in FB but have not had any luck here. I tried “nearestaddress” but it does not work for me. Any suggestions? [import]uid: 95689 topic_id: 25117 reply_id: 103357[/import]

You’d use PlaceFinder separately to geocode all your addresses in your web server’s database so they’re already populated with latitude and longitude values that you can call from your app.

Then you’d have to setup a php page on your web server and pass it a location. In the php page you would pull the list of nearby latitude and longitudes from the database and return those to the app (you can find example mysql or php formulas for this online).

Then just make the location call in your app then pass that location to the web service to get back the list of nearby addresses.

You could probably find a way to do this all in corona by calling google web services or some other method but it seems like pre-geocoding everything in advance is the smartest way to go. [import]uid: 68228 topic_id: 25117 reply_id: 104139[/import]