Merge my db with establishment types request

10 views
Skip to first unread message

amnesia7

unread,
Jul 30, 2011, 9:15:40 PM7/30/11
to Google Maps JavaScript API v3
I want to search my db for some locations and display them on a google
map.

I'll probably only be bringing back about 20 but they may be a mix of
establishment types. I'd then like to allow the user to filter the
results so it only shows particular establishment types.

Let's say it brings back "bar"s and "night_club"s but when the user de-
selects bars (by unchecking a checkbox for "bar" establishments)
there's only 1 night_club left out of the 20 results but if the user
had just been able to search my db for locations that I have that
google says are night_clubs then there could have been 3 displayed but
they were outweighed by all the bars that were returned closer to a
particular position.

Would I need to store the establishment type when I save the location
info to my database so that a user could filter particular
establishment types or is there a better way of doing this that I've
not thought of?

Thanks

xelawho

unread,
Jul 31, 2011, 3:14:00 PM7/31/11
to Google Maps JavaScript API v3
> Would I need to store the establishment type when I save the location
> info to my database so that a user could filter particular
> establishment types or is there a better way of doing this that I've
> not thought of?

why not call the search function again with the updated parameters
whenever a checkbox is checked or unchecked?

amnesia7

unread,
Aug 3, 2011, 11:52:28 AM8/3/11
to google-map...@googlegroups.com
That's what I'm thinking but wouldn't that mean that I would have to have stored the establishment type against each entry on my db (to inlcude in my WHERE clause) so that I can select those enties/locations that are of a particular type and only bring those back from my db to show onscreen?

Rossko

unread,
Aug 3, 2011, 5:19:36 PM8/3/11
to Google Maps JavaScript API v3
> That's what I'm thinking but wouldn't that mean that I would have to have
> stored the establishment type against each entry on my db

Well, yes. How were you expecting the client-side javascript to be
able to distinguish between them?
Once you've stored the type, you might as well search it at the db
(which is after all good at searching) and not dump the whole content
to the client for searching.
Reply all
Reply to author
Forward
0 new messages