google maps - Meteor Geocoder on iOS device, only return lat and lng, but not physical address -


i developing ios app using meteor. when applied "browser side api", can physical address on browser perfectly. however, doesn't work on ios simulator or ios devices. so, applied apikey ios application. still doesn't work. please advice.

sometimes worked, of time, physical address result didn't come back.

//router.js router.route('/',{     path:"/",     onbeforeaction: function() {         session.set('geolocation',geolocation.latlng());         console.log(geolocation.latlng());         this.next();     } });  //index.html <head>   <title>todo list</title> </head>  <body>   <div class="container">     <header>       <h1>todo list</h1>       <div class="item">         hi       </div>     </header>     <input class="address" type="search" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" name="address" placeholder="address" value="#"> </div> </body>  //server.js if (meteor.isclient) {   if (session.get('geolocation')){     var temp = session.get('geolocation');     var lat = temp.lat;     var lng = temp.lng;     meteor.call('getphysicaladdress', lat, lng, function(err, result){       console.log(result);       console.log(result[0].city);       session.set('physicaladdress', result[0].city);       physicaladdress = session.get('physicaladdress');     });   }    template.body.events({     'click .address': function(e){       var = session.get('physicaladdress');       $('.container').append('<h1>'+a+'</h1>');       $('.address').val(session.get('physicaladdress'));       console.log('im here');     }   });   }   if (meteor.isserver) {   meteor.methods({     'getphysicaladdress':function(lat,lng) {       var geo = new geocoder({         geocoderprovider: "google",         apikey: 'xxx',         httpadapter: "https"       });       return geo.reverse(lat,lng);     },      'getgoogleaddress':function(address) {       check(address,string);       var geo = new geocoder({         geocoderprovider: "google",         apikey: 'xxx',         httpadapter: "https"       });       return geo.geocode(address)[0];     }   }); } 


Comments

Popular posts from this blog

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

yii2 - Yii 2 Running a Cron in the basic template -

mercurial graft feature, can it copy? -