I have a custom View setup that returns Lat, Long, Info Window data, and a Marker column. The map is displaying and working fine, but for some reason, I cannot get the "Use marker field" setting for the view to work. I have the style option set in Views to "Use marker field" and have selected my "Marker" column which is returning different values (small green, small dark blue, small light blue, etc.). When I load the page with my view on it, all I get is 'small red' markers. For some reason, the "Use marker field" option is being ignored.

I fired by xdebug and discovered that the variables in gmap_plugin_style_gmap.inc are incorrect:

  • $this->options['markers'] = 'static', NOT 'fields' as it should be
  • $this->options['markertype'] = 'small red', NOT 'small dark blue' even though that is the one in my query results
  • $this->options['markerfield'] = 'customer_number', NOT 'marker', 'customer_number' is the first column in my query, 'marker' has the marker names

If I put a breakpoint at the beginning on the render() function in gmap_plugin_style_gmap.inc and change the above values to the ones I list, the map works correctly and has different colored markers.

If I export my view, it has all the correct settings for "Use marker field". xdebug shows the right values when I am configuring and saving the view, but for some reason they are changing when I'm actually viewing the view.

I've upgraded to the latest dev versions of views, location and gmap and upgrade to drupal 6.17, but it didn't help. I've tried saving, reverting, clearing cache, regenerating markers with no success.

What is going on here? Any ideas?

Comments

bendiy’s picture

Title: Views Marker Handleing - Use marker field - Not Working » Views Marker Handling - Use marker field - Not Working
bendiy’s picture

Status: Active » Closed (fixed)

Never mind, this appears to be working now after starting from a clean slate.

AlbertGraupera’s picture

Hello,
I have the same problem you mention with a view to see the markers, are small and red.
Comment on how solve the problem?

Thank you very much in advance,
greetings

bkosborne’s picture

I see to be having this same issue...

bkosborne’s picture

Status: Closed (fixed) » Needs work

I tried using the marker type based on a field, and that would work fine, but only for fields that are added to the $row. I was trying to utilize a CustomPHP field or a Global: Custom Text field. The problem with the Global: Custom Text field is that it doesn't have a field_alias, nor is it added to the $row query.

I think that perhaps this should be documented somewhere to prevent people from pulling their hair out. It seems you can only use real database fields for this, but every field added to the view is available as an option.

grasmash’s picture

You could use a computed field (stored in db) to generate and set the marker type.