Hi,
I can not figure out how to display locations (from Location module) on a Leaflet map through IPGV&M.

The instruction says:

"Special names: Your latitude may reside in a field with a special name. This is the case when using the Location module or when you have used relationships to pull in lat & lon. To input special names, select [Type a field name below] and enter the field's machine name. This list of all field names may help in figuring out the correct name.
If you use a view based on the Location module, the special name is location_latitude."

But what if I use both relationships and Location module? How do I get latitude and longitude? What would be a correct machine field name for this? I,ve tried:

latitude: field_machine_name:location_latitude
longitude: field_machine_name:location_longitude

And few similar combinations, but no success. Map still does not display locations of nodes. I'm getting "None of the 50 result rows in view 24mapa (Strona) had their location_latitude set. Therefore those rows could not be displayed as locations on the map. Are you using the correct field names?"

Will appreciate any guidance.

Comments

migajos created an issue. See original summary.

migajos’s picture

Issue summary: View changes
chrbak’s picture

I had the same problem and finally the solution i found was the below format:

location_field_data_{field_name}_latitude

location_field_data_{field_name}_longitude

Respectively for the "Name of latitude field in Views query" and "Name of longitude field in Views query" fields.
Replace the {field_name} substring with your relationship field name.

Thanks for this great module.

RdeBoer’s picture

Status: Active » Fixed

Thanks chrbak!
Considering this fixed.
Rik

migajos’s picture

Wow! Thank You chrbak!

Status: Fixed » Closed (fixed)

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

digitaltodd’s picture

you can also get the field name from the SQL (views > settings > live preview settings > show the SQL Query). Example from my case:

Query
SELECT node_field_data_field_school.title AS node_field_data_field_school_title, node_field_data_field_school.nid AS node_field_data_field_school_nid, node_field_data_field_school__location.latitude AS node_field_data_field_school__location_latitude, node_field_data_field_school__location.longitude AS node_field_data_field_school__location_longitude, node.created AS node_created

node_field_data_field_school__location_latitude, node_field_data_field_school__location_longitude were the needed fields.