Hi,

Thanks for the nice module.

I am trying to create a map View with data from Geofield fields.

The normal Views query is like this:

SELECT node.title AS node_title, node.nid AS nid, node.language AS node_language, 'node' AS field_data_field_gorsel_node_entity_type, 'node' AS field_data_field_map_node_entity_type
FROM 
{node} node
WHERE (( (node.status = '1') AND (node.type IN  ('venue')) AND (node.language IN  ('en')) ))
ORDER BY node_title ASC
LIMIT 40 OFFSET 0

But when I add lat and lon filter criterias, it seems like this:

SELECT node.title AS node_title, node.nid AS nid, node.language AS node_language, 'node' AS field_data_field_gorsel_node_entity_type, 'node' AS field_data_field_map_node_entity_type
FROM 
{node} node
LEFT JOIN {field_data_field_map} field_data_field_map ON node.nid = field_data_field_map.entity_id AND (field_data_field_map.entity_type = 'node' AND field_data_field_map.deleted = '0')
WHERE (( (node.status = '1') AND (node.type IN  ('venue')) AND (node.language IN  ('en')) AND (field_data_field_map.field_map_lat IS NOT NULL ) AND (field_data_field_map.field_map_lon IS NOT NULL ) ))
ORDER BY node_title ASC
LIMIT 40 OFFSET 0

So I am taking the field_data_field_map.field_map_lat and field_data_field_map.field_map_lon here for Name of latitude field in Views query and Name of longitude field in Views query fields in settings for the formatter.

I see no markers at all.

I have a simple View with a page display.

For the fields I display, I tried 2 things: First, I added the Geofield field as it is and choose Latitude/Longitıde as display formatter. Second I added Geofield for 2 times, and set Latitude only and Longitude only for the formatters respectively.

None worked.

Any help is appreciated.

Comments

rdeboer’s picture

Assigned: Unassigned » rdeboer
Category: support » feature
Status: Active » Fixed

This was not a feature of 7.x-1.8, but it is in 7.x-1.9.
I have update the project page with this section:

If you have the Geofield module enabled and have created a content View of nodes that have Geofield fields, then just as with the Location module, you can put these nodes as markers on a map. Make sure you have added "Content: Geofield" as one of the fields in the View. It does not matter which "Formatter" and "Data options" you pick. Then, after selecting "Map (via IP Geolocation)" enter in the Settings field_name in both the "Name of latitude field in Views query" and "Name of longitude field in Views query" boxes, or leave the second empty. field_name is the same as found in the field list at .../admin/reports/views-fields

Enjoy!
Rik

durum’s picture

Great news!

Just got it working.

Rik, thank you for your effort.

Best,
Duru.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.