The case that there is someone that will input a link in a form and I need to decode that link to get lat and long to place the pin on an embedded map for him
stack: JavaScript - Angular
the problem is the google maps shared link is like this https://goo.gl/maps/2vV46xBbqiKp18MQA
how can I extract the lat and long from this link using JavaScript
A solution where you do not require users to give you an exact URL schema is to have logic that determines what the shortened link actually points to and then scrape its query params for lat and long values. See this answer: https://stackoverflow.com/a/72054044/17963017
Of course, you would need to make sure that the URL is valid, the domain points to Google Maps, etc.