2

Today is my second day of using a GIS software. I have imported latitude, longitudes from csv into QGIS. I want that whenever users click on any location, they can see a pop with info: Country and State only, not all the fields that I see now.

enter image description here

Also, I want to add a field that will contain a hyperlink. In addition, I want to that users see the locations' image post clicking (or hover over). For this I am following this tutorial, but not helpful. Working file is here.

1 Answer 1

2

Use Field Widgets to control what the user sees in the Attributes Form

Right click on layer name in Layer Panel > Properties > Attributes Form

For any fields you want to hide from the user, change the Widget Type to Hidden.

enter image description here

enter image description here

For a hyperlink, just add a text field and type the link into it.

For an image, use an Attachment Field Widget

Type the file path where it says Default Path, or put a unique file path in the field for each feature, and choose that field under data-defined settings.

enter image description here

8
  • I used a combination of Action and Toggle Editing mode to achieve the same. your method seems to be easier. Two questions: (1) How to put a unique file path in the field for each location ? The I am doing it is I right-click on the shape-file, and then Properties, then your view appears. But it seems like this path would be default for my every location. (2) If i share my project with another friend, will the image open if i send the images too ? I think it won't.
    – Ajeet
    Commented May 14, 2018 at 19:56
  • Put the file path in the field in the attribute table. You may need to add an additional field rather than using the same field that's setup with the "attachment" widget.
    – csk
    Commented May 14, 2018 at 20:13
  • Put all the images in the same file as the project, and use relative file paths. Then share the whole file, and your friend should be able to see the images.
    – csk
    Commented May 14, 2018 at 20:14
  • I have created a new field 'image path', and put 2 different images corresponding to 2 locations in the project folder.The screenshot is here bit.ly/2jWtlfh . Then I went to widgets > attachments > and entered paths , and selected relative paths, and then Document viewer as Image. See here please : bit.ly/2ICGwzN and bit.ly/2rJjI7V .. How do I see the image now ?
    – Ajeet
    Commented May 14, 2018 at 21:12
  • Also, is it possible to create a new column that contains hyperlink, and when viewers click on the location , they will get a pop-up with location details ( which we currently see) alongwith the new column with the "Clickable Hyperlink". Adding a text column is not useful when i have hundreds of locations and their corresponding hyperlinks
    – Ajeet
    Commented May 14, 2018 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.