I am trying to get a large set of coordinates from Google Maps API for further processing. I appeal to the geometry library from the Google Maps Javascript API. I use node.js, because it is impossible to get (and then process) an array of 1.25M elements with coordinates through a normal browser. I try to connect Geometry through require

var libGetter = require('https://maps.googleapis.com/maps/api/js?key=someKey&libraries=geometry'); 

and get an error

Error: Cannot find module ' https://maps.googleapis.com/maps/api/js?key=someKey&libraries=geometry '

Question: how to make so that node.js the server could use geometry library? How to add it? Yes, there is Node.js Client for Google Maps Services, but the Geometry library is not there, and the computeOffset () method I need, alas, too. Correct me, please, if this method is there, and I missed it.

  • "there is no computeOffset () method I need computeOffset() " -> see npmjs.com/package/… - Yaant
  • Looked at the module. This is really a great substitute for computeOffset. Thank! - Nikita Nesmiyanov

1 answer 1

Thanks to Yaant for answering the question. Alternatively, you can use the geolib module, the method

 computeDestinationPoint(start, distance, bearing, radius(optional)) 

where start is a LatLng object.

Link to module page

Experience has shown that the computeDestinationPoint method from Geolib and the computeOffset method from the geometry library in the Google Maps API with the same input data sometimes (but not always) give different coordinates. The difference between them offhand is no more than 10-15 cm. For my tasks, this is more than permissible; whether you are satisfied - see for yourself.