mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-10 03:49:56 +00:00
38 lines
1.0 KiB
Plaintext
38 lines
1.0 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>]"
|
|
/>
|
|
|
|
!! 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>
|