Geotargetting for "Nearest Restaurant Locator" - php

For an online ordering system, we figured that we would take the entered address and city, calculate the distance between it and each entry in a database of addresses using the Google Maps API.
However the client was told by his previous designer that he needs to use geotargeting for more accuracy. As far as I know, geotargetting is only accurate in getting the user's country, but definitely not precise location.
Is there a problem with the address+city method? And is there any truth to the geotargetting method?

Geo-targeting will provide you with the precise location (coordinates) of the user, if they choose to share it.
You can use the coordinates with Google Maps API to then calculate the distance in the same manner you planned with address of the user or the restaurant. (Google converts any address to a coordinates in it's calculations.)
There is no problem with your address+city method, but it may be easier for users to just share their current location... and not have to enter a current address+city.
Address+city would need to be a fallback if the user is not willing to 'share their current location' via geo-targeting.

Related

Address validation in Laravel

I am trying to validate addresses input from users, where they give their street name, zip code, house number etc ...
The question is, how can I validate weather the address is valid?
The even better question would be, how can I check using the IP of the user, weather the input match the current country of the user or not, according to those informations I am gonna flash some validation errors.
Can I implement this in a Google Map for example?
Thanks
You can't.
There are simply too many edge cases, where addresses might seem wrongful, but are correct. Where I live some companies get their own zip code, also some roads do and some addresses does not have a town name.
If you want to be as precise as possible, you should ask the user to enter their address through a Google Maps auto complete field, as Google Maps knows a lot of the edge cases.
That being said, It's not accurate to check whether the users inputted address matches their origin country, as they can be behind a VPN. Also some IP addresses maps to another country than the user is actually in.

Google Analytics - suburb location

Hi I have implemented google analytics on to my website. However it only shows the location of visitors on the country, state and city level. How do I get it to show the visitors location drilling down to suburb level?
Is it a special code I need on my website or some settings I need to do on my account or something I have to pay for ?
Thanks so much for the help!
Google Analytics' accuracy will very often be the best you can get.
There is HTML5 Geolocation (more detailed introduction here) which can be more accurate, down to several feet if the user's machine has a GPS device. However, this kind of geolocation requires the user's explicit permission.

detecting site visitor's city (for a site like Oodle.com)

I am making a website that would allow users to post classified listings, buy/sell products etc. you can think of it as a limited version of Craigslist or oodle.com or something.
I want to automatically filter listings/results by user's city. How do I detect user's city?
There is MaxMind API that I could use to get city from ip address. Anything else?
Hmm.. what's the best way of implementing this? My site is going to be available in only 4-5 cities. If a user from outside of these 4-5 cities visits my site, I'd like to show "all" listings (that is, listings from all over US). Each of these cities have suburbs so I'd like to consider users from nearby suburb cities as part of my target city. How to code this? Should I look at the map and decide which suburbs to consider as part of target city or is there a way to decide target city + radius in miles/kms to be considered part of my target city?
Sounds like you want something like the GeoIP City service.
In my opinion maxmind is good tool for ip detection and mapping with location, Below you can read documentation and they have uploaded sample code too, so you can get help from that
http://dev.maxmind.com/geoip/web-services

Google Maps API Business Search

I have been looking through the documentation for the API and not sure if it is possible to list multiple select stores near the submitted address.
Ultimately something like the following website: http://www.evolutionofsmooth.com/locator/
It seems like they have each location stored in a db but I can't see it that likely since it would be pretty huge to do something like that.
Any ideas?
They probably did store all the shops in a database. They saved the latitude and longitude of each shop. Then they load, via AJAX, all the shops into the google map. Google maps has a tutorial for creating a storelocator.
Google maps api v3 has a function called ClientLocation this can, on base of the IP-address, return the current position of the user viewing the google map. This way the closest shops can be highlighted or put on top of the list.
Hopes this will help!

Google Map with php mysql

my problem is i want to show my registered site user on to google map but dont know how to locate the user, means i dont know the latitude and longitude of every user . I am a newbie in google map so plz help
Thanks a ton
What location data do you have for your users? Cities, states, countries?
You might want to have a look at Google's Geocoding APIs.
there are two possible ways of doing this.
Ask the user to search a google map and place themselves on it. Look here for an idea on how to do this http://www.designing4u.de/2008/08/google-maps-jquery-and-xml-saving-markers-with-user-input/
Use an IP to Location database to find out the location based on their IP. Look here for how to do this http://www.ip2nation.com/ip2nation
There is no way to reliably locate a user using their IP address. However if you are developing for a mobile device it may be possible to acquire their GPS coordinates. Or you could require them to enter an address and place a point on the map from that address with geocoding.
If you are collecting the address of each registered user, you can get the latitude and longitude on the server-side through the Google Maps HTTP Geocoding Service.
You would use the following HTTP request:
http://maps.google.com/maps/geo?q=Oxford+Street,+London&output=csv&sensor=false
Simply change the q parameter with your user's address.

Categories