0

I am looking for a way to make some sort of roadtrip website.

The idea is to use two node types: a parent nodetype "Roadtrip" and a child nodetype "Day". The user can create a Roadtrip and add a different Days to the Roadtrip. Every "Day" have a location field that needs to be filled in.

Then, I want to use Views with a Gmap display that I show on the parent Roadtrip node page using contextual filters. On that map, I want to show all the locations of the different Days and connect them to eachother in ascending order by publish date. So visually, you can see which trip someone made in how many days.

I am quite familiair with Views but can't wrap my head around Gmap and it's API so, anyone an idea how to achieve this?

0

The function is not available in the gmap modules, and there was some work done in the Trackfield module that was similar but is deprecated.

You would want to use Google Maps Polylines to create the connection between the points.

https://developers.google.com/maps/documentation/javascript/examples/polyline-simple

Using this, you should be able to write a jQuery function that takes the nodes, sorts them by publish date, then loop over each and grab the lat/long to mark each point in which the lines should connect.

  • Thank you! I wasn't aware of the simple polylines. Seems quite manageable with javascript. I'll have a look! – Apoc Nov 14 '17 at 21:25
0

This answer is for D7, you'll need the folowing modules: entityreference to relate both contentypes, geolocation_views only D7, it displays several nodes in a single map, geolocation, and simple_gmap, this one is for for users to enter city name in a text field, handy tutorials: https://www.youtube.com/watch?v=hdzembWMgPc and https://www.youtube.com/watch?v=Pc0xPiRBb54 and https://www.youtube.com/watch?v=FVvKJlq4Wo8, you will end with something like this, each mark in map links to your day-node, enjoy. enter image description here

  • Thanks for your answer. I tagged the Question for D7. I am already capable to get the result you are showing. The only thing I cannot produce is how to connect the markers with a line, to visually show the trip. Any idea how to achieve this? – Apoc Nov 14 '17 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.