Leaflet plugin leafmap

Is anyone else using the sycom leaflet plugin? Specifically I’m using it in the style of having each place as a tiddler and using the point field to add the points to the map. My problem is that there doesn’t seem to be a way to customize what value shows up in the popup when you close it. It seems to be hard-coded to the text field of the tiddler which I need to use for lots of other text that’s visible when using that tiddler for other non-map purposes. It looks like in other methods there’s a way to provide a description method but it doesn’t work for the tiddler methods.

Bit of a long-shot, but thought somebody else might’ve run across this before.

Here’s a screenshot if I have nothing in useful in the text field - no problem here, but when I add lots of text it makes the popup unusable…
image

Plugin: https://sycom.github.io/TiddlyWiki-Plugins/

See this post: Leaflet - CRS.Simple - #3 by jeremyruston
@jeremyruston seems to have a geospatial plugin in the works.

@ Jeremy. Is it ready for prime time?

Thanks @pmario I have been keeping an eye on that, but waiting until it was something I could add to my wiki - it appears I’d have to swap out the whole core - not sure if that’s easy or not. Per Jeremy’s warning:

Note that the Geospatial Plugin needs the associated custom version of the core, and will not work with the regular v5.3.2-prerelease.

I intend to go ahead and merge the Geospatial plugin soon. There’s still plenty of enhancements that I would like to explore, but I think at the moment the work is being held back by the difficulties end users face in order to integrate it into their own work.

The current obstacle is actually the testcase widget which is used by the Geospatial plugin to present live working examples. See the “docs” tab of the plugin. I want to spend a little more time harmonising it with the existing “innerwiki” widget. They both do a similar job, but the innerwiki widget is much heavier weight because it loads up an entire TiddlyWiki instance into an iframe. In contrast, the testcase widget just uses a lightweight embedded wiki object. That means that the testcase widget isn’t useful for CSS-based demos because it will share the same stylesheet as the parent wiki.

1 Like

@stobot I found the logic in the plugin that displays this popup. Likely need to request a software change. I changed $:/plugins/sycom/leaflet/mapWidget.tid to display the first 460 characters of the description field if it is defined and not empty. If the description field is missing or empty then the original logic in the plugin displays the text field (which renders it as wikitext). The code I added for the description does not wikify the text. Feel free to experiment with it. If you compare the original code with the attached, you’ll see what I did.

$__plugins_sycom_leaflet_mapWidget.tid.json (14.0 KB)

Hope this helps,

Craig

Great! I’ll check it out - thanks!

@stobot It appears I modified a version of this tiddler that is not exactly what is found in the plugin you pointed me at. So, I grabbed that source file from the link you provided and made the same change.

This will be easier to read—I did not compress/minimize the JavaScript.

$__plugins_sycom_leaflet_mapWidget.tid.json (31.5 KB)

I get the same results with either.

Craig

Thanks again @clsturgeon - finally back from holiday and was able to test it - works perfectly :+1:

I’m going to dig into the code more, one thing that I suspect will be a much harder change is to add permanent labels to the markers - I’ll see if I can figure out how to do it.

1 Like