• Love the plugin. Is it possible to have a toggle control so users can choose which markers are shown?

    In my code I have several categories [travelers-map cats=hikes,restaurants,hotels]

    That works perfectly. But I’d like to offer a button on the map so visitors can turn off hikes, for example.

    Looking at cttm_map[0] I can see all the markers – but I can’t see anything which indicates which category they are in. Is there any way to use JS to get the category of a marker and remove / add them to the map?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author Camille V

    (@socrapop)

    Dear @edent

    Sorry for the late reply. As of now, it’s not possible, but it will be in the next update (for developers only for now). I added the possibility to add custom fields to the popovers with a filter.

    I think it’s over, but I did not have the time to write a documentation (and forgot, it was 3 months ago xD), so if you want to get is now and try, here is the github branch 2.2.0 : https://github.com/Socrapop/travelers-map/tree/2.2.0

    You can use the filter cttm_postdata_filter added in the plugins code here : https://github.com/Socrapop/travelers-map/commit/066388f3536c0b4b07cf50c2c2c783a3202949c4

    I hope this helps, I have little to no time to write the documentation at the moment unfortunately, but it should not be that difficult to add a field to the cttm_markers array. You will have to hide it with css too I think because the custom field will be added to the popovers. (I did not think of the possibility of an “invisible” field for a javascript purpose)

    PS: I changed my computer and don’t even have my dev environment anymore to give you a code snippet ^^’

    Have a great day,

    Camille

Viewing 1 replies (of 1 total)
  • The topic ‘Toggle the categories shown?’ is closed to new replies.