GMAP-LOCATION-VIEWS-TAXONOMY

Hi,
I have 2 vocabularies called Cities and Sports Activities, and corresponding menus listing their terms (Taxonomy Menu). Both vocabularies are associated with the same content type. (Although GMap-Location has its own location taxonomy, I created the Sports Activities vocab in the Drupal core taxonomy - for TaxMenu functions.)

Now I am trying to create a View so that clicking on a menu item (term) will display a GMap of published nodes that possess one single term of one vocabulary (the menu item clicked) and published nodes with all terms of the other vocabulary. So if the term/menu item clicked was Race Tracks (in the Sports Activities menu), Views will display a GMap of all nodes that possess both a Cities term and the Race Tracks term.

With MANY maps/locations and terms involved, can anyone suggest the best approach in Views?
Thanks.

Comments

indianroo’s picture

I worked with Steve on getting this going.

We setup a custom content type like CityLoc which just has a city name and location co-ordinates from Location module.
Each CityLoc is then tagged with the correct City term. This effectively allows us to add locations to Taxonomy terms.
It's not quite self-managing since if you add a new City Term you have to remember to manually add the CityLoc as well
(It would be nice to add location to Taxonomy terms directly to avoid this. Does anyone have a solution for this?)

We also setup a view to take a city term argument and return all nodes with that term. We also added some custom PHP code in the argument handling to look up the correct CityLoc and construct and set the gmap macro in code to centre the map at that city. Figuring out how to set the GMAP macro from inside the argument handling code was tricky as it meant dumping out the view object and understanding where the macro was getting set.

We could have avoided the custom code and created a view for each city with centre hard-coded but this has led to a more manageable system and not having dozens of views that we would need to configure each time we wanted to make a change in the behaviour.