Leafmap plugin how to pass the title field?

cenario: I’m making a TiddlyWiki to plan and build my trips.

I have a number of tiddlers who are the places I intend to visit with some information.

These Tiddlers are tagged with the tah “2022-05 Verbania”.

So I have the Tiddler with the title “2022-05 Verbania” in which I am able to create the list of places I intend to visit.

I would like to pass the same filter to the leafleft plugin to display them on the map.

If I use the tag directly it works,

<$leafmap tile=‘osm’ places=’{“filter”:"[tag[2022-05 Verbania]]"}’ cluster=‘25’>

Ff I try to pass the title of the Tiddler it doesn’t work.

Any suggestions?

Thanks!

I suspect this will work

“filter”:”[[2022-05 Verbania]]”

Yes this is working.

What I want is render this more re-usable

i.e. using something like:

places=’{“filter”:"[tag[]]"}’

can let me to use a global macro and use only one code for the different trips I can think of.

:slight_smile:

1 Like

I tag all my place tiddlers with the tag “place”. I further tag them with the type of place, e.g. city, county, park, historical-site, etc. I then have a place template that uses this macro:

\define showmap(tagg, maptype)
<$leafmap tileControl tile=’$maptype$’ places=’{“filter”:"[tag[place]tag[$tagg$]]"}’ cluster=‘30’ />
\end

I use parameter $tagg$ to reference those types of places. However, you can change this to use a specific tiddler title or a list of tiddler titles.

1 Like