I am looking to build a “like a crow” route on a map across several latitudinal latitudes. I also need to calculate the total distance (and the preferred distance between points).
I found this example http://www.daftlogic.com/projects-advanced-google-maps-distance-calculator.htm , but it is much more complicated than I require - I don’t need any search functions since I have There is already data on the latitude of longitude. However, the way to display the route is what I am looking to achieve
Are there any simpler examples that I can use or any general recommendations for achieving this?
Building a crow-like route is easy, just set the polyline parameter to a geodesic value of true:
var geodesic = new google.maps.Polyline({geodesic: true});
You can use this example: http://code.google.com/apis/maps/documentation/javascript/examples/geometry-headings.html
To calculate the distance, you can use the Google Maps API V3 geometry library. http://code.google.com/apis/maps/documentation/javascript/geometry.html
The calculation is simple:
var distance = google.maps.geometry.spherical.computeDistanceBetween(latLngOfPointA, latLngOfPointB);
To calculate the path length, you can use the computeLength function:
var path = geodesic.getPath(); var length = google.maps.geometry.spherical.computeLength(path)
Be sure to include geometry in your call in the Google Maps API.
Download from documentation
<script type="text/javascript" src="http://maps.google.com/maps/api/js?libraries=geometry&sensor=true_or_false"> </script>
I have an Excel file with a Vincenty formula that I could forward. Accuracy is better than 20 cm at 20'000 km.
Source: https://habr.com/ru/post/1343245/More articles:How does Gmail hide Subject theme overflow? - cssIs the standard mysql connection over port 3306 secure in Sequel Pro? - securityHibernate (JPA) displaying a HashMap - javaHow to save a HashMap with sleep mode - javaWhat is the design pattern for subclassing a model? - ruby | fooobar.comhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1343246/appropriate-repository-lifecycle-scope-w-ninject-in-mvc&usg=ALkJrhhwO2pWK93FBMQMWeklKwf5l7lV4QProblem with JSON and iphone carrier wave - jsonTutorial About IoC + NHibernate + MVC - asp.net-mvcFile Lock with Perl - fileTracking children from old runs script - perlAll Articles