Skip to content

Instantly share code, notes, and snippets.

@thorsteinsson
Created December 10, 2014 03:54
Show Gist options
  • Select an option

  • Save thorsteinsson/6082060d1e157e79cec6 to your computer and use it in GitHub Desktop.

Select an option

Save thorsteinsson/6082060d1e157e79cec6 to your computer and use it in GitHub Desktop.
Move geodesic polygon to LatLng.
var moveToGeodesic = function(map, center, paths, latLng) {
return paths.map(function(path) {
return path.map(function(point) {
return google.maps.geometry.spherical.computeOffset(
latLng,
google.maps.geometry.spherical.computeDistanceBetween(center, point),
google.maps.geometry.spherical.computeHeading(center, point)
);
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment