0

So, tricky problem... I've put together a bunch of extra attributes to associate with food related places to create a bespoke version map of locations. I've generated this using Google places. I've only stored the placeid, as per terms of service, associating those I've chosen with the extra attributes I've generated.

The challenge I have is: how do I plot these items into a JS Google map? I only want to plot those I've selected and not all food places Google returns on their places api. Due to the terms of service I don't have lat/lon for each location, only the placeid. However given the number of places I'll be looking to plot (thousands in total though obviously less for a small region) , looking then all up on the fly will cripple the system with api calls. Can you plot placeid locations directly or do you need to lookup locations first? And if so how do you filter them only to those in the users region of focus?

DrMikey
  • 365
  • 3
  • 12
  • 1
    possible duplicate of [How to get location coordinates knowing place_id via google javascript api](http://stackoverflow.com/questions/29659688/how-to-get-location-coordinates-knowing-place-id-via-google-javascript-api). To determine if they are in view/in the area of focus, you will need to save the geographic coordinates as well as the place_id. – geocodezip May 31 '15 at 20:14
  • @geocodezip as mentioned I'm aware of lookups and am not legally allowed to cache the lat/long so the response you posed doesn't answer the question... – DrMikey May 31 '15 at 20:25

1 Answers1

1

Thanks for your question. Unfortunately there is no way of directly plotting PlaceIds on a map without also specifying a lat/lng. As you note the correct way to do this is to perform Places API lookups to resolve the PlaceId.

The performance issue you mention is problematic for the number of points you wish to plot. I refer you to Section 10.1.3(b) of the Places API Terms Of Service; note that there is allowance for limited prefetching and caching activity for the purposes of improving performance.

Yaniv
  • 991
  • 6
  • 13