I have a polymaps map where I am overlaying a geoJSON vector layer using TileStache. These vectors are being read from a PostGIS / PostgreSQL database and include a unique ID for each polygon. In a separate database, I have information about each polygon.
The map is setup such that when a user clicks on a polygon, it queries the other database for that id and returns information.
What I want to do is be able to run the query the other way. The user can search the non-spatial database for one of these polygons, too.
QUESTION: Once I have my polygon id, how can I highlight / draw it on the map / center the map to it?
I am thinking that I need to:
1) create a connection to the PG database (using PHP, for example)
2) query the database based on that object's id (return "the_geom"?)
3) add that polygon to the map (duplicating an existing polygon, but now I can style it)
Any help or suggestions?
Thanks,
Todd