On Apr 8, 7:02 am, dmapper <[email protected]> wrote:
> Boiled down:
> I want to create a map similar to the standard google map but the
> search results and info windows being a combination of the google
> search and my information.
1. My suggestion would be to first build the map and sidebar that you
describe, without supplementing it with your own information.
Getting that to work will reveal more to you about how the API deals
with markers, infowindows, etc.
2. Then, the question will be, What form is your own supplemental data
in? E.g., a database of some kind, an XML document, a text file, ...?
3. Then, Do you have a way to access that data programmatically (PHP -
> MySQL, or something)?
If you have all of the above, then the trick will be to have an
identifier in your own data that may be used as a match key against
the data returned by the API after a search. The name of the found
location -- the dentist office, say -- will be the obvious choice,
except that place and business names can have quite a bit of variation
("Dr Miller, Dentist", "Dental Offices of Dr. Miller", you get the
idea...). You might need a somewhat involved matching algorithm. On
the other hand, it seems from what you are saying that you already
know about these locations, so perhaps you could populate your own
database keys with results from the API, manually or programmatically,
as a setup phase or an occasional admin task.
So let's say you have a key and a matching algorithm to correlate
locations returned by the API with your own data.
4. Then, one way to get what you want would be accomplished as you
create your markers to display. You could get the API search results,
then use your database key and match algorithm to call your database
for the supplemental info for that location. I think this is the point
at which you are saying you want to "intercept" the API's response.
5. Then, stuff all the info you want into the infowindow for that
marker. (How to do that will become clear if you follow suggestion
#1.)
6. My preferred way is to put an xhr call (XMLHttpRequest, aka "AJAX")
directly into the infowindow's click script, so my database is queried
"live" when that marker is clicked, and a batch of markers aren't
filled with data that users don't happen to look at. But don't aim for
this until you have your chops down on the more basic steps above.
HTH,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---