Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Prefill map information from token

  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 4 months ago #178294 by tammo
Prefill map information from token was created by tammo
I want to define a question that presents the respondent with a map that is based on information from the token table.

For example: from people we know here they have a machine. We want to show a map where we think that the machine is. And then ask them if this position is correct.

I hoped to do this with a short tect question, map display. But using Open Street Maps I cannot show a pin, based on known lat/long values from the token. Or can I?

Thanks in advance,

Tammo ter Hark


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 4 months ago #178295 by tammo
Replied by tammo on topic Prefill map information from token
We tried this:

<script>L.marker([52.15516, 5.38721]).addTo(document.getElementById("#map_727693X677X5661"));</script>

In the field of the question, but to no avail.

We hope to get the lat/long from tokens


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 4 months ago #178296 by tammo
Replied by tammo on topic Prefill map information from token
Trying to add token attributes to default location also did not work.

See attached image: TOKEN:ATTRIBUTE_1 IS Latitude AND TOKEN:ATTRIBUTE_2 is Longitude in Token table. Of course I filled them with values that represent a position that is known.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago - 5 years 4 months ago #178312 by DenisChenu
Replied by DenisChenu on topic Prefill map information from token

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 4 months ago by DenisChenu.
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 4 months ago #178315 by tammo
Replied by tammo on topic Prefill map information from token
Hi Denis,

thank you. I can have the right map centered around a predefined center, but I have not yet been able to place a marker and to prefill the default location from:

{TOKEN:ATTRIBUTE_1} (latitude)
{TOKEN:ATTRIBUTE_2} (longitude)

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #178316 by DenisChenu
Replied by DenisChenu on topic Prefill map information from token
Yes, but it **must** work … exactly yhe way you set it …
we process string in qanda (if current is not set)

Maybe as a workaround : you can test if it work in default value ?

The test here : github.com/LimeSurvey/LimeSurvey/blob/0c...nda_helper.php#L3163 seems strange : i think it must be == 1 and not == 0

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 4 months ago #178317 by tammo
Replied by tammo on topic Prefill map information from token


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago - 5 years 4 months ago #178324 by DenisChenu
Replied by DenisChenu on topic Prefill map information from token
Best with 10 10 for token attribue ;) (more clear).

Did you try the workaround ?

Maybe time to report issue ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 4 months ago by DenisChenu.
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 4 months ago #178327 by tammo
Replied by tammo on topic Prefill map information from token
Thank you for lookin into this. I filled in 52 and 5 now, not 10 10, because that may be somewhere in the ocean.

What do you mean by DEFAULT?

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 4 months ago #178328 by tammo
Replied by tammo on topic Prefill map information from token
survey.toolsforresearch.com/index.php/368136?lang=en
Token = Demo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #178331 by holch
Replied by holch on topic Prefill map information from token
By the way: The token is not "Demo", but "demo"...

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #178332 by holch
Replied by holch on topic Prefill map information from token
When using the default value there is not pin. When I insert latitude and longitude in to the boxes, the pin appears.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose