Icons based on categories

Events happening in the community are now at Drupal community events on www.drupal.org.
kartagis's picture

Hi,

I've got some locations, and as per http://www.interworks.com/blogs/mmueggenborg/2012/01/03/setting-drupal-7..., I've set up a view to show my locations on an openlayers map. Now the user wants me to use different icons based on categories. I've found a module called openlayers_taxonomy, which requires that I pass taxonomy terms as arguments, and I don't see how that will help. Care to help me?

Regardsi

Comments

Set OpenLayers map style dynamically

sano's picture

I faced similar problem, but instead of displaying different icons for points with different semantics, I wanted to change style of linestrings. However, as you can see on the OpenLayers --> Edit Style page, the same solution I chose should work for you as well because there is a style called "externalGraphic", which is "The URL of an icon for points in a layer."

The trick is not to provide a static value in that field, but generate them dynamically. In your view include a PHP customfield field where a simple php switch/case code sets value for variable called $externalGraphic using data retrieved by your view.

HTH

Sano

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week