2023-04-25 16:27:17 +00:00
|
|
|
title: ui/geofeature
|
|
|
|
|
|
|
|
\define create-intersection()
|
|
|
|
<$let
|
|
|
|
intersectLayer={{{ =[<currentTiddler>get[text]] =[<otherFeature>get[text]] +[geointersect[]] }}}
|
|
|
|
>
|
|
|
|
<$action-createtiddler $basetitle="$:/temp/_IsochroneLayer" text={{{ [<intersectLayer>] }}} tags="$:/tags/GeoFeature" caption={{{ [<captionThisFeature>addsuffix[ intersected with ]addsuffix<captionOtherFeature>] }}}/>
|
|
|
|
</$let>
|
|
|
|
\end
|
|
|
|
|
|
|
|
!! Mapped
|
|
|
|
|
|
|
|
<$geomap
|
|
|
|
state=<<qualify "$:/state/demo-map">>
|
2023-05-09 09:35:33 +00:00
|
|
|
>
|
|
|
|
<$geolayer json={{!!text}} color={{!!color}}/>
|
|
|
|
</$geomap>
|
2023-04-25 16:27:17 +00:00
|
|
|
|
|
|
|
!! Intersect with other features
|
|
|
|
|
|
|
|
<$let
|
|
|
|
captionThisFeature={{{ [<currentTiddler>get[caption]else<currentTiddler>] }}}
|
|
|
|
>
|
|
|
|
<ul>
|
|
|
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoFeature]sort[caption]] -[<currentTiddler>]" variable="otherFeature">
|
|
|
|
<$let
|
|
|
|
captionOtherFeature={{{ [<otherFeature>get[caption]else<otherFeature>] }}}
|
|
|
|
>
|
|
|
|
<li>
|
|
|
|
<$link to=<<otherFeature>>><$transclude tiddler=<<otherFeature>> field="caption"><$view tiddler=<<otherFeature>> field="title"/></$transclude></$link>
|
|
|
|
<$button actions=<<create-intersection>>>
|
|
|
|
Create intersection
|
|
|
|
</$button>
|
|
|
|
</li>
|
|
|
|
</$let>
|
|
|
|
</$list>
|
|
|
|
</ul>
|
|
|
|
</$let>
|