android - Google Place API get latitude & longitude of places -
how can latitude & longitude google place api of android? code looks below..
autocompletefilter mautocompletefilter = new autocompletefilter.builder().settypefilter(autocompletefilter.type_filter_cities).build(); pendingresult<autocompletepredictionbuffer> results = places.geodataapi .getautocompletepredictions(mgoogleapiclient, constraint.tostring(), mbounds, mautocompletefilter);
i facing trouble getting results more 5 results. i'm using this link references. grateful.
you should that:
places.geodataapi.getplacebyid(mgoogleapiclient, placeid) .setresultcallback(new resultcallback<placebuffer>() { @override public void onresult(placebuffer p) { if (p.getstatus().issuccess()) { final place mplace = p.get(0); latlng qloc = mplace.getlatlng(); //you can use lat qloc.latitude; //and long qloc.longitude; } p.release(); } });
Comments
Post a Comment