문제

I have about 20 events (UK based if that makes a difference).

I will also have a form on a page where people can register their interest in attending one of these events. After they have submitted this form, they will be shown the location of the closest event to them.

Trouble is I have no idea how to do this. Is there anything linked to google maps that can achieve this or do I need to buy something that does this... or can it be fairly easily achieved server side based on the fact I only have a small number of events.

If it needs to be done server side I'm running asp.net (vb) or I'm fairly up to speed with javascript/jquery.

Thanks

도움이 되었습니까?

해결책

Most likely what you want is the harvesine-formule-math to calculate the distance from your client's location and your event. Like Luke worked it out a spatial index-query enabled database can help you greatly.

다른 팁

Take a look at this post by Howard van Rooijen:

http://howard.vanrooijen.co.uk/2010/05/05/ordnance-surveys-gb-postcode-to-longitude-latitude-dataset/

He has taken the Ordinance Survey postcode data and made it available in various usable forms (SQL Server 2005, 2008 and Mongo). You can then run a spatial query server-side against this data to find how many postcodes are within a given range of the event postcode.

I wrote a site & free API that does this for you if it's any use - http://postcod.es

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top