HI, i get the distance by sql function .
在2009-07-25,"Tamer Hatoum" <[email protected]> 写道: > >Hi; >What you have to do is first make your connecnt extract the tow points the >apply this method : >var R = 6371; // km >var dLat = (lat2-lat1).toRad(); >var dLon = (lon2-lon1).toRad(); >var a = Math.sin(dLat/2) * Math.sin(dLat/2) + > Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) * > Math.sin(dLon/2) * Math.sin(dLon/2); >var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); >var d = R * c; > then make your check if d<5 >then apply the method to create the map.. >regards.. >MHQ2007 <[email protected]> wrote: > >> >> Hi, >> >> I need to check the ditance between 2 adresses. I the adresse from the >> restaurant is in range of the user then the mal should be created. >> >> I have both adresses in my database. >> >> So I think, I need to compare both adresses. If distance is <5 then >> get the adress from the database and create a map. >> >> Is there a function to ask for the distance? >> >> Thanks >> Denis >> > >> >Tamer Hatoum; >Web Developer and Programmer; >Qatar Navigator Est; >Tel: +974 6026267; >[email protected] > > > >--~--~---------~--~----~------------~-------~--~----~ >You received this message because you are subscribed to the Google Groups >"Google Maps API" group. >To post to this group, send email to [email protected] >To unsubscribe from this group, send email to >[email protected] >For more options, visit this group at >http://groups.google.com/group/Google-Maps-API?hl=en >-~----------~----~----~----~------~----~------~--~--- > -- You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=.
