2023-03-16 17:22:22 +00:00
title: real-estate-demo
2023-02-13 22:44:39 +00:00
caption: Real Estate Demo
tags: $:/tags/GeospatialDemo
2023-03-07 12:09:02 +00:00
\define default-display-filter() [<currentTiddler>get<fieldname>]
2023-03-08 08:37:04 +00:00
\define default-limit() 100
2023-03-07 12:09:02 +00:00
2023-02-13 22:44:39 +00:00
This is a list of all the tiddlers containing ~GeoJSON markers in this wiki (identified by the tag <<tag "$:/tags/GeoMarker">>) viewed as both a map and a table.
<$let
2023-03-16 17:22:22 +00:00
schema={{real-estate-demo/schema}}
2023-02-13 22:44:39 +00:00
>
2023-02-28 09:36:02 +00:00
<div>
2023-03-07 12:09:02 +00:00
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
2023-02-28 09:36:02 +00:00
<$let
2023-03-07 12:09:02 +00:00
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
2023-02-28 09:36:02 +00:00
>
<div>
<$checkbox tiddler=<<config>> field="visible" checked="yes" unchecked="no" default="yes">
2023-03-07 12:09:02 +00:00
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
2023-02-28 09:36:02 +00:00
</$checkbox>
</div>
</$let>
</$list>
</div>
2023-03-03 09:50:54 +00:00
<div>
Sorting by
<$select tiddler="$:/config/geospatial/demo/real-estate-demo/sort-field" default="title">
2023-03-07 12:09:02 +00:00
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
<option value={{{ [<schema>jsonget[columns],<index>,[name]] }}}>
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
2023-03-03 09:50:54 +00:00
</option>
</$list>
</$select>
<$checkbox tiddler="$:/config/geospatial/demo/real-estate-demo/sort-order" field="text" checked="reverse" unchecked="normal" default="normal">
Reverse sort order
</$checkbox>
</div>
2023-03-03 13:15:04 +00:00
<div>
Search: <$edit-text tiddler="$:/config/geospatial/demo/real-estate-demo/search" tag="input"/>
</div>
<div>
Limit: <$edit-text tiddler="$:/config/geospatial/demo/real-estate-demo/limit" tag="input"/>
</div>
2023-02-13 22:44:39 +00:00
<table>
2023-02-28 09:36:02 +00:00
<thead>
<tr>
2023-03-07 12:09:02 +00:00
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
2023-02-28 09:36:02 +00:00
<$let
2023-03-07 12:09:02 +00:00
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
2023-02-28 09:36:02 +00:00
>
<$list filter="[<config>get[visible]else[yes]match[yes]]" variable="ignore">
<th>
2023-03-07 12:09:02 +00:00
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
2023-02-28 09:36:02 +00:00
</th>
</$list>
</$let>
</$list>
</tr>
</thead>
<tbody>
2023-03-03 09:50:54 +00:00
<$let
sortField={{{ [[$:/config/geospatial/demo/real-estate-demo/sort-field]get[text]else[title]] }}}
sortOrder={{{ [[$:/config/geospatial/demo/real-estate-demo/sort-order]get[text]else[normal]] }}}
2023-03-07 12:09:02 +00:00
limit={{{ [[$:/config/geospatial/demo/real-estate-demo/limit]get[text]] :else[<default-limit>] }}}
2023-03-03 09:50:54 +00:00
>
2023-03-03 13:15:04 +00:00
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoMarker]search:*{$:/config/geospatial/demo/real-estate-demo/search}nsort<sortField>order<sortOrder>limit<limit>]">
2023-03-07 12:09:02 +00:00
<$let
rowTiddler=<<currentTiddler>>
>
<$setmultiplevariables
$names="[<schema>jsonindexes[variables]sort[]]"
$values="[<schema>jsonindexes[variables]sort[]] :map[<schema>jsonget[variables],<currentTiddler>] :map[subfilter<currentTiddler>]"
>
<tr>
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
<$let
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
>
<$list filter="[<config>get[visible]else[yes]match[yes]]" variable="ignore">
<td>
<$let
fieldname={{{ [<schema>jsonget[columns],<index>,[name]] }}}
displayFilter={{{ [<schema>jsonget[columns],<index>,[display]] :else[<default-display-filter>] }}}
>
<$text text={{{ [subfilter<displayFilter>] }}}/>
</$let>
</td>
</$list>
</$let>
2023-03-03 09:50:54 +00:00
</$list>
2023-03-07 12:09:02 +00:00
</tr>
</$setmultiplevariables>
</$let>
2023-03-03 09:50:54 +00:00
</$list>
</$let>
2023-02-28 09:36:02 +00:00
</tbody>
2023-02-13 22:44:39 +00:00
</table>
</$let>