mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-28 08:50:01 +00:00
User interface improvements for geomarkers and geolayers
This commit is contained in:
parent
0aa3be0488
commit
a890096eec
@ -0,0 +1,6 @@
|
||||
title: $:/plugins/geospatial/demo/ViewTemplateBodyFilters
|
||||
tags: $:/tags/ViewTemplateBodyFilter
|
||||
list-before: $:/config/ViewTemplateBodyFilters/stylesheet
|
||||
|
||||
[tag[$:/tags/GeoLayer]then[$:/plugins/tiddlywiki/geospatial/demo/ui/geolayer]]
|
||||
[tag[$:/tags/GeoMarker]then[$:/plugins/tiddlywiki/geospatial/demo/ui/geomarker]]
|
37
plugins/tiddlywiki/geospatial/demo/ui/geolayer.tid
Normal file
37
plugins/tiddlywiki/geospatial/demo/ui/geolayer.tid
Normal file
@ -0,0 +1,37 @@
|
||||
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={{!!caption}}
|
||||
>
|
||||
<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>
|
@ -1,6 +1,4 @@
|
||||
title: $:/plugins/tiddlywiki/geospatial/demo/traveltime
|
||||
caption: Traveltime
|
||||
tags: $:/tags/GeospatialDemo
|
||||
title: $:/plugins/tiddlywiki/geospatial/demo/ui/geomarker
|
||||
|
||||
\define completion-actions()
|
||||
<$action-log/>
|
||||
@ -26,11 +24,11 @@ tags: $:/tags/GeospatialDemo
|
||||
{
|
||||
"id": "My first isochrone",
|
||||
"coords": {
|
||||
"lat": 51.507609,
|
||||
"lng": -0.128315
|
||||
"lat": {{!!lat}},
|
||||
"lng": {{!!long}}
|
||||
},
|
||||
"departure_time": "2021-09-27T08:00:00Z",
|
||||
"travel_time": 3600,
|
||||
"travel_time": 5400,
|
||||
"transportation": {
|
||||
"type": "driving"
|
||||
}
|
||||
@ -52,7 +50,7 @@ tags: $:/tags/GeospatialDemo
|
||||
password-header-X-Api-Key="traveltime-secret-key"
|
||||
password-header-X-Application-Id="traveltime-application-id"
|
||||
body=<<payload>>
|
||||
var-context="Context string"
|
||||
var-currentTiddler=<<currentTiddler>>
|
||||
bind-status="$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/status"
|
||||
bind-progress="$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/progress"
|
||||
oncompletion=<<completion-actions>>
|
||||
@ -61,32 +59,40 @@ tags: $:/tags/GeospatialDemo
|
||||
</$wikify>
|
||||
\end
|
||||
|
||||
!! Mapped
|
||||
|
||||
<$geomap
|
||||
markers="[<currentTiddler>]"
|
||||
/>
|
||||
|
||||
!! Distance to other markers
|
||||
|
||||
<$let
|
||||
thisLocation={{{ [geopoint{!!lat},{!!long}] }}}
|
||||
>
|
||||
<ul>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoMarker]sort[caption]] -[<currentTiddler>]">
|
||||
<li>
|
||||
<$link><$transclude field="caption"><$view field="title"/></$transclude></$link>
|
||||
--
|
||||
<$let
|
||||
otherLocation={{{ [geopoint{!!lat},{!!long}] }}}
|
||||
>
|
||||
<$text text={{{ [geodistance<thisLocation>,<otherLocation>,[miles]fixed[0]] }}}/> miles
|
||||
</$let>
|
||||
</li>
|
||||
</$list>
|
||||
</ul>
|
||||
</$let>
|
||||
|
||||
!! Travel Time
|
||||
|
||||
<$button actions=<<get-traveltime-actions>>>
|
||||
Call ~TravelTime
|
||||
</$button>
|
||||
|
||||
Status:
|
||||
<pre><code><$text text={{$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/status}}/></code></pre>
|
||||
|
||||
Progress:
|
||||
<pre><code><$text text={{$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/progress}}/></code></pre>
|
||||
|
||||
Response
|
||||
|
||||
~StatusCode:
|
||||
<pre><code><$text text={{$:/temp/_StatusCode}}/></code></pre>
|
||||
|
||||
~StatusText:
|
||||
<pre><code><$text text={{$:/temp/_StatusText}}/></code></pre>
|
||||
|
||||
Error:
|
||||
<pre><code><$text text={{$:/temp/_Error}}/></code></pre>
|
||||
|
||||
Headers:
|
||||
<pre><code><$text text={{$:/temp/_Headers}}/></code></pre>
|
||||
|
||||
Result:
|
||||
<pre><code><$text text={{$:/temp/_Result}}/></code></pre>
|
||||
|
||||
|Status |<$text text={{$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/status}}/> |
|
||||
|Progress |<$text text={{$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/progress}}/> |
|
||||
|Status Code |<$text text={{$:/temp/_StatusCode}}/> |
|
||||
|Status Text |<$text text={{$:/temp/_StatusText}}/> |
|
||||
|Error |<$text text={{$:/temp/_Error}}/> |
|
@ -2,4 +2,4 @@ title: $:/plugins/tiddlywiki/geospatial/readme
|
||||
|
||||
! Demos
|
||||
|
||||
<<tabs tabsList:"[all[tiddlers+shadows]tag[$:/tags/GeospatialDemo]]" default:"$:/plugins/tiddlywiki/geospatial/demo/traveltime">>
|
||||
<<tabs tabsList:"[all[tiddlers+shadows]tag[$:/tags/GeospatialDemo]]" default:"$:/plugins/tiddlywiki/geospatial/demo/data">>
|
||||
|
Loading…
x
Reference in New Issue
Block a user