open google map with latitude and longitude javascript
// The best way is to use q parameter so that it displays the map with the point marked. eg.:
https://maps.google.com/?q=<lat>,<lng>
open google map with latitude and longitude javascript
// The best way is to use q parameter so that it displays the map with the point marked. eg.:
https://maps.google.com/?q=<lat>,<lng>
google map using latitude and longtitud
<!-- New York, NY, USA (40.7127837, -74.00594130000002) -->
<iframe width="100%" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=40.7127837,-74.0059413&key=YOUR_API_KEY"></iframe>
calculate distance between two latitude longitude points in google maps api
var rad = function(x) {
return x * Math.PI / 180;
};
var getDistance = function(p1, p2) {
var R = 6378137; // Earth’s mean radius in meter
var dLat = rad(p2.lat() - p1.lat());
var dLong = rad(p2.lng() - p1.lng());
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(rad(p1.lat())) * Math.cos(rad(p2.lat())) *
Math.sin(dLong / 2) * Math.sin(dLong / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d; // returns the distance in meter
};
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us