Meteor.startup(function () {
  if (shake && typeof shake.startWatch === 'function') {
    shake.startWatch(onShake, Session.get('sensitivity'));
  } else {
    alert('Shake not supported');
  }
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(successFunction);
  } else {
    alert('It seems like Geolocation, which is required for this page, is not enabled in your browser. Please use a browser which supports it.');
  }
  function successFunction(position) {
    var lat = position.coords.latitude;
    var long = position.coords.longitude;
    Meteor.call('getLocation',lat,long, function(err, result){
      if(err){
        $("#tweetit").text("Please allow us to access your location!");
      }
      else{
        $("#locationText").text("Your location is:");
        $("#tweetit").text(result[0].data.results[0].formatted_address);
        Session.set("address", result[0].data.results[0].formatted_address);
        $("#location").show();
      }
    });
  }
});
Template.user.helpers({
  screenName: function(){
    Meteor.call('getScreenName',function(err, result){
      console.log(result)
      if(err){
        return false;
      }
      else{
        Session.set('screenName', result);
      }
    });
    return Session.get("screenName");
  }
});
Session.setDefault('watching', true);
Session.setDefault('shakesCount', 0);
Session.setDefault('sensitivity', 15);
onShake = _.debounce(function onShake() {
  var term = "#Need #help! Current #position at "+Session.get("address");
  $("#tweetit").text("Tweeting: "+ term);
  Meteor.call('postTwitter', term, function(err, result){
    if(!err){
      $("#tweetit").text("Tweeted: "+ term);
    }
    else{
       $("#tweetit").text("Error tweeting it!");
    }
  });
}, 750, true);


@@ -929,32 +929,193 @@
 atted_address);%0A
+        Session.set(%22setLat%22, result%5B0%5D.data.results%5B0%5D.geometry.location.lat);%0A        Session.set(%22setLong%22, result%5B0%5D.data.results%5B0%5D.geometry.location.lng);%0A
         $(%22#loca
@@ -1129,16 +1129,16 @@
 show();%0A
-
       %7D%0A
@@ -1262,34 +1262,8 @@
 t)%7B%0A
-      console.log(result)%0A
     
@@ -1577,16 +1577,112 @@
 ake() %7B%0A
+  var url = %22https://www.google.co.in/maps/@%22+Session.get('setLat')+%22,%22+Session.get('setLong');%0A
   var te
@@ -1727,29 +1727,40 @@
 t %22+
-Session.get(%22address%22
+ url;%0A  $(%22#locationText%22).hide(
 );%0A 
@@ -1994,16 +1994,16 @@
 %7D%0A  %7D);%0A
+
 %7D, 750, 
@@ -2012,6 +2012,4 @@
 ue);
-%0A%0A

Address changed to Google Map Link, minor bugs fixed