I want to add an address field to a website, but I want it to be smart like have auto complete etc, and then actually have some context of the location, either via GPS or some other system. Essentially I want to be able to calculate the distance between two addresses. It's for a food delivery website, and different parts of town will charge differently. So I want the site to actually know where a specific address is so it can then use some logic from that point on.
My first thought was to just go by street, and have a list of every street in the city in a drop down menu, but I actually need to break up some streets too as like say the highway, addresses 1-1000 may be closer than addresses 1001-2000 for example.
So another way I'm thinking is to just do GPS based radius. So anything within 10km is one price, and so on.
Before I try to code all of this myself and manually input all the data is there some kind of API or downloadable set of libraries that I can get that would handle all of this for me?
I was thinking maybe OpenStreetMaps, would it do this? What about adding some GUI functionality to draw stuff on a map like lines, and then save it? I have a separate project where I will want to do stuff like this. Ideally whatever solution I go with I want everything to be on my server, I don't want to depend on a 3rd party. Just wondering where to start looking so I can read up more.
My first thought was to just go by street, and have a list of every street in the city in a drop down menu, but I actually need to break up some streets too as like say the highway, addresses 1-1000 may be closer than addresses 1001-2000 for example.
So another way I'm thinking is to just do GPS based radius. So anything within 10km is one price, and so on.
Before I try to code all of this myself and manually input all the data is there some kind of API or downloadable set of libraries that I can get that would handle all of this for me?
I was thinking maybe OpenStreetMaps, would it do this? What about adding some GUI functionality to draw stuff on a map like lines, and then save it? I have a separate project where I will want to do stuff like this. Ideally whatever solution I go with I want everything to be on my server, I don't want to depend on a 3rd party. Just wondering where to start looking so I can read up more.