I'm new to the google maps API. I've created a function which allows me to create pins inside a google map based off of their placeID. I have a long list of pins which I have to display but I've discovered that the map only shows the first 10 or 11.
It seems like its possible to set a delay on the function to get around only showing the first 10 according to other questions on stackoverflow but I don't understand how and my efforts just come up with errors. Is there a way to apply a timeout to my function to avoid running against the 10 marker limit?
function createPin(pinID) {
service.getDetails({placeId: pinID }, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
var marker = new google.maps.Marker({
map: map,
icon: pinIcon,
position: place.geometry.location
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent('<div class="infoWindow">' + place.name +'</div>');
infowindow.open(map, this);
});
}
});
}
/* Pins */
// Accenture
createPin('ChIJR6Ib2OwOZ0gRuWM8ipE_2Pk');
// Air BNB
createPin('ChIJwZfFge4OZ0gRz6mxPYx32Lc');
// ARUP
createPin('ChIJZedOre4OZ0gRwMvu-iJudQQ');
// Bank of Ireland
createPin('ChIJFyHFVZMOZ0gRO5Ld01Zz1XM');
/* long list of pins continues [...] */