I'm building a map with custom markers taken from a MySQL database
I have the following var in js with different coordinates
var locations = [
{lat: 41.641581, lng: -4.780962},
{lat: 41.681581, lng: -4.740961},
{lat: 41.661481, lng: -4.710061},
]
The problem is that in my database the coordinates are not saved, but the complete address, from the following example link you can extract the coordinates of the addresses.
https://maps.googleapis.com/maps/api/geocode/json?address=C/ de las eras 9 - Iscar&key=MI_API_KEY
I would like to know if you can get the coordinates of a direction directly from a script in js without having to go through that link. And if it could not, how do I extract the coordinates of that file?