title: Convert lat long string into google maps API LatLng Object
body: <p>I am trying to convert a lat long string (53.3603, -6.315050000000042) into a google maps object in this  format: B: -6.26747649999993 k: 53.339251 </p>
  
  <p>I have used this function which works for the long but returns Nan for the lat.</p>
  
  <pre><code>function getLatLngFromString(ll) {
          var lat = ll.replace(/\s*\,.*/, ''); // first 123
          var lng = ll.replace(/.*,\s*/, ''); // second ,456
          var locate = new google.maps.LatLng(parseFloat(lat), parseFloat(lng)); 
          return locate;
      }
      ;
  </code></pre>
  
  <p>I am storing the lat long in a html tag as it called to a list view connected to a map. It is stored here in the correct format however when I retrieve it using the jQuery .attr it converts it to a string.</p>
  
  <pre><code>var location = $(this).closest('.allList').attr("position");
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>