Closed (works as designed)
Project:
Openlayers
Version:
6.x-2.x-dev
Component:
OL Styles
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Mar 2012 at 22:34 UTC
Updated:
23 Mar 2012 at 19:48 UTC
Hello, I am trying to change the map marker to a different icon if my node was recently updated. Currently I am using:
$style = array();
if ($record->node_type == 'business') {
$style['externalGraphic'] = base_path().'images/map_blue.png';
} else {
$style['externalGraphic'] = base_path().'images/map_blue.png';
}
$style['graphicHeight'] = 24;
$style['graphicWidth'] = 24;
$style['graphicOpacity'] = 1;
$style['graphicYOffset'] = -22;
return $style;
This is only a sample piece of code that I found and modified to always use the same icon. How might I modifiy this code to change to another image if the node was updated within a week?
Comments
Comment #1
j0k3z commentedOr, show another static image based on a check box on the node being checked.
Comment #2
phayes commentedIf you click "preview", underneath the query, you'll see find and replace patterns that you can drop into the styles
Comment #3
j0k3z commentedHmm, for some reason I dont see that on my screen:
http://i.imgur.com/pV7Ut.png
Comment #4
zzolo commented@j0k3z, on the 6.x version, I asume you are using a theme function to get to that code. You need to put the node created date into your view and it will be accessible in the View.
For the D7 approach (what Patrick is referring to there) is that you should use style replacements.
Closing, but feel free to re-open if needed.