Welcome to the LimeSurvey Community Forum

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

Ability to add Google Maps as a question

  • gacquier
  • gacquier's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 11 months ago #59554 by gacquier
Hi,

I read on This change list page

Changes from 1.90 to 1.91beta (build 9631)
(...)
+New feature: Ability to add Google Maps as a question (parajulik)


Along with some other references to google maps API deals.

However, I could not figure out how to activate this "ability".

Would any one of you know what it's all about ?

Thanks in advance for your awnsers :) !
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 11 months ago #59587 by DenisChenu
Replied by DenisChenu on topic Ability to add Google Maps as a question
:laugh:

I found it now : short text

(in french : texte court)

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.
  • gacquier
  • gacquier's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #59820 by gacquier
Replied by gacquier on topic Ability to add Google Maps as a question
Great, short text is the place to find it.

For my solution to work, I needed to modify survey_runtime.js to add map.enablegooglebar after the GMAP2 instanciation.

Thanks a lot for helping me !
Géraud
The topic has been locked.
  • transportation_researcher
  • transportation_researcher's Avatar
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago - 12 years 9 months ago #61762 by transportation_researcher
Replied by transportation_researcher on topic Ability to add Google Maps as a question
Hi,

I've been searching all over the web to use this feature and still don't know how to enable it.

I would like to add google maps into a question where respondents can pin point their frequent locations and provide me a reading of the longitude/latitudes of the selected points.

I'm having difficulties trying to utilize this feature and it may be because of my lack of experience using javascript and APIs. Is there documentation that'll show me how to insert the Google Map API script into the advance editing question box and record lat/longs.

Do I find this in Short text? (I checked out the website and don't understand what its used for or how it will help me)

What is GMAP2 instantiation?

Why and where do I modify survey settings to allow for google maps to be embedded in the questions?

For my solution to work, I needed to modify survey_runtime.js to add map.enablegooglebar after the GMAP2 instanciation.


This feature would be very useful for me and any help would be great!
Thanks in Advance
Last edit: 12 years 9 months ago by transportation_researcher.
The topic has been locked.
  • transportation_researcher
  • transportation_researcher's Avatar
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago #61764 by transportation_researcher
Replied by transportation_researcher on topic Ability to add Google Maps as a question
I am using Version 1.91 if this needs to be known
The topic has been locked.
  • transportation_researcher
  • transportation_researcher's Avatar
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago #61765 by transportation_researcher
Replied by transportation_researcher on topic Ability to add Google Maps as a question
I figured out what short text means in this topic, duh!

I've tried using the map service feature and I'm not getting anything when testing the question. Since I've just figured this out, it may just take me some time to play around with the settings and making sure I have the right plug-ins.

Again any suggestions or hints would be useful.
The topic has been locked.
  • gacquier
  • gacquier's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago #61767 by gacquier
Replied by gacquier on topic Ability to add Google Maps as a question
Hi transportation researcher !

In the general parameters (the tools button on the upper part of the screen, you will find a place to paste your google maps API key.

Then, create a short text question.
You should find an "advanced parameters" section in the question parameters. In this section, you will find an option like "use map service". Other options let you define the map size, etc... The default place field has to be filled with the defaut LAT/LON position, like 44.8403 2.4609 for example.

I hope this will be helpful.
I am off this week end, don't be surprised to have more help.

Good luck :-)
Another transportation research

PS : the solution I propose dealing with changing some code is just a way to look for a place before placing the pin. I guess it's not usefull in your case.
:)
The topic has been locked.
  • transportation_researcher
  • transportation_researcher's Avatar
  • Offline
  • New Member
  • New Member
More
12 years 9 months ago #61893 by transportation_researcher
Replied by transportation_researcher on topic Ability to add Google Maps as a question
Thanks gacquier!

I got the map service working now. The issue was Internet Explorer was not allowing the API to function in a secured site (https://). Everytime I tested the page I got a warning message asking if I want to view content that was delivered securely (e.g. not the Google Map API). Because of habit, I don't read security messages and always just click yes. After reading the warning more carefully and what it means exactly, I gave myself a palm to the forehead.
This may be an issue when I administer the survey to the participants. I may add a message before the question page to tell them to click no to utilize the mapping service.

I would like to follow your direction in changing the code so that participants would be able to add a postal address before placing a pin. Is that pretty easy to do? I've been searching in how to modify the survey_runtime.js and seeing if I can mimic your steps, but I'm not having any luck. If this requires turning off the Xss filter then I would not be able to do so because I'm not a "super administrator". Again thanks for your help!

~lance
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 9 months ago #61946 by tpartner
Replied by tpartner on topic Ability to add Google Maps as a question
To enable the Google Search in the map:

In /scripts/survey_runtime.js, find this line
Code:
map.addControl(new GSmallMapControl());

And add this line right after it
Code:
map.enableGoogleBar();

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: mfpereira
The topic has been locked.
More
11 years 7 months ago #83669 by jmorant
Replied by jmorant on topic Ability to add Google Maps as a question
Hi everybody,

This is an old post but I fits quite well to what I'm looking for.

I want to enable a search field to the map so I can write the address I want to be geocoded. I'm working in a project in which we use limesurvey through Android Tablets and it's quite difficult to navegate through the map without this "search field".

I'm trying to add the line of code that "tpartner" said but I can't find :
Code:
map.addControl(new GSmallMapControl());
in /scripts/survey_runtime.js

I'm using Limesurvey 1.92+.

Thank you so much.
The topic has been locked.
  • gacquier
  • gacquier's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 7 months ago #83671 by gacquier
Replied by gacquier on topic Ability to add Google Maps as a question
Our installation was on Version 1.91RC6 Build 9986...

Not sure if it's the same solution in later versions...
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 7 months ago - 11 years 7 months ago #83683 by tpartner
Replied by tpartner on topic Ability to add Google Maps as a question
As far as I know, for V3 of the maps API, there is no googleBar available.

Some insight here - code.google.com/p/gmaps-api-v3-googlebar/

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 11 years 7 months ago by tpartner.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose