I want extract lat. and longitude vals from a string like this:
var data = "(-20.210696507479017, -70.14000177383423),(-20.21202551027535, -70.14246940612793),(-20.21385790460967, -70.14066696166992),(-20.21168319245841, -70.13901472091675)"
How can I extract these pairs and push them into a array if these points can change in quantity?
Thanks
Split the pairs, then split each pair and parse the values. This produces an array of objects that have a
latandlngproperty that are numbers:Demo: http://jsfiddle.net/Guffa/EV2h4/