12

I want to use the Google Maps geometry library within a nodejs application.

From what I can see this library is only available with the Google Maps Javascript api. Is there a way for me to do this?

Colin Goldberg

Colin G
  • 309
  • 3
  • 14

3 Answers3

5

you can try following modules available online

  1. spherical-geometry-js npm i spherical-geometry-js This library provides classes and functions for the computation of geometric data on the surface of the Earth. This library ports a small but useful subset of classes from the Google Maps Javascript API version 3, to use as a separate module or in node. Notes: The API is nearly identical to the Google Maps Javascript API. Functions automatically convert coordinate objects into LatLngs. See convertLatLng for more details. All computed lengths are returned in meters.

you can import whole import * as geometry from 'spherical-geometry-js'; Or import individual modules import { computeArea } from 'spherical-geometry-js'; import computeArea from 'spherical-geometry-js/compute-area';

full description can checkout here https://www.npmjs.com/package/spherical-geometry-js

Rohit Jaiswal
  • 257
  • 4
  • 6
2

You can try this, https://www.npmjs.com/package/spherical-geometry-js

This NPM package has all geometry functions.

Giri
  • 31
  • 5
0

Technically, you can download geometry code and use it offline. Or use any node.js API implimentations like this. But you should make sure that it does not violate Google policy (if you care about it).

Jehy
  • 4,729
  • 1
  • 38
  • 55