daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var address ="<%= params[:search] %>";
  2. var lat;
  3. var lng;
  4. var geocoder = new google.maps.Geocoder();
  5.  
  6. new Promise((resolve, reject) => {
  7. geocoder.geocode( { 'address': address}, function(results, status) {
  8.     lat = results[0].geometry.location.lat();
  9.     lng = results[0].geometry.location.lng();
  10.     resolve({lat: lat, lng: lng});
  11. }));
  12. }).then((data) => {
  13.     alert(data);
  14. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top