I am using geolocation to get the users current location and monitor it using the watchPosition method. However, is there a way of calculating the distance between the users starting position and current position? Below is my code:  var x = document....
My programming knowledge is very limited and I'm working on a college project that includes programming.   What I want to do is a map, that shows your current location and the locations of recycling points. I already did the current location part...
Hi I am playing with html5 geolocation and have used the  navigator.geolocation.getCurrentPosition(success, fail) object to get the users position.   In the success function I then created a variable called coords to hold the coordinates and a variab...
I have a line segment (great circle part) on earth. The line segment is defined by the coordinates of its ends. Obviously, two points define two line segments, so assume I am interested in the shorter one.   I am given a third point, and I am looking...
I am using the Google Maps API in my application (ASP.NET with MVC).  I have an array of coordinates (each consisting of latitude and longitude), let us call it "origin" (this can be a polygon, polyline or marker) and another array of coordin...
I would like to calculate the distance between two degree values. I know that I could use this if the points just where on one axis:  var dist = Math.abs( x1 - x2 );   ...but the problem with degrees is, that they can either be negative or positive,...
for the last 1.5 hours I've been struggling to write a function to calculate manhattan distance for a square toroid (like playing the classic snake game without walls).  What I have (coding it in JavaScript)  function getManhattanDistance( node1,...
I have  a javascript which fetches many Latlong from database and put it on Google Map. Now I want to find distance between any two markers. I have serched but was unable to find relevant information..  My Script is as below..     var map,infoWindow;...
var miles = 120;  if (miles > 0 && miles < 10) {     miles = miles*50; }  if (miles > 10 && miles < 40) {     miles = ((miles-10)*1.5)+(10*50); }  if (miles > 40 && miles < 100) {     miles = ((miles-40)*2)+(...
I found the following algorithm to find the closest point given a location:  function closestLocation(targetLocation, locationData) {     function vectorDistance(dx, dy) {         return Math.sqrt(dx * dx + dy * dy);     }      function locationDista...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.