Permalink
Browse files

extracting longitude and latitude with regex

  • Loading branch information...
1 parent e725d32 commit babf366885bbb0eef903024391adc03b637d44b0 @arielo committed Sep 7, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 ui.geo_autocomplete.js
View
@@ -93,13 +93,16 @@ $.widget( "ui.geo_autocomplete", {
}
});
}
-
+ matches = _result.geometry.location.toString().match(/(-?\d+.\d+),\s*(-?\d+.\d+)/);
+ latitude = matches[1];
+ longitude = matches[2];
+
_parsed.push({
value: _place,
label: _result.formatted_address,
viewport: _result.geometry.viewport,
- latitude: _result.geometry.location.Da,
- longitude: _result.geometry.location.Fa
+ latitude: latitude,
+ longitude: longitude
});
}
});

0 comments on commit babf366

Please sign in to comment.