aasatech / geometry-library

Node JS/Javascript Geometry Library provides utility functions for the computation of geometric data on the surface of the Earth. Code ported from Google Maps Android API.
MIT License
23 stars 0 forks source link

always is false #10

Open dasuma opened 2 years ago

dasuma commented 2 years ago

im using your libary but i dont understan , the answer always is false+

image

` let response2 = PolyUtil.isLocationOnPath( {lat: 25.771, lng: -80.19}, // point object {lat, lng} [ // poligon arrays of object {lat, lng} {lat: 25.774, lng: -80.19}, {lat: 18.466, lng: -66.118}, {lat: 32.321, lng: -64.757} ] );

console.log(response2) // true  `

i used this version "node-geometry-library": "^1.2.6",

BunHouth commented 2 years ago

@dasuma can you provide your code snippet?

dasuma commented 2 years ago

` import { PolyUtil} from "node-geometry-library";

export default class MapsController {

public async getCoverage({ request, response }) {

let response2 =   PolyUtil.isLocationOnPath(
  {lat: 25.771, lng: -80.19}, // point object {lat, lng}
  [
    // poligon arrays of object {lat, lng}
    {lat: 25.774, lng: -80.19},
    {lat: 18.466, lng: -66.118},
    {lat: 32.321, lng: -64.757}
  ]
);

console.log(response2) // true  

response.status(200);
return { 'res': response2 }

}

} `

BunHouth commented 2 years ago

I'm still not clear about your issue. I'm don't find anything wrong. Response of PolyUtil.isLocationOnPath is true. Is it false on your code?

  {lat: 25.771, lng: -80.19}, // point object {lat, lng}
  [
    // poligon arrays of object {lat, lng}
    {lat: 25.774, lng: -80.19},
    {lat: 18.466, lng: -66.118},
    {lat: 32.321, lng: -64.757}
  ]
);

console.log(response) // true  
dasuma commented 2 years ago

yeah, my response un false, i dont understan why? any problem with specific version? i have "node-geometry-library": "^1.2.6",