Posted by kartagis on April 16, 2012 at 11:16am
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
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