I have a point (latitude,longitude) ex : 25,-80 and I'm looking for a way in c# to check if this point is in specific polygon.
I did some research and I found that containsLocation function contained within the Google Maps Geometry Library does exactly what I need but it is not available for c#. Here is an examples in which this method is utlized in JS:
// This example requires the Geometry library. Include the libraries=geometry
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=geometry">
function initMap() {
var triangleCoords = [
{lat: 25.774, lng: -80.19},
{lat: 18.466, lng: -66.118},
{lat: 32.321, lng: -64.757}
];
var coords = new google.maps.LatLng(25.774, -80.19);
var bermudaTriangle = new google.maps.Polygon({paths: triangleCoords});
var result = google.maps.geometry.poly.containsLocation(coords, bermudaTriangle);
alert('The location exist in polygon: '+result);
}
<div id="map"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&libraries=geometry&callback=initMap"
async defer></script>
I found a c# library for gmaps google maps API for C# but it does not support the function containsLocation Is there a way to do the required above in c#?