Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Google Maps geometry library in nodejs

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

like image 364
Colin G Avatar asked Mar 23 '16 13:03

Colin G


2 Answers

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

like image 78
Rohit Jaiswal Avatar answered Nov 18 '22 08:11

Rohit Jaiswal


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

This NPM package has all geometry functions.

like image 2
Giri Avatar answered Nov 18 '22 08:11

Giri