2

I'm using QR-Codes generated dynamically inside an HTML element on the atlas-maps in QGIS. The map has the id:map2 and the QR-code gives the quickest route to this place using Google Maps. This works fine, but in an atlas sometimes the QR-code does not reflect the actual map center, it stays with the QR-code of the former map, so that users are dirrected to the wrong place.

Is there a way to force QGIS to do a refresh of the HTML-code after the map has changed? Here the code I use inside the HTML element (the project SRID is EPSG:3857 and it needs to be transformed to EPSG:4326 for Google Maps):

<img src = 
"[% 'http://api.qrserver.com/v1/create-qr-code/?size=350x350&margin=5&data=url_quote
(''https%3A%2F%2Fwww.google.com%2Fmaps%2Fdir%2F%3Fapi%3D1%26basemap%3Dsatellite%26destination%3D'
||y(transform(map_get( item_variables( 'map2'), 'map_extent_center' ),'EPSG:3857', 'EPSG:4326')) 
||'%2C' 
||x(transform(map_get( item_variables( 'map2'), 'map_extent_center' ),'EPSG:3857', 'EPSG:4326'))%]"
style="width: auto; height: 100%; display: block; margin: 0px 0px 0px auto;"
/>

Even with the 'QR Barcode Layout Item' from the QGIS Plugins Repository I had this issue.

2

1 Answer 1

0

You could create a QGIS Python Expression function and call it inside a HTML label.

Install the Python library qrcode first: pip install qrcode

import qrcode
import base64
from io import BytesIO

@qgsfunction(args='auto', group='Custom', referenced_columns=[], usesgeometry=False)
def makeQR(url, width, feature, parent):
    """
    Create a QR-Code HTML image
    <h2>Example usage:</h2>
    <ul>
      <li>makeQR('https://www.qgis.org','150px')</li>
      <li><img style="width:150px" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAFKAUoBAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6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save(buffered, format="JPEG")
    img = base64.b64encode(buffered.getvalue()).decode('UTF-8')
    html = f'<img width="{width}" src="data:image/jpeg;base64,{img}"/>'
    return html

enter image description here

Your Answer

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

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