May I know how to get more than 10 data results from Google Map when using the radarSearch method that can retrieved 200 results and getDetails method? I want all the marker information is listed down in the white space below the map. However, I only get 10 of it. May I know the problem? The 10 result stay the same and may only change 1 of them when the browser is refresh for a few times.
Here is the code that I used to retrieve the information from Google Map and create the marker. I used the radar Search method to perform the search.
function callback(results, status) {
if (status !== google.maps.places.PlacesServiceStatus.OK) {
console.error(status);
return;
}
for (var i = 0, result; result = results[i]; i++) {
addMarker(result);
}
}
function addMarker(place) {
var placesList = document.getElementById('test');
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
icon: {
url: 'http://maps.gstatic.com/mapfiles/circle.png',
anchor: new google.maps.Point(10, 10),
scaledSize: new google.maps.Size(10, 17)
}
});
service.getDetails(place, function(result, status) {
if (status !== google.maps.places.PlacesServiceStatus.OK) {
console.error(status);
return;
}
iname = result.name;
iLatitude = [result.geometry.location.lat()];
iLongitude = [result.geometry.location.lng()];
iAddress = [result.formatted_address];
placesList.innerHTML += '<li>' + iname +' '+ iAddress + '</li>';
});
}
ScreenShot of the result. The marker result is nearly 200, while the listed down data only consists of 10