Geospatial plugin - Help required with the PopupTemplate for a GeoFeature

Hello all

I have successfully created a map which shows the tracks of various trips I have made over the last few years in my campervan. The data for each track is to be found in a separate tiddler, tagged ‘Trips’.

<$list filter="[tag[Trips]]">
<$checkbox tag="selected" > {{!!title}} <br></$checkbox>
</$list> 

<$geomap
state=<<qualify "$:/state/trips-map">>
	startPosition="bounds">
<$list filter="[tag[selected]]">
<$geolayer json={{!!text}} color={{!!color}} popupTemplate="ui/PopupTemplateTracks"/>
</$geomap> 

I want be able to click in any track on the map and have the popup window show the caption field of the particular data tiddler.

I have tried the following code

<div width="300px">
<$let currentTiddler="MyFirstTrip">
<$text text={{{ [<currentTiddler>get[caption]] }}}/>
</$let>
</div>

and this works for MyFirstTrip but I need to modify this code so that it each popup shows the appropriate caption.

Please can anyone help because I am stumped!!

Cheers, Rob

Beyond the Black Stump :laughing:

You have to visit me near Braidwood one day :smiley:

Thanks for the kind invitation. I will get in touch if I decide to visit the other side of the planet!

But, do you have an answer to my question?

I tried wrapping the $let routine with a $list filter but that did not give the desired result!

Cheers, Rob

@Rob_Jopling, I think the Geospatial plugin may be fairly niche even among power users, which may be limiting the suggestions people feel comfortable making. If you can share a simple test wiki (e.g. on tiddlyhost.com) with the relevant tiddler(s) preloaded, it’d make it much easier for people to help you.

1 Like

Hi @etardiff

I have done as you suggested and have uploaded an example to Tiddlyhost https://geofeature-popup-example.tiddlyhost.com

I hope that someone might be able to help me.

Cheers, Rob

Hi all

You will see if you go to
the example posted on Tiddlyhost
that I solved the issue by modifying the ‘name’ properties in the geojson file to give the desired popup text

Here is the code in the PopupTemplate

<div width="300px">
<$let popuptext={{{ [<feature>jsonget[properties],[name]] }}} >
<$text text=<<popuptext>>/>
</$let>
</div>

This does present problems in larger geojson files which have multiple features each with their own properties. To avoid this I have found that combining the individual gpx files in GPSBabel and exporting as a geojson, produces a file with a single feature.

But, if anyone has an alternative to the above by using a caption field in the data tiddler please let me know.

I hope all this makes sense and will help others.

Cheers, Rob