I define a macro to replace variable, then call leafletmap
widget. However it is working in one case, but not in another case. Appreciate for any advices.
This one is working which I replace name
in substring of places
\define places(name)
<$leafmap places='{"filter":"[[$name$]] +[has[point]]"}' cluster='25' zoom="8" height="300px" />
\end
<$set name="ptitle" value= {{!!title}}>
<$transclude $variable="places" name=<<ptitle>>>
</$transclude>
</$set>
But the following one is not working for leaflet map
. The only difference is I move filter from macro
to transclude
.
\define places2(filter)
<$list filter="$filter$">
<$link />
</$list>
<$leafmap places='{"filter":"$filter$"}' cluster='25' height="300px" />
\end
<$set name="ptitle" value= {{!!title}}>
<$transclude $variable="places2" filter="[<ptitle>] +[has[point]]"/>
</$set>
The list
widget is working to list the expected items, but leafmap
is not working.
See a minimum example: https://leafmap-test.tiddlyhost.com/. I expect to generate same maps.
Any ideas?