When using maps as part of your questionnaire, you can highlight specific places, routes or areas on the map and make them clickable. After clicking one of the objects, the respondent will see a pop-up window with content or questions. These features are called clickable map objects in Maptionnaire.
How to create clickable map objects?
Prepare your data
The objects that you want to make clickable need to be uploaded to Maptionnaire either in the GeoJSON or shapefile formats. The supported coordinate reference system for GeoJSONs is WGS84 (EPSG:4326) with the latitude and longitude units in decimal degrees. If you want to show different content in each pop-up window, you should save each object as a separate file and upload them to Maptionnaire one-by-one.
The next step depends on the function of the clickable map object in your questionnaire:
- If you do not want to collect data related to the location of the features, please move to Step #2.
If you want to record data related to the locations of each specific feature (e.g. by asking questions in the pop-ups), you need to make sure that each feature has an ID key. An ID key is any key within the file that is unique to the feature/location. You can determine the ID key that you want to use when you upload the shapefile or GeoJSON to Maptionnaire.
To find an identifier that can be used as your ID key, access the attribute table of your GeoJSON or shapefile. Remember to save that feature when exporting the file!
Upload your files to Maptionnaire
Once you have prepared your shapefiles, you need to upload them to the Maps section in Materials. For more information on how to do this, please see this article (for GeoJSONs) or this article (for shapefiles). As stated above, you need to name the ID key in this process.
Add the files to your questionnaire
After uploading the files to Materials, you can add them to your questionnaire. Go to the Maps tab in the main settings of your questionnaire. Add your GeoJSONs or shapefiles as Map overlays by clicking the text field next to the Map overlays text. A drop-down list with your GeoJSONs/shapefiles should appear. Select them one by one and decide on which pages of the questionnaire they will be shown. Remember that you also need a basemap on which the features will be layered.
Add the Clickable map object element to the questionnaire page
Now the GeoJSON/shapefile objects should be visible in your questionnaire, but you still need to make them clickable by activating them. Go to the page of the questionnaire on which you want to feature the clickable map objects. Add the Clickable map objects element from the element library. Select the GeoJSON/shapefil you want to use from the drop-down list that opens by clicking the empty text box below Map layer.
Create the content for the pop-up window
When the respondents click the clickable objects on the map they will see a pop-up window. To activate the pop-up window, click the three dots on the upper right corner of the element. Select Create pop-up and you will be taken to the editing mode of the pop-up window. Add questions and other elements from the element library. For more detailed instructions on creating and editing pop-up windows, please see this article.
Test before launching!
As always, remember to test your questionnaire before you start collecting data. It's good to check that the response data looks like it should.