templates/_parts/infrastructure/_infrastructure-map.html.twig line 1

Open in your IDE?
  1. {% if true %}
  2.     {# <img src="{{ vich_uploader_asset(settings(), 'imageFile') }}" alt=""> #}
  3.     {# {{ vich_uploader_asset(settings(), 'imageFile') }} #}
  4.     <div class="project-map"
  5.          data-project-map
  6.          data-lat="{{ infrastructureSettings.addressLat }}"
  7.          data-lng="{{ infrastructureSettings.addressLng }}"
  8.          data-zoom="15"
  9.             {% if vich_uploader_asset(infrastructureSettings, 'imageFile') %}
  10.                 data-icon="{{ vich_uploader_asset(infrastructureSettings, 'imageFile') }}"
  11.             {% endif %}
  12.             {# data-color="{$project->map_icons_color}" #}
  13.     >
  14.         <div class="project-map__bg"></div>
  15.         {# {* Карта рендерится тут *} #}
  16.         <div class="project-map__canvas" style="height: 70vh" data-project-map-canvas></div>
  17.         {# {* Это хинт при наведении на проект на карте *} #}
  18.         {# {* Внутренности этого блока будут отображаться на карте *} #}
  19.         <div class="project-map__hint-container">
  20.             <div class="project-map__project-hint" data-project-map-hint>
  21.                 {# <div class="project-map__project-hint-image-wrap"> #}
  22.                 {# {% if settings().image %} #}
  23.                 {# {% include '_parts/image/adaptive-image.html.twig' with { #}
  24.                 {# object: settings(), #}
  25.                 {# field: 'imageFile', #}
  26.                 {# size: 'infrastructure_thumb', #}
  27.                 {# alt: 'PRIME', #}
  28.                 {# class: 'project-map__image', #}
  29.                 {# classPicture: 'project-map__picture', #}
  30.                 {# } %} #}
  31.                 {# {% endif %} #}
  32.                 {# </div> #}
  33.                 <div class="project-map__project-hint-text-wrap">
  34.                     <div class="project-map__project-hint-title text__mini">
  35.                         {# TODO: change name to local project name - add to settings - и вообще пофиксить - ничего не работает. или забить. хз #}
  36.                         
  37.                         {% if settings().projectName %}
  38.                             {{ settings().projectName }}
  39.                         {% endif %}
  40.                     </div>
  41.                 </div>
  42.             </div>
  43.         </div>
  44.         {# {* Объекты выводятся тут *} #}
  45.         <div class="project-map__objects" data-project-map-objects>
  46.             {% for infrastructureItem in infrastructureItems %}
  47.                 {% set infraType = infrastructureItem.type.icon %}
  48.                 {% set infraIconPath =  asset('images/infrastructure-icons/infrastructure-icon-'~ infraType ~'.svg') %}
  49.                 {# {* Описание объекта *} #}
  50.                 <div
  51.                         data-project-map-object
  52.                         data-lat="{{ infrastructureItem.addressLat }}"
  53.                         data-lng="{{ infrastructureItem.addressLng }}"
  54.                         data-category=""
  55.                         data-name="{{ infrastructureItem.name }}"
  56.                         data-icon="{{ url('infrastructure-icons:icon', {'type': infraType}) }}"
  57.                         data-icon-hover="{{ url('infrastructure-icons:icon-negative', {'type': infraType}) }}"
  58.                         {# {* Важно - цвет ниже обязательно обрабатываем через urlencode *} #}
  59.                         {# {if $project->map_icons_color}data-color="{$project->map_icons_color|urlencode}"{/if} #}
  60.                 >
  61.                     {# {* Возможно, тут будет контент балуна, пока не реализовано *} #}
  62.                 </div>
  63.             {% endfor %}
  64.         </div>
  65.     </div>
  66. {% endif %}