I'm trying to get latitude and longitude value out of string. If I set the location on the map, the map api gives me string value like below.
var location = {map: geo="20.471884,-157.505,6" p="Hawaii"}
and I'd like to get the number values 20.471884, -157.505 and 6 into var lat, lng.
how can I make it in javascript??
String.prototype.split()
would be a start. Have you done any research or made any attempts? What specifically are you having trouble with. Not to mention, that "object" isn't valid at all. – Tyler Roper Jun 2 '19 at 4:27-157.5056
? – Jack Bashford Jun 2 '19 at 4:28