moshen / node-googlemaps

A simple way to query the Google Maps API from Node.js
MIT License
559 stars 148 forks source link

Is it possible to use Google Maps Geometry in Node JS? #158

Open hellocaio opened 3 years ago

hellocaio commented 3 years ago

I'm trying to get access to Google Maps Geometry to calculate points with a specific area in Node JS.

    ...
    const circle = new google.maps.Circle({
        center: area.center,
        radius: area.radius,
    });
    const doesContain = circle.getBounds().contains(location);

Circles, rectangles, polygons... does anyone know how?

hellocaio commented 3 years ago

It looks like I found a solution:

Spherical Geometry Library https://www.npmjs.com/package/spherical-geometry-js

I'll give it a shot; but if anyone has other suggestion please let me know.

hellocaio commented 3 years ago

The library I mentioned doesn't solve the issue, it doesn't support circles or polygons -- only rectangles.