Answers for "google maps latitude longitude"

3

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>
Posted by: Guest on January-20-2021
0

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>
Posted by: Guest on September-20-2021
-1

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
};
Posted by: Guest on March-10-2021

Code answers related to "google maps latitude longitude"

Code answers related to "Javascript"

Browse Popular Code Answers by Language