0

I have a shapefile with points, and for each point I have an associated image in a folder. I'm trying to display the image as map tips, and followed the simple procedure described by Nathan Woodrow in his blog.

The map tips work well, but the small window that pops up is relatively small by default, and it only shows the top left corner of the image. It has horizontal and vertical scroll bars, but ideally I would like to show a larger pop-up window with each image automatically resized so it fits in.

Does anybody know how to do this?

1

You can use CSS styles, though it seems there is a maximum maptip box size, that I don't know if/how it can be overridden. In my case it is about 1/2 of the display width.

First, you could either set the map tip body size - with the ! modifier as this size is defined elsewhere in QGIS code. Alternatively, you can define a div (or any other tag) with the desired size. The example below has both, with a size of 800 pixels

Then you can set the img max-size. Doing so allows having smaller images without issues:

<style>
   body {width:800px!;}

   div {width:800px;}

   img { width:100%; max-width:500px; }

</style>

<div>
   <img src = 'D:\path to\my image.jpg'>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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