I am trying to convert a long lat line (53.3603, -6.315050000000042) to a google map object in this format: B: -6.26747649999993 k: 53.339251
I used this function, which works for a long time, but returns Nan for lat.
function getLatLngFromString(ll) { var lat = ll.replace(/\s*\,.*/, '');
I save lat long in the html tag since it caused the list view associated with the map. It is saved here in the correct format, however, when I extract it using jQuery.attr, it converts it to a string.
var location = $(this).closest('.allList').attr("position");
Any help would be greatly appreciated.
javascript jquery latitude-longitude google-maps-api-3
Gemma gallagher
source share