How to find users using your app at a certain distance from your location? - windows-phone-8.1

If I have the latitude and longitude of my location how can I find other users using my app at a certain distance say 5 km from my location?
What I am trying to implement is that if a user sends a request, it goes to the people using the app at a range of supposing x km from the user.
Please suggest methods to accomplish this, approach,libraries and so on.

Related

How to show the approximate location from the end user location to store?

I have store pickup addresses and google API key. Now want to show the distance between user location and pickup address in miles.
First, how to get user current location and how to show the distance between user location and pickup address?
Could anyone please help me with this?
You can get the user's location by using the Geolocation feature of HTML 5. The Geolocation feature will return coordinaters (LatLng) which you can use as one of the origin parameters for your Distance Matrix API request, with the store locations being the destination parameter.

Finding Distance in KM

Hello I have a laravel and android app. Latitudes and Longitudes are posted from the android app to the server.
Now I am supposed to find the distance in km between two points given that the latitudes and longitudes for both location have been provided.
I tried to google it and found this: mjaschen/phpgeo which seems to be able to do that.
However a modification has been now made to our system where I have been asked to find the distance between those two locations by road, e.g. route length.
I have been told that this is possible with google maps. However I am not aware of any google map package or api for php/laravel.
Is there a google map package that can help me do this and is this even possible? If yes then how would I go about implementing this?
Summary: Finding the distance by road between two locations in kilometers assuming coordinates have been supplied for each of those locations.

Google Map API for addesses search

I have been searching for some information on what I want to achieve but not getting any clear answers.
I have a database with thousands of addresses. I want that when the user searches by entering a postcode, the search should show all the available addresses close to the postcode in a map. Zooming In would obviously show closer address to the search postcode (and hence less search results) and zooming out would also include farther addresses (and hence more search results). And then clicking the location icon would display the complete address.
Do I need to store the addresses as longitude and latitude or google map can search a location using postcode? If I need to store the longitude and latitude then whats the best way to convert an address to long and lat?
I really appreciate if you can point me to any useful links or reusable code.
Thanks
As I understand it, you want to find all closest locations from YOUR data to some location, which is identified by a postcode.
First, you have to convert all your addresses to coordinates (Latitude and Longitude). You can do that using Google Geocode API, you will have to create as script, which calls Google Geocode API for every single address in your db:
https://maps.googleapis.com/maps/api/geocode/json?address=EXAMPLE_ADDRES&key=YOUR_API_KEY
The response this script brings you is documented here. You can parse it to get latitude and longitude for each locations and store them in your database. BEWARE of limitations of the Google Geocode API. They are listed here. You have to create your script in a way that won't exceed those limits. Also read this article for caching the results of geocoding, to make sure you don't violate the terms of service. The article also contains some best practices and examples of server side geocoding.
Now, when somebody inputs postcode to your application, you can use the geocoding API or Google maps Geocoding service to translate postcode to coordinate and using haversine formula you can calculate the closest locations from your db, to coordinates of the postcode location. You can do that on frontend side, example in this SO answer (instead of address you will input postcode + state/country in the address bar) or on backend side, if you use MySQL check this SO question.

Plot coordinates near a given set of coordinates on Google maps

This is the scenario...
I have a set of lat/long data stored in a db table[id, lat, long, location]. I'm using geo-location to get a user's current physical location(lat and long). When this user accesses the app, allows his location to be shared, I want to get those coordinates that are around his current coordinates, and plot them on a Google Map.
How can this be done?
Example: I have the coordinates for hotels in a city stored in my DB table. When a user visits this city and accesses my app, I want to get from my DB and plot on map only those coordinates that are around him in a certain radius.
Note: I'm using PHP for server side stuff.
Any help is appreciated!
You describe a store locator: finding POIs within a radius around a particular point. A store locator finds POIs within a radius around a location. The details in Google's example are different (you find the centre point via browser geolocation and have a fairly small radius) but the principle is exactly the same.
Google's article: developers.google.com/maps/articles/phpsqlajax_v3

How to get multiple latitude & longitude from google

I create the file upload with the address of multiple location and store into database,now I want the latitude & longitude information of each address, I create the script using the curl which get the latitude & longitude information from google. But I have data size 2000 records so script get crash after 50 records, there any why using the cron job anything that help me out.
your not allowed to do that according to the end user license agreement, the lat long data can only be used by a google map and hence not just for storing in a database.
I know that doesn't address your technical problem, but you need to look at API/licence that lets you do that.