android - Google Places API LatLngBounds from LatLng and Radius -


i using new android place api autocomplete predictions while user type.

from saw far api takes latlngbounds object created using 2 locations.

is there way generate latlngbounds object using 1 latlng center point , radius?

thank you.

as promised distwo, here how creating viewport based on single latitude , longitude. reason me wanting store locator script searches viewport returned places api, , if viewport isn't returned (rare happens) go ahead , create 1 lat , lng returned places. please note not using android app, regular web viewing.

console.log("no viewport found lets spherically compute bounds"); var sw = google.maps.geometry.spherical.computeoffset(place.geometry.location, 1609, 225); var ne = google.maps.geometry.spherical.computeoffset(place.geometry.location, 1609, 45); swlat = sw.lat().tofixed(6); swlng = sw.lng().tofixed(6); nelat = ne.lat().tofixed(6); nelng = ne.lng().tofixed(6); 

not sure of use you. in case radius fixed, in situation sounds though it's variable , hence you'll have refer variable.

ok little edit: i've changed 1423 1000, represents lilometer radius. if you're using kilometers 1000 number use, if you're using miles use "1609.3440006" instead.


Popular posts from this blog