1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-07 10:34:53 +00:00
TiddlyWiki5/plugins/tiddlywiki/geospatial/demo/ui/geolayer.tid
2023-03-10 12:45:20 +00:00

39 lines
1.1 KiB
Plaintext

title: $:/plugins/tiddlywiki/geospatial/demo/ui/geolayer
\define create-intersection()
<$let
intersectLayer={{{ =[<currentTiddler>get[text]] =[<otherLayer>get[text]] +[geointersect[]] }}}
>
<$action-createtiddler $basetitle="$:/temp/_IsochroneLayer" text={{{ [<intersectLayer>] }}} tags="$:/tags/GeoLayer" caption={{{ [<captionThisLayer>addsuffix[ intersected with ]addsuffix<captionOtherLayer>] }}}/>
</$let>
\end
!! Mapped
<$geomap
layers="[<currentTiddler>]"
state=<<qualify "$:/state/demo-map">>
/>
!! Intersect with other layers
<$let
captionThisLayer={{{ [<currentTiddler>get[caption]else<currentTiddler>] }}}
>
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoLayer]sort[caption]] -[<currentTiddler>]" variable="otherLayer">
<$let
captionOtherLayer={{{ [<otherLayer>get[caption]else<otherLayer>] }}}
>
<li>
<$link to=<<otherLayer>>><$transclude tiddler=<<otherLayer>> field="caption"><$view tiddler=<<otherLayer>> field="title"/></$transclude></$link>
<$button actions=<<create-intersection>>>
Create intersection
</$button>
</li>
</$let>
</$list>
</ul>
</$let>