{% embed 'network/widget/widget.html.twig' %}
{% block content %}
{% if
profile.geolocation
and (profile.profileType == 'company'
or (user is defined and user.id is defined and user.id == profile.id)) %}
<div class="aspect-w-16 aspect-h-9 lg:aspect-w-1 lg:aspect-h-1"
data-controller="leaflet"
data-leaflet-options-value="{{ {
center: [profile.geolocation.latitude, profile.geolocation.longitude],
zoom: 12
}|json_encode }}"
data-leaflet-marker-value="{{ [
{
geolocation: [profile.geolocation.latitude, profile.geolocation.longitude],
color: profile.color.hex,
title: profile.name,
text: profile.street ~ ' ' ~ profile.housenumber ~ '<br>' ~ profile.postalCode
~ ' '
~ profile.city
~ '<br>'
~ (profile.country|country_name)
}
]|json_encode }}">
<template data-leaflet-target="markerTemplate">
<b>%title%</b><br />
<span>%text%</span><br />
</template>
<div class="w-full h-full map" data-leaflet-target="map"></div>
</div>
{% endif %}
{% endblock %}
{% endembed %}