Workflow for creating tiddlers with geoloctation-points for the leaflet plugin

329 views
Skip to first unread message

Jan Johannpeter

unread,
Sep 2, 2018, 4:26:43 PM9/2/18
to TiddlyWiki
Hello, hello Sylvain especially.
Since the geolocation-mechanism of the plugin now works and creates
points, I tried to make a create a workflow to create tiddlers with the
new geolocation-plugin.
https://www.szenio.de/Drehorte/ but it does not really work yet.



The button multiplication-problem has become a little more active and
somehow the leafletmacro causes an error.

Perhaps you find out why...

Jan


SylvainComte

unread,
Sep 3, 2018, 2:50:02 AM9/3/18
to TiddlyWiki
Hello Jan,

I worked a few hours on the macro last week but discovered it's trickier than I did expect. I think I will have to convert it to a plugin in order to prevent the multiplication problem (which I didn't wan't since I found this a bit "heavy").

For your workflow, I think you should use the "target" parameter of the macro (called "tiddler" for now). But I can't be sure it works since I didn't test it...

I will make a release of a new version of the macro during this week, but bugs will remain I'm affraid...

best regards

Sylvain

Jan

unread,
Sep 3, 2018, 5:31:25 AM9/3/18
to tiddl...@googlegroups.com
Salut sylvain,
great, please tell me when you did the update.
I am longing to test it.

yours Jan
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7d795fb0-fa78-4795-9cb5-59a26733d82b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

SylvainComte

unread,
Sep 7, 2018, 6:19:05 AM9/7/18
to TiddlyWiki
Hello Jan (and others of course)

I'm pleased to announce that the geolocation widget is now alive (it's no more a macro). The widget is included in the Leaflet Plugin but may also be installed alone since it doesn't require the leaflet library to work. Remember that due to security limitation, the widget will only work through https://

Get it from my collection : https://sycom.github.io/TiddlyWiki-Plugins/

best regards

Sylvain

Jan

unread,
Sep 7, 2018, 3:05:45 PM9/7/18
to tiddl...@googlegroups.com
Salut Sylvain.
Great! I will check that out at once.
Merci beaucoup!
Jan

TonyM

unread,
Sep 8, 2018, 12:35:17 AM9/8/18
to TiddlyWiki
Sylvain,

Thanks so much for this, it worked right out of the box on my android phone, with a prompt to access my geolocation.
I see a lot of potential for this. But some questions arrise
  • Can we make it happen on startup
  • How do we refresh the location as we move (with a click sure)
Also If I may draw yours and others attention to a great GeoLocation solution https://what3words.com/
  • I would love some help being able to translate the gps location to a W3W word
    • This needs plugins to support the w3w apis (Currently Outside my skill set)
  • I have some powerful Ideas I would like to bring into reality if we could do this
I would be keen to establish a Yammer group to discuss Geolocation see 

Geolocation SIG

at https://www.yammer.com/tiddlywiki and request an invite



Best wishes,
Regards
tony

SylvainComte

unread,
Sep 8, 2018, 2:03:34 PM9/8/18
to TiddlyWiki
Hello,

glad to see it works fine. I got some answers for you (not all though) right under your questions.

Regards,

Sylvain

Le samedi 8 septembre 2018 04:35:17 UTC, TonyM a écrit :
Sylvain,

Thanks so much for this, it worked right out of the box on my android phone, with a prompt to access my geolocation.
I see a lot of potential for this. But some questions arrise
  • Can we make it happen on startup
Not the widget, but for sure the code might be reused for being launched in a macro at startup. I wouldn't do this on my website, since i'm not a big fan of automatic launch for anything.
  • How do we refresh the location as we move (with a click sure)
For now the widget is not automatic. You will have to click again and again to store the points of your path. It would be possible to have an automatic GPS tracking, using watchPosition() instead of getCurrentPosition(). Not so hard to implement I guess with two alerts :
* Must take care of a stop button using clearWatch()
* Be aware that it may drain a battery
Also If I may draw yours and others attention to a great GeoLocation solution https://what3words.com/

Thanks for pointing this. A very interesting initiative.
  • I would love some help being able to translate the gps location to a W3W word
    • This needs plugins to support the w3w apis (Currently Outside my skill set)
I'm pretty sure it's not so hard to achieve once you got an API key using https://api.what3words.com/v2/reverse?coords=51.521251%2C-0.203586&lang=fr&key=MY-API-KEY and an xmlhttprequest() since the API support CORS. You should look into it, I learned code on my own resolving issues like this. By the way I don't think I will work on this now since Leaflet Plugin needs a lot more improvements and I don't have enough time for it already...

Sylvain Naudin

unread,
Sep 10, 2018, 5:16:12 PM9/10/18
to TiddlyWiki
Great Sylvain !!

If we where in French Discourse I'll put a red heart on post :D

Just tested online over https, it's quite good GPS position of my home with mobile phone. Very promising possibilities for OSM mapping party to collect data.

Notice that max zoom doesn't load OSM map, and have to de-zoom once to get tiles rendering request.

Thanks !
Sylvain

SylvainComte

unread,
Sep 12, 2018, 3:06:06 AM9/12/18
to TiddlyWiki
Hi Sylvain,

As I pretty much like hearts, I'll go for a post there ;-)

I also noticed that bug with osm tiles. Seems they've reduced zoom range for their tile provider. I should edit the json tile file...

cheers

Sylvain

Jan

unread,
Sep 24, 2018, 5:05:57 PM9/24/18
to tiddl...@googlegroups.com
Salut Sylvain, Hi everyboy!

The widget works, but I have two problems
-How can I force a site to open in https?
-I tried to make a mechanism to create a new LocationTiddler with a chosen Name

I made this Position_speichern(Save position) Tiddler here but I cannot fint out why it does set the point...

!<$geoloc target="Position" />
<$list filter="[all[current]has[point]] [all[current]has[points]] ">
<$edit-text tiddler="$:/temp/newloc" placeholder="Titel des neuen Ortes"/>
<$list filter="[{$:/temp/newloc}minlength[4]!is[tiddler]]">
<$button class="tc-btn-big-green"> Eintrag erzeugen
<$list filter="[[Position_speichern]has[point]]">
<$action-setfield $tiddler={{$:/temp/newloc}} $field="points" $value={{Position_speichern!!point}}/>
</$list>
<$list filter="[[Position_speichern]has[points]] ">
<$action-setfield $tiddler={{$:/temp/newloc}} $field="points" $value={{Position_speichern!!points}}/>
</$list>
<$action-navigate $to={{$:/temp/newloc}}/>
<$action-deletefield point points/>
</$button>
</$list>
</$list>

It can be found an tested here:
https://Szenio.de/geo

Greetings Jan

SylvainComte

unread,
Sep 25, 2018, 11:14:51 AM9/25/18
to TiddlyWiki
Hi Jan,

- I think you can force your site to use SSL by using .htaccess file
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


- If I get your mechanism
    * As you call <$geoLoc /> with "Position" target, the point is saved in a new tiddler called "Position",
    * so when you click on "Eintrag erzeugen", you copy the point field of "Position_speichern" (and not the one in Position you just stored) in your new tiddler.
but as often with tiddlywiki when using variables in variables there is something that broke up.

I suggest you something more straightforward :
<$edit-text tag="input"  tiddler="$:/temp/newloc" placeholder="Titel des neuen Ortes"/>
<$set name=target value={{$:/temp/newloc}} > <$geoloc target=<<target>> />
</$set>

You may enhance this with a dropdown list of geoTiddler you can pick-up (to complete them with new point)

cheers

Sylvain

Jan

unread,
Sep 25, 2018, 6:51:54 PM9/25/18
to tiddl...@googlegroups.com
Salut Sylvain,
Aaah,...but it is something else. The button does not work even though the point is already set.
Somehow setting the field does not work. I really do not know why.

I would like to use this indirect approach because by this means I can
-control the position on the map before creating a tiddler.
-automatically navigate to the new Tiddler.
-apply a tag ("like not exported yet") which i need to generate an export of the newly created entries via php.

Selfisch reasons...but necessary for me

Salut Jan

SylvainComte

unread,
Sep 26, 2018, 5:42:47 AM9/26/18
to tiddl...@googlegroups.com
Hello Jan,

Better understand your workflow now.

I made a short test to check something and discovered a new mystery, action-setfield works perfectly with almost any field name but not with point nor points (!?!)

maybe somebody more fluent in TiddlyWiki can explain this. Maybe the leaflet plugin break something or maybe just the template...

I found a workaround by separating button for "point" and button for "points"

<$edit-text tag=input tiddler="$:/temp/newloc" placeholder="Titel des neuen Ortes"/> <$geoloc />

<$list filter="[{$:/temp/newloc}minlength[4]!is[tiddler]]">
    <$set name=target value={{$:/temp/newloc}} >

<$list filter="[[Position_speichern]has[point]]">
    <$button class="tc-btn-big-green">
        Eintrag erzeugen point
        <$action-setfield $tiddler=<<target>> $field="point" $value={{!!point}} />
        <$action-navigate $to={{$:/temp/newloc}}/>
        <$action-deletefield point points/>
    </$button>
</$list>

<$list filter="[[Position_speichern]has[points]]">
    <$button class="tc-btn-big-green">
        Eintrag erzeugen points
        <$action-setfield $tiddler={{$:/temp/newloc}} $field="points" $value={{!!points}} />
        <$action-navigate $to={{$:/temp/newloc}}/>
        <$action-deletefield point points/>
    </$button>
</$list>

    </$set>
</$list>

Which seems to work. BUT something is wrong with leaflet plugin or geoTiddler template and clicking on the button will break the wiki :-/

More investigations needed...

Sylvain

Jan

unread,
Sep 26, 2018, 5:58:53 PM9/26/18
to tiddl...@googlegroups.com
Salut Sylvain,
thank you, I began to feel entirely stupid...it helps my psychic health that you encounter the same effect.
I already tried listops append and other tricks and broke the wiki...
It could help to have something like "basetitle" and "tags" in your widget like in create Tiddler.

Yours Jan




Am 26.09.2018 um 11:42 schrieb SylvainComte:
Hello Jan,

Better understand your workflow now.

I made a short test to check something and discovered a new mystery, action-setfield works perfectly with almost any field name but not with point nor points (!?!)

maybe somebody more fluent in TiddlyWiki can explain this. Maybe the leaflet plugin brake something or maybe just the template...

I found a workaround by separating button for "point" and button for "points"

<$edit-text tag=input tiddler="$:/temp/newloc" placeholder="Titel des neuen Ortes"/> <$geoloc />

<$list filter="[{$:/temp/newloc}minlength[4]!is[tiddler]]">
    <$set name=target value={{$:/temp/newloc}} >

<$list filter="[[Position_speichern]has[point]]">
    <$button class="tc-btn-big-green">
        Eintrag erzeugen point
        <$action-setfield $tiddler=<<target>> $field="point" $value={{!!point}} />
        <$action-navigate $to={{$:/temp/newloc}}/>
        <$action-deletefield point points/>
    </$button>
</$list>

<$list filter="[[Position_speichern]has[points]]">
    <$button class="tc-btn-big-green">
        Eintrag erzeugen points
        <$action-setfield $tiddler={{$:/temp/newloc}} $field="points" $value={{!!points}} />
        <$action-navigate $to={{$:/temp/newloc}}/>
        <$action-deletefield point points/>
    </$button>
</$list>

    </$set>
</$list>

Which seems to work. BUT something is wrong with leaflet plugin or geoTiddler template and clicking on the button will brake the wiki :-/

Jan

unread,
Oct 2, 2018, 7:41:26 AM10/2/18
to tiddl...@googlegroups.com
Salut Sylvain, Hi everyone.
meanwhile I built a php based mechanism to post locations recorded by the  to a server.
You can get the addons here and a tiny explanation here https://szenio.de/Geo/

@Sylvain: For some devices (My IPhone) I do not get gthe plugin to create geodata anymore.
Maybe the time-out is faster now than in the previous versions where the was no fail-message?


Yours Jan




Am 07.09.2018 um 12:19 schrieb SylvainComte:
Reply all
Reply to author
Forward
0 new messages