adamb
adamb

Reputation: 427

Google Places API - loading place types onclick

I'm loading the 'school' place type into a map and want to be able to load in another place type on click of a link, as shown in this Fiddle:

http://jsfiddle.net/aboother/ke8h48w2/8/

So on click of the link I call my map function and pass in the type, eg:

initializePropertyMap('train_station');

This works well, but when I click either the 'show schools' or 'show train stations' link, the number of places returned gets less and less each time. E.g. if you click the 'show schools' link repetitively, the schools returned are reduced each time. Does anyone know why this may be?


Upvotes: 1

Views: 333

Answers (1)

levi
levi

Reputation: 25161

Looks like you are exceeding the usage limits of the Google maps API. After the if statement

if(status == google.maps.places.PlacesServiceStatus.OK) {

add an else statement, and log the failed requests. You will find the status returned is OVER_QUERY_LIMIT.

See here.

Upvotes: 1

Related Questions