JSFiddle - React, Tailwind, and code Playground

by moob

HTML

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;libraries=geometry"></script>
Is point is within poly? Check the console.

CSS

html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }

JavaScript

(function initialize() {

  var triangleCoords = [
    new google.maps.LatLng(25.774252, -80.190262),
    new google.maps.LatLng(18.466465, -66.118292),
    new google.maps.LatLng(32.321384, -64.75737)
  ];

  var bermudaTriangle = new google.maps.Polygon({
    paths: triangleCoords
  });
    
  var nassau = new google.maps.LatLng(25.0339656,-77.3517605,13);

  console.log(google.maps.geometry.poly.containsLocation(nassau, bermudaTriangle));
    
})();