Re: [tw5] Re: How to use a field value in a json string?

2020-03-09 Thread Sylvain Comte
Hi,

Glad you found a way to go. I was disconnected this weekend, so I didn't
see your messages...

I'll take a deeper look at this to avoid TW crash. When I got time :-/

cheers,

*Sylvain*
@sycom


On Sun, Mar 8, 2020 at 6:12 PM Beckstrom  wrote:

> after a whole lot of troubleshooting, I think i figured out what was
> causing this weirdness! my server was set to lazy-load all, including
> tiddlers, and that seems to have been messing with this plugin.
>
> I disabled lazy-loading for tiddlers and this is now working great! thanks
> for your help!
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/J2yT7nqCF4g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/04e2e77e-ffb6-4fee-8daa-72bf44279f08%40googlegroups.com
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAOWAUqGBKwDyuBLzLcZohbAe8XLEf1hugpdivBjXV%3Di%3DqaVR4Q%40mail.gmail.com.


[tw5] Re: How to use a field value in a json string?

2020-03-08 Thread Beckstrom
after a whole lot of troubleshooting, I think i figured out what was causing 
this weirdness! my server was set to lazy-load all, including tiddlers, and 
that seems to have been messing with this plugin.

I disabled lazy-loading for tiddlers and this is now working great! thanks for 
your help!

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/04e2e77e-ffb6-4fee-8daa-72bf44279f08%40googlegroups.com.


[tw5] Re: How to use a field value in a json string?

2020-03-06 Thread Beckstrom
So I think I spoke too soon... there's something weird going on, strange 
behavior. Here's what happens:

- I create a tiddler with a field called "point" and set the value to 
something like 24,-82
- I save the tiddler
- I can see the map, and there is a marker at the lat/long I specified
- If I close the tiddler and re-open it, it works fine (map appears as 
expected)
- But if I either reload the wiki (from the "reload" button in the sidebar) 
or refresh the page or in any way view that same tiddler again, I get a 
javascript error popup.

It says:

Internal JavaScript Error
Well, this is embarrassing. It is recommended that you restart TiddlyWiki 
by refreshing your browser
TypeError: flds.text is undefined

Looking in the javascript console, I see:

TypeError: flds.text is undefined line 15899 > eval:506:25 
 eval>
mapTiddler $:/plugins/sycom/leaflet/mapWidget.tid:506
mapPlaces $:/plugins/sycom/leaflet/mapWidget.tid:228
execute $:/plugins/sycom/leaflet/mapWidget.tid:188
render $:/plugins/sycom/leaflet/mapWidget.tid:69
renderChildren $:/core/modules/widgets/widget.js:391
render $:/core/modules/widgets/list.js:300
renderChildren $:/core/modules/widgets/widget.js:391
     etc ... ..

Any idea what might be causing this?

On Friday, March 6, 2020 at 10:34:03 AM UTC-5, Sycom wrote:
>
> Hi Beckstrom,
>
> if your tiddler is actually a geoTiddler (i.e. it has at least one point(s), 
> line(s), polygon(s), place or geojson field) it should automatically 
> display a map at the bottom of the tiddler.
>
> This behaviour is defined through the 
> $:/plugins/sycom/leaflet/templates/geoTiddler tiddler. You may edit this 
> one to modify default appearance of the map or disable it.
>
> I'm not sure how your wiki works or what you want to do. If you have 
> geoTiddlers you can map them directly :
>
> <$leafmap places='{"tiddler":"Belgium"}' />
>
>
> or through a filter
>
> <$leafmap places='{"filter":"[tag[country]tag[Europe]]"}' />
>
>
> Due to leaflet map widget syntax, I'm afraid that "dynamic call" should be 
> made through macros you will have to define locally or globally (see 
> https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText). Very unsure 
> about your success with this strategy since the plugin was not designed for 
> this...
>
> If this is not the behaviour you expected, feel free to share (a part of) 
> your wiki and describe what you want to achieve. I have not much time now 
> since I just started a new job, but I will try to help you asap.
>
> cheers,
>
> Sylvain
> @sycom
>
>
> Le vendredi 6 mars 2020 13:53:41 UTC+1, Beckstrom a écrit :
>>
>> Hi all, 
>>
>> First of all this is probably the most awesome and useful piece of 
>> software I’ve ever used. I love it! 
>>
>> I’ve been trying to figure out how to include a map automatically in any 
>> tiddler that is a “place,” for instance “starbucks on main” or “Belgium.” 
>> I’ve been trying to use the Leaflet Maps plugin from here: 
>> http://sycom.github.io/TiddlyWiki-Plugins/ 
>>
>> According to the docs, if you add a field called “point” or “points” and 
>> put a comma separated list of the lat/lon(eg 45.3347,-85.72882) you can 
>> access the field and generate the map 
>>
>> It works if I hardcore latitude and longitude when I call the widget, 
>> like this: 
>>
>> <$leafmap tile='sat' 
>> places='{"point":"6.5,19.72" /> 
>>
>>  but i can’t figure out how to dynamically access the “point” field for 
>> tiddlers. I’ve tried all sorts of things, such as 
>>
>> <$leafmap tile='sat' 
>> places='{"point":"{{!!point}}" /> 
>>
>> It seems like no matter what i do, the variable is not expanded because 
>> of the double quotes inside the json. 
>>
>> Any idea how I could make this work? Please and thanks in advance for 
>> your help!! 
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/503be83b-502d-46e3-b144-7682e0037c16%40googlegroups.com.


[tw5] Re: How to use a field value in a json string?

2020-03-06 Thread TonyM
Folks a slight diversion.

I am a keen user of what3words which has a three word name for every 3m x 
3m square on earth. One advantage is the location is easy to read, 
available in multiple locations and can be easily shared by voice over the 
phone, with other share options available.

There are API's and mapping available and this would integrate well with 
tiddlywiki and leaflet. Happily each location tiddler can be named with a 
location name eg; guard.cling.radio

https://w3w.co/guard.cling.radio
This 3 word address refers to an exact 3m x 3m location. Tap the link or 
enter the 3 words into the *free what3words app* to find it.

Regards
Tony

On Friday, March 6, 2020 at 11:53:41 PM UTC+11, Beckstrom wrote:
>
> Hi all, 
>
> First of all this is probably the most awesome and useful piece of 
> software I’ve ever used. I love it! 
>
> I’ve been trying to figure out how to include a map automatically in any 
> tiddler that is a “place,” for instance “starbucks on main” or “Belgium.” 
> I’ve been trying to use the Leaflet Maps plugin from here: 
> http://sycom.github.io/TiddlyWiki-Plugins/ 
>
> According to the docs, if you add a field called “point” or “points” and 
> put a comma separated list of the lat/lon(eg 45.3347,-85.72882) you can 
> access the field and generate the map 
>
> It works if I hardcore latitude and longitude when I call the widget, like 
> this: 
>
> <$leafmap tile='sat' 
> places='{"point":"6.5,19.72" /> 
>
>  but i can’t figure out how to dynamically access the “point” field for 
> tiddlers. I’ve tried all sorts of things, such as 
>
> <$leafmap tile='sat' 
> places='{"point":"{{!!point}}" /> 
>
> It seems like no matter what i do, the variable is not expanded because of 
> the double quotes inside the json. 
>
> Any idea how I could make this work? Please and thanks in advance for your 
> help!! 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/01c51f44-1099-4fe4-a021-d24684921bc2%40googlegroups.com.


[tw5] Re: How to use a field value in a json string?

2020-03-06 Thread Beckstrom
Aha, thank you so much for the reply! I'm not sure what happened but this 
*seems* to be working now after a reinstall of the plugin. I think I maybe 
messed up the original view template.

At any rate, this seems to be working for my wiki now. Thanks for your 
help, and for creating such a cool plugin!

On Friday, March 6, 2020 at 10:34:03 AM UTC-5, Sycom wrote:
>
> Hi Beckstrom,
>
> if your tiddler is actually a geoTiddler (i.e. it has at least one point(s), 
> line(s), polygon(s), place or geojson field) it should automatically 
> display a map at the bottom of the tiddler.
>
> This behaviour is defined through the 
> $:/plugins/sycom/leaflet/templates/geoTiddler tiddler. You may edit this 
> one to modify default appearance of the map or disable it.
>
> I'm not sure how your wiki works or what you want to do. If you have 
> geoTiddlers you can map them directly :
>
> <$leafmap places='{"tiddler":"Belgium"}' />
>
>
> or through a filter
>
> <$leafmap places='{"filter":"[tag[country]tag[Europe]]"}' />
>
>
> Due to leaflet map widget syntax, I'm afraid that "dynamic call" should be 
> made through macros you will have to define locally or globally (see 
> https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText). Very unsure 
> about your success with this strategy since the plugin was not designed for 
> this...
>
> If this is not the behaviour you expected, feel free to share (a part of) 
> your wiki and describe what you want to achieve. I have not much time now 
> since I just started a new job, but I will try to help you asap.
>
> cheers,
>
> Sylvain
> @sycom
>
>
> Le vendredi 6 mars 2020 13:53:41 UTC+1, Beckstrom a écrit :
>>
>> Hi all, 
>>
>> First of all this is probably the most awesome and useful piece of 
>> software I’ve ever used. I love it! 
>>
>> I’ve been trying to figure out how to include a map automatically in any 
>> tiddler that is a “place,” for instance “starbucks on main” or “Belgium.” 
>> I’ve been trying to use the Leaflet Maps plugin from here: 
>> http://sycom.github.io/TiddlyWiki-Plugins/ 
>>
>> According to the docs, if you add a field called “point” or “points” and 
>> put a comma separated list of the lat/lon(eg 45.3347,-85.72882) you can 
>> access the field and generate the map 
>>
>> It works if I hardcore latitude and longitude when I call the widget, 
>> like this: 
>>
>> <$leafmap tile='sat' 
>> places='{"point":"6.5,19.72" /> 
>>
>>  but i can’t figure out how to dynamically access the “point” field for 
>> tiddlers. I’ve tried all sorts of things, such as 
>>
>> <$leafmap tile='sat' 
>> places='{"point":"{{!!point}}" /> 
>>
>> It seems like no matter what i do, the variable is not expanded because 
>> of the double quotes inside the json. 
>>
>> Any idea how I could make this work? Please and thanks in advance for 
>> your help!! 
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/dcf41aca-a517-4a26-85bc-59d8f56059d7%40googlegroups.com.


[tw5] Re: How to use a field value in a json string?

2020-03-06 Thread Sycom
Hi Beckstrom,

if your tiddler is actually a geoTiddler (i.e. it has at least one point(s), 
line(s), polygon(s), place or geojson field) it should automatically 
display a map at the bottom of the tiddler.

This behaviour is defined through the 
$:/plugins/sycom/leaflet/templates/geoTiddler tiddler. You may edit this 
one to modify default appearance of the map or disable it.

I'm not sure how your wiki works or what you want to do. If you have 
geoTiddlers you can map them directly :

<$leafmap places='{"tiddler":"Belgium"}' />


or through a filter

<$leafmap places='{"filter":"[tag[country]tag[Europe]]"}' />


Due to leaflet map widget syntax, I'm afraid that "dynamic call" should be 
made through macros you will have to define locally or globally (see 
https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText). Very unsure 
about your success with this strategy since the plugin was not designed for 
this...

If this is not the behaviour you expected, feel free to share (a part of) 
your wiki and describe what you want to achieve. I have not much time now 
since I just started a new job, but I will try to help you asap.

cheers,

Sylvain
@sycom


Le vendredi 6 mars 2020 13:53:41 UTC+1, Beckstrom a écrit :
>
> Hi all, 
>
> First of all this is probably the most awesome and useful piece of 
> software I’ve ever used. I love it! 
>
> I’ve been trying to figure out how to include a map automatically in any 
> tiddler that is a “place,” for instance “starbucks on main” or “Belgium.” 
> I’ve been trying to use the Leaflet Maps plugin from here: 
> http://sycom.github.io/TiddlyWiki-Plugins/ 
>
> According to the docs, if you add a field called “point” or “points” and 
> put a comma separated list of the lat/lon(eg 45.3347,-85.72882) you can 
> access the field and generate the map 
>
> It works if I hardcore latitude and longitude when I call the widget, like 
> this: 
>
> <$leafmap tile='sat' 
> places='{"point":"6.5,19.72" /> 
>
>  but i can’t figure out how to dynamically access the “point” field for 
> tiddlers. I’ve tried all sorts of things, such as 
>
> <$leafmap tile='sat' 
> places='{"point":"{{!!point}}" /> 
>
> It seems like no matter what i do, the variable is not expanded because of 
> the double quotes inside the json. 
>
> Any idea how I could make this work? Please and thanks in advance for your 
> help!! 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7302965a-32aa-4709-ab95-2e73424a8f4d%40googlegroups.com.