06/11 Fixed minimap not displayed in inspection
This commit is contained in:
@@ -514,18 +514,19 @@
|
|||||||
{% if current_user.role in ['admin', 'director'] and inspection.submit_latitude and inspection.submit_longitude %}
|
{% if current_user.role in ['admin', 'director'] and inspection.submit_latitude and inspection.submit_longitude %}
|
||||||
{% set _lat = inspection.submit_latitude | float %}
|
{% set _lat = inspection.submit_latitude | float %}
|
||||||
{% set _lng = inspection.submit_longitude | float %}
|
{% set _lng = inspection.submit_longitude | float %}
|
||||||
{% set _maps_key = config.get('GOOGLE_MAPS_API_KEY', '') %}
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<div class="lbl mb-1" style="font-size:.72rem;color:#94a3b8;font-weight:500;text-transform:uppercase;letter-spacing:.04em;">
|
<div class="lbl mb-1" style="font-size:.72rem;color:#94a3b8;font-weight:500;text-transform:uppercase;letter-spacing:.04em;">
|
||||||
<i class="bi bi-geo-alt-fill text-danger me-1"></i>Submission Location
|
<i class="bi bi-geo-alt-fill text-danger me-1"></i>Submission Location
|
||||||
</div>
|
</div>
|
||||||
{% if _maps_key %}
|
|
||||||
<div style="border-radius:10px;overflow:hidden;border:1px solid #e2e8f0;max-width:420px;">
|
<div style="border-radius:10px;overflow:hidden;border:1px solid #e2e8f0;max-width:420px;">
|
||||||
<img src="https://maps.googleapis.com/maps/api/staticmap?center={{ _lat }},{{ _lng }}&zoom=15&size=420x220&maptype=roadmap&markers=color:red%7C{{ _lat }},{{ _lng }}&key={{ _maps_key }}"
|
<iframe
|
||||||
alt="Submission location map"
|
src="https://maps.google.com/maps?q={{ _lat }},{{ _lng }}&z=15&output=embed"
|
||||||
style="width:100%;display:block;">
|
width="420" height="220"
|
||||||
|
style="border:0;display:block;width:100%;"
|
||||||
|
allowfullscreen="" loading="lazy"
|
||||||
|
referrerpolicy="no-referrer-when-downgrade">
|
||||||
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
<div class="mt-1" style="font-size:.8rem;color:#64748b;">
|
<div class="mt-1" style="font-size:.8rem;color:#64748b;">
|
||||||
{{ '%.6f' | format(_lat) }}, {{ '%.6f' | format(_lng) }}
|
{{ '%.6f' | format(_lat) }}, {{ '%.6f' | format(_lng) }}
|
||||||
<a href="https://www.google.com/maps?q={{ _lat }},{{ _lng }}" target="_blank"
|
<a href="https://www.google.com/maps?q={{ _lat }},{{ _lng }}" target="_blank"
|
||||||
|
|||||||
Reference in New Issue
Block a user