Dynamic map markers

Hi, everyone!

I want to build an app where the user can choose different walking tours in a city. I want the user to click in a tour and be redirected to a map with all the markers of his tour.

I did manage to do that, however, I had to create a page with a map for every single tour I create.

I wonder if it is not posible to have a single page, with a single map, where the markers are dynamic. What I mean is that, after the user click on the tour, he would be redirected always to the same map, but the map would change it’s marker according to the tour the user clicked.

Can I do that? I tried a few tricks with the databaes, but it seams that the Google Maps plugin doesn’t allow conditions for the markers.

Thnaks a lot!
Tomás

Absolutely! You just set the “Data source” property of the map to the data type containing the locations - a “Tour” data type in your case (or whatever it’s named in your DB).

First, though, you’ll probably want to set the “Type of content” property of the page itself (or group, depending on how your app is structured) to your “Tour” data type. You can then configure the map to display markers for the current page’s Tour.

As an example, I’d probably set up the DB with a Historical Marker data type (assuming these are historical tours). It can have any number of fields you want, but one of them should be of type “geographical address”.

Then I’d create a Tour data type in the DB. One of a Tour’s properties would be a “list” of type Historical Marker. The “list” designation is important since each Tour consists of multiple markers.

Then create a page to display Tour detail. The map would then reference that page’s Tour by setting the Type of markers property to Historical Marker and the Data source property to Tour.

This topic was automatically closed after 70 days. New replies are no longer allowed.