admin管理员组文章数量:1429081
I am using google map v3 to capture all the addresses in a MS SQL database table called Locations which will have columns like LocationName, LocationAddress, LocationZip, LocationState, LocationCity, LocLatitude, LocLongitude and LocationType(like hospital, physician office or emergency centers etc)..
I have an input box where users can search by keyword and a dropdown with 5,10, 20 and 50 miles radius option. I have been able to use the input box and pass the typed keyword as querystring to search for all the matching location and plot markers for them in google map api 3. I also like to do proximity search on the matched results like withing 5 miles of say Los Angeles..
can the method used in this site be used ? .htm
It is drawing a radius withing 5 miles, I need to pretty much capture all the markers within that radius? Please some genius google map guys/girls give me some guidance..
I am using google map v3 to capture all the addresses in a MS SQL database table called Locations which will have columns like LocationName, LocationAddress, LocationZip, LocationState, LocationCity, LocLatitude, LocLongitude and LocationType(like hospital, physician office or emergency centers etc)..
I have an input box where users can search by keyword and a dropdown with 5,10, 20 and 50 miles radius option. I have been able to use the input box and pass the typed keyword as querystring to search for all the matching location and plot markers for them in google map api 3. I also like to do proximity search on the matched results like withing 5 miles of say Los Angeles..
can the method used in this site be used ? http://maps.huge.info/dragcircle2.htm
It is drawing a radius withing 5 miles, I need to pretty much capture all the markers within that radius? Please some genius google map guys/girls give me some guidance..
Share Improve this question edited Sep 9, 2013 at 7:44 j0k 22.8k28 gold badges81 silver badges90 bronze badges asked Feb 28, 2012 at 17:17 Anjana SharmaAnjana Sharma 4,7955 gold badges40 silver badges51 bronze badges1 Answer
Reset to default 3Google has a plete tutorial on creating a store locator. The vital piece of information that you are missing is how to query your database to pull back the locations within your radius.
http://code.google./apis/maps/articles/phpsqlsearch.html
take a look at the link above for details but the query will look somthing like this (mySQL):
SELECT
address,
name,
lat,
lng,
(
3959 * acos(
cos( radians('%s') ) * cos( radians( lat ) )
*
cos( radians( lng ) - radians('%s') )
+
sin( radians('%s') )
*
sin( radians( lat ) )
)
) AS distance
FROM markers
HAVING distance < '%s'
ORDER BY distance
LIMIT 0 , 20
It uses trigonometry!
本文标签: javascriptproximity search google mapStack Overflow
版权声明:本文标题:javascript - proximity search google map - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745488643a2660500.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论