mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-05 08:18:06 +00:00
Introduce geolayer widget for specifying layers for geomap
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
title: $:/plugins/tiddlywiki/geospatial/tests/widgets/geomap-refresh
|
||||
description: refreshing of geomap widget
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Description
|
||||
text: Map using dynamic geolayer to represent features
|
||||
+
|
||||
title: Layer
|
||||
tags: $:/tags/GeoFeature
|
||||
type: application/json
|
||||
color: red
|
||||
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"id": "An example geofeature feature",
|
||||
"properties": {
|
||||
"custom": "A custom property of this feature",
|
||||
"color": "#ff8"
|
||||
},
|
||||
"geometry": {
|
||||
"type": "Polygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[-90,35],
|
||||
[-90,30],
|
||||
[-85,30],
|
||||
[-85,35],
|
||||
[-90,35]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$button>
|
||||
<$action-setfield $tiddler="$:/state/layer" $value="yes"/>
|
||||
Click here to enable the layer
|
||||
</$button>
|
||||
|
||||
<$geomap
|
||||
state=<<qualify "$:/state/demo-map">>
|
||||
>
|
||||
<$geolayer
|
||||
json={{{ [{$:/state/layer}match[yes]then{Layer}else[]] }}}
|
||||
colorFilter="[<currentTiddler>jsonget[properties],[color]else[red]]"
|
||||
/>
|
||||
</$geomap>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Winchester,Oxford,</p>
|
||||
53
plugins/tiddlywiki/geospatial/tests/widgets/geomap.tid
Normal file
53
plugins/tiddlywiki/geospatial/tests/widgets/geomap.tid
Normal file
@@ -0,0 +1,53 @@
|
||||
title: $:/plugins/tiddlywiki/geospatial/tests/widgets/geomap
|
||||
description: geomap widget
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Description
|
||||
text: Map using geolayer to represent features
|
||||
+
|
||||
title: Layer
|
||||
tags: $:/tags/GeoFeature
|
||||
type: application/json
|
||||
color: red
|
||||
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"id": "An example geofeature feature",
|
||||
"properties": {
|
||||
"custom": "A custom property of this feature",
|
||||
"color": "#ff8"
|
||||
},
|
||||
"geometry": {
|
||||
"type": "Polygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[-90,35],
|
||||
[-90,30],
|
||||
[-85,30],
|
||||
[-85,35],
|
||||
[-90,35]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$geomap
|
||||
state=<<qualify "$:/state/demo-map">>
|
||||
>
|
||||
<$geolayer
|
||||
json={{Layer}}
|
||||
colorFilter="[<currentTiddler>jsonget[properties],[color]else[red]]"
|
||||
/>
|
||||
</$geomap>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Winchester,Oxford,</p>
|
||||
Reference in New Issue
Block a user