Index: modules/openlayers_views/views/openlayers_views_style_map.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/modules/openlayers_views/views/openlayers_views_style_map.inc,v
retrieving revision 1.16.2.10
diff -u -p -w -r1.16.2.10 openlayers_views_style_map.inc
--- modules/openlayers_views/views/openlayers_views_style_map.inc	22 Jul 2009 01:48:18 -0000	1.16.2.10
+++ modules/openlayers_views/views/openlayers_views_style_map.inc	27 Jul 2009 22:51:09 -0000
@@ -284,14 +284,25 @@ class openlayers_views_style_map extends
     foreach ($records as $id => $record) {
       $feature = array();
       
+      // In order for any kind of substitution/replacement token/convert to link/trim/etc. functionality to work, we
+      // have to call advanced_render on each field in the record in order and use its output to generate the attributes
+      // for features
+      // (brynbellomy)
+      foreach($handlers as $hid => $handler)
+        $record->{$handler->field_alias} = $handler->advanced_render($record);
+      
       // Go through data sources
       // @@TODO: In theory, there could be multiple features per row., allow for multiple features per row
       foreach ($data_source['value'] as $data_source_value) {
         switch ($data_source_value) {
           case 'node_locations':
             // @@TODO: These fields are provided only if the fields are chosen in the interface.
-            if (!empty($record->location_longitude) && !empty($record->location_latitude)) {
-              $wkt_string = 'POINT(' . $record->location_longitude . ' ' . $record->location_latitude . ')';
+            if (!empty(
+$record->location_longitude) && !empty(
+$record->location_latitude)) {
+              $wkt_string = 'POINT(' . 
+$record->location_longitude . ' ' . 
+$record->location_latitude . ')';
               $feature['wkt'] = $wkt_string;
               $feature['projection'] = '4326';
             }
@@ -302,8 +313,10 @@ class openlayers_views_style_map extends
             foreach ($data_source['geo_fields'] as $geo_field) {            
               $wkt_field = $geo_field . '_wkt';
               
-              if ($record->$wkt_field) {
-                $feature['wkt'] = $record->$wkt_field;
+              if (
+$record->$wkt_field) {
+                $feature['wkt'] = 
+$record->$wkt_field;
                 $feature['projection'] ='4326';
               }
             }
@@ -328,8 +341,10 @@ class openlayers_views_style_map extends
           case 'other_wkt':
             // Go through selected field
             foreach ($data_source['other_wkt'] as $wkt_field) {
-              if (!empty($record->$wkt_field)) {
-                $feature['wkt'] = $record->$wkt_field;
+              if (!empty(
+$record->$wkt_field)) {
+                $feature['wkt'] = 
+$record->$wkt_field;
                 // @@TODO: Allow different projections
                 $feature['projection'] ='4326';
               }
@@ -342,7 +357,8 @@ class openlayers_views_style_map extends
       // Fill in all attributes
       foreach ($fields as $fid => $field) {
         $field_alias = $field['field_alias'];
-        $feature['attributes'][$field_alias] = $record->$field_alias;
+        $feature['attributes'][$field_alias] = 
+$record->$field_alias;
       }
       
       // Fill in tooltip attribute
@@ -372,7 +388,8 @@ class openlayers_views_style_map extends
       }
       
       // Run feature styles through theme function
-      $feature_style = theme('openlayers_views_feature_style', $this, $record, $group);
+      $feature_style = theme('openlayers_views_feature_style', $this, 
+$record, $group);
       if (is_array($feature_style) && !empty($feature_style)) {
         $feature['style'] = $feature_style;
       }
