Might not be 100% exactly what you need, but this should get you started in 
the right direction. 

//Check if within range      
        var R = 6371; // km
        var dLat = (curLat-paramLat).toRad();
        var dLon = (curLng-paramLong).toRad(); 
        var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
                Math.cos(paramLat.toRad()) * Math.cos(paramLong.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;
      
        if(d <= (paramRadius/1000)){   
            coordList.push({       
            lat: curLat, 
            lng: curLng, 
            alt: parseFloat(coords[2])
          });

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/B1bufQo67DEJ.
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-js-api-v3?hl=en.

Reply via email to