Geospatial Plugin: Improve Event Support (#8740)

* Add onclick attribute to geolayer widget

* Temporarily add the plugin to tw5.com for the Netlify preview

* Rename onclick to clickActions

And add docs for the lat, long, alt variables

* No longer apply the default popup template

Now that we have customisable popups the default one is pretty useless

* Prepare for merging to v5.3.6

The special circumstances are that this PR is confined to a plugin, and that the new work is an extension of the new features already merged in v5.3.6
This commit is contained in:
Jeremy Ruston
2024-11-15 12:03:16 +00:00
committed by GitHub
parent 3856d1bf6a
commit 3fb2f980c8
4 changed files with 66 additions and 21 deletions

View File

@@ -101,6 +101,36 @@ If no base layers are defined by `<$geobaselayer>` widgets within the `<$geomap>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>
<$testcase>
<$data
title="Description"
text="Map with geomarker with actions"
/>
<$data title="MarkerClickActions" text="""
<$action-setfield $tiddler="$:/clicked-marker" text={{{ =[<properties>] =[<lat>] =[<long>] =[<alt>] +[join[,]] }}}/>
"""/>
<$data title="Output" text="""Marker: <$text text={{$:/clicked-marker}}/>
<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoMarker]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}} properties={{{ [[{}]jsonset[title],<currentTiddler>] }}} clickActions={{MarkerClickActions}}/>
</$list>
</$geomap>
"""/>
<$data
title="Oxford"
tags="$:/tags/GeoMarker"
caption="Oxford"
lat="51.751944"
long="-1.257778"
alt="0"
text="""{{$:/core/images/star-filled}} This is Oxford!"""/>
properties={{{ [[{}]jsonset[title],[Oxford] }}}/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>
<$testcase>
<$data
title="Description"