0

How can I get a list of all transit stations currently on a map, of which the icons are actually visible?

I've tried doing this with the Places API, but the Places API has a couple of fundamental flaws that cannot be worked around:

  1. It can (and does) return multiple places in almost ("almost" is the problem) the exact same location, one in English and the other in the local language, but with no way to tell which is which.
  2. It doesn't and cannot know about the map's zoom level. Therefor is will happily return places that aren't visible on the map when the zoom level is low enough.
  3. The most likely candidate for returning anything usable, is the Radar Search. Problem is, the radar search doesn't return even the name of places. So even a hover on any returned place must do an additional call, adding to the daily limit very quickly. The Nearby Search is another candidate, and while it returns more data per place, it returns fewer places per "page", requiring many requests after each pan/zoom....

So, the Places API looks very promising, but fails to deliver on the details.

Google Maps, the website, has somehow solved this. Not with the Places API, unsurprizingly, but with something else. It's doing a lot of very weird requests to a url that is undocumented. And the result too seems like they're making it very hard for themselves to parse it. Nevertheless, it seems like it's what I need. Or something like it.

Here's a test case that proves the Places API isn't good enough. Just pan around, zoom in/out and you'll see it failing. http://home.thany.nl/apps/MYMaps/test2.html

Thany
  • 285
  • 2
  • 11
  • Yes, you can do that using google places API http://stackoverflow.com/questions/9340800/detect-the-nearest-transit-stop-from-the-given-location – user3378649 Oct 26 '14 at 01:36
  • Like I said... :( I'm a little sad you managed to come up with exactly what I don't want. What part of half the essay I typed up wasn't clear? I can clear it up if needed. – Thany Oct 26 '14 at 22:21
  • Try to be more clear ? – user3378649 Oct 27 '14 at 00:54
  • 1) You can specify a language in your request. A place also has a `place_id` parameter. Did you try to compare these? 2) You should be able to calculate the radius that you need in your request based on your canvas size and zoom level. – MrUpsidown Oct 27 '14 at 09:20
  • Looking here: https://developers.google.com/maps/documentation/javascript/places#radar_search_requests I don't see a way of added language to my requests... – Thany Oct 30 '14 at 09:19
  • Radius is not the problem, because it accepts bounds as well. The problem is that Places doesn't know what the actual zoom level is, which dictates what level of detail is visible. I don't want to display ALL places in a given area, just the ones that are visible in the map tiles. – Thany Oct 30 '14 at 09:21
  • About the place_id, I'll have to look into that. I have my doubts, since most places that come in two languages have ever-so-slightly differing locations (like a few meters or so). But alright, speculation gets us nowhere, I'll have to get me some proof ;) – Thany Oct 30 '14 at 09:23

0 Answers0