var/cache/review/twig/fe/fe6ae84e185bac133a8df8c62c15d6de.php line 302

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* Map/page.html.twig */
  14. class __TwigTemplate_a28a045d3be3f3299f645cdfe29370c8 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->blocks = [
  23.             'title' => [$this'block_title'],
  24.             'metaDescription' => [$this'block_metaDescription'],
  25.             'stylesheet' => [$this'block_stylesheet'],
  26.             'name_page' => [$this'block_name_page'],
  27.             'bodyClasses' => [$this'block_bodyClasses'],
  28.             'mainContainer' => [$this'block_mainContainer'],
  29.             'javascripts' => [$this'block_javascripts'],
  30.         ];
  31.     }
  32.     protected function doGetParent(array $context)
  33.     {
  34.         // line 1
  35.         return "grid.html.twig";
  36.     }
  37.     protected function doDisplay(array $context, array $blocks = [])
  38.     {
  39.         $macros $this->macros;
  40.         $__internal_b91a4435ea3baf1e2b6bfda56133dace $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  41.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Map/page.html.twig"));
  42.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  43.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Map/page.html.twig"));
  44.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  45.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Map/page.html.twig"));
  46.         $this->parent $this->loadTemplate("grid.html.twig""Map/page.html.twig"1);
  47.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  48.         
  49.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  50.         
  51.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  52.         
  53.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  54.     }
  55.     // line 3
  56.     public function block_title($context, array $blocks = [])
  57.     {
  58.         $macros $this->macros;
  59.         $__internal_b91a4435ea3baf1e2b6bfda56133dace $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  60.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  61.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  62.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  63.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  64.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  65.         // line 4
  66.         echo "    ";
  67.         echo twig_escape_filter($this->env$this->extensions['App\Twig\SeoExtension']->metaTitle(), "html"nulltrue);
  68.         echo "
  69. ";
  70.         
  71.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  72.         
  73.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  74.         
  75.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  76.     }
  77.     // line 7
  78.     public function block_metaDescription($context, array $blocks = [])
  79.     {
  80.         $macros $this->macros;
  81.         $__internal_b91a4435ea3baf1e2b6bfda56133dace $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  82.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""metaDescription"));
  83.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  84.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""metaDescription"));
  85.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  86.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""metaDescription"));
  87.         // line 8
  88.         echo "    <meta name=\"description\" content=\"";
  89.         echo twig_escape_filter($this->env$this->extensions['App\Twig\SeoExtension']->metaDescription(), "html"nulltrue);
  90.         echo "\">
  91. ";
  92.         
  93.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  94.         
  95.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  96.         
  97.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  98.     }
  99.     // line 11
  100.     public function block_stylesheet($context, array $blocks = [])
  101.     {
  102.         $macros $this->macros;
  103.         $__internal_b91a4435ea3baf1e2b6bfda56133dace $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  104.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheet"));
  105.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  106.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheet"));
  107.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  108.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheet"));
  109.         // line 12
  110.         echo "    ";
  111.         $this->displayParentBlock("stylesheet"$context$blocks);
  112.         echo "
  113.     <link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css\">
  114. ";
  115.         
  116.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  117.         
  118.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  119.         
  120.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  121.     }
  122.     // line 16
  123.     public function block_name_page($context, array $blocks = [])
  124.     {
  125.         $macros $this->macros;
  126.         $__internal_b91a4435ea3baf1e2b6bfda56133dace $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  127.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""name_page"));
  128.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  129.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""name_page"));
  130.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  131.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""name_page"));
  132.         echo "map";
  133.         
  134.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  135.         
  136.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  137.         
  138.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  139.     }
  140.     // line 17
  141.     public function block_bodyClasses($context, array $blocks = [])
  142.     {
  143.         $macros $this->macros;
  144.         $__internal_b91a4435ea3baf1e2b6bfda56133dace $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  145.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""bodyClasses"));
  146.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  147.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""bodyClasses"));
  148.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  149.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""bodyClasses"));
  150.         echo "map-page";
  151.         
  152.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  153.         
  154.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  155.         
  156.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  157.     }
  158.     // line 18
  159.     public function block_mainContainer($context, array $blocks = [])
  160.     {
  161.         $macros $this->macros;
  162.         $__internal_b91a4435ea3baf1e2b6bfda56133dace $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  163.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""mainContainer"));
  164.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  165.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""mainContainer"));
  166.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  167.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""mainContainer"));
  168.         // line 19
  169.         echo "    ";
  170.         if ((array_key_exists("city"$context) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["city"]) || array_key_exists("city"$context) ? $context["city"] : (function () { throw new RuntimeError('Variable "city" does not exist.'19$this->source); })()), "mapCoordinate", [], "any"falsefalsefalse19), "latitude", [], "any"falsefalsefalse19))) {
  171.             // line 20
  172.             echo "        ";
  173.             $context["coordss"] = 1;
  174.             // line 21
  175.             echo "        ";
  176.             $context["lat"] = twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["city"]) || array_key_exists("city"$context) ? $context["city"] : (function () { throw new RuntimeError('Variable "city" does not exist.'21$this->source); })()), "mapCoordinate", [], "any"falsefalsefalse21), "latitude", [], "any"falsefalsefalse21);
  177.             // line 22
  178.             echo "        ";
  179.             $context["lon"] = twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["city"]) || array_key_exists("city"$context) ? $context["city"] : (function () { throw new RuntimeError('Variable "city" does not exist.'22$this->source); })()), "mapCoordinate", [], "any"falsefalsefalse22), "longitude", [], "any"falsefalsefalse22);
  180.             // line 23
  181.             echo "    ";
  182.         } else {
  183.             // line 24
  184.             echo "        ";
  185.             $context["coordss"] = 0;
  186.             // line 25
  187.             echo "        ";
  188.             $context["lat"] = "55.75";
  189.             // line 26
  190.             echo "        ";
  191.             $context["lon"] = "37.61";
  192.             // line 27
  193.             echo "    ";
  194.         }
  195.         // line 28
  196.         echo "
  197.     <h1 class=\"border-line\">";
  198.         // line 29
  199.         if (twig_test_empty($this->extensions['App\Twig\SeoExtension']->pageHeading())) {
  200.             echo "%Интим карта";
  201.         } else {
  202.             echo $this->extensions['App\Twig\SeoExtension']->pageHeading();
  203.         }
  204.         echo "</h1>
  205.     <p class=\"text-desc mb-lg-4\">
  206.         На карте обозначено местоположение зарегистрированных анкет.<br>
  207.         Кликнув на маркер Вы узнаете краткую информацию о девушке.
  208.     </p>
  209.     <div class=\"map\">
  210.         <div class=\"filter-line d-flex justify-content-center justify-content-md-between mb-2 mb-md-3 mb-lg-4\">
  211.             <button class=\"btn btn-secondary btn-collapse-filter\" type=\"button\" id=\"filter-expand\">
  212.                 <svg class=\"icon mr-1\">
  213.                     <use xlink:href=\"#icon-dropdown\"></use>
  214.                 </svg>
  215.                 Расширенный поиск
  216.             </button>
  217.             <div class=\"d-flex align-items-center collapse-reset ml-2\">
  218.                 <span class=\"d-none\" id=\"count-parameters\">Выбрано <em>0</em> параметров</span>
  219.                 <button class=\"btn btn-secondary btn-collapse-reset ml-md-2\" id=\"reset-form-2\" data-reset=\"true\">Сброс</button>
  220.             </div>
  221.         </div>
  222.         <div class=\"collapse\" id=\"collapseFilter\">
  223.         </div>
  224.         <div class=\"map-wrap loading\" id=\"map-wrap\" style=\"width: 100%; height: 700px;\">
  225.         </div>
  226.     </div>
  227.     ";
  228.         // line 54
  229.         echo "\t";
  230.         echo twig_include($this->env$context"components/seo.partial.twig", ["type" => "top"]);
  231.         echo "
  232. \t";
  233.         // line 55
  234.         echo twig_include($this->env$context"components/seo.partial.twig", ["type" => "bottom"]);
  235.         echo "
  236. ";
  237.         
  238.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  239.         
  240.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  241.         
  242.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  243.     }
  244.     // line 59
  245.     public function block_javascripts($context, array $blocks = [])
  246.     {
  247.         $macros $this->macros;
  248.         $__internal_b91a4435ea3baf1e2b6bfda56133dace $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
  249.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  250.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  251.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  252.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  253.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  254.         // line 60
  255.         echo "    ";
  256.         $this->displayParentBlock("javascripts"$context$blocks);
  257.         echo "
  258.     ";
  259.         // line 62
  260.         if ((array_key_exists("city"$context) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["city"]) || array_key_exists("city"$context) ? $context["city"] : (function () { throw new RuntimeError('Variable "city" does not exist.'62$this->source); })()), "mapCoordinate", [], "any"falsefalsefalse62), "latitude", [], "any"falsefalsefalse62))) {
  261.             // line 63
  262.             echo "\t\t";
  263.             $context["lat"] = twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["city"]) || array_key_exists("city"$context) ? $context["city"] : (function () { throw new RuntimeError('Variable "city" does not exist.'63$this->source); })()), "mapCoordinate", [], "any"falsefalsefalse63), "latitude", [], "any"falsefalsefalse63);
  264.             // line 64
  265.             echo "\t\t";
  266.             $context["lon"] = twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["city"]) || array_key_exists("city"$context) ? $context["city"] : (function () { throw new RuntimeError('Variable "city" does not exist.'64$this->source); })()), "mapCoordinate", [], "any"falsefalsefalse64), "longitude", [], "any"falsefalsefalse64);
  267.             // line 65
  268.             echo "\t";
  269.         } else {
  270.             // line 66
  271.             echo "\t\t";
  272.             $context["lat"] = "55.753215";
  273.             // line 67
  274.             echo "\t\t";
  275.             $context["lon"] = "37.622504";
  276.             // line 68
  277.             echo "\t";
  278.         }
  279.         // line 69
  280.         echo "
  281. \t<script src=\"";
  282.         // line 70
  283.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("bundles/fosjsrouting/js/router.min.js"), "html"nulltrue);
  284.         echo "\" defer></script>
  285. \t<script src=\"";
  286.         // line 71
  287.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("fos_js_routing_js", ["callback" => "fos.Router.setData"]);
  288.         echo "\" defer></script>
  289. \t<script src=\"https://api-maps.yandex.ru/2.1/?lang=ru_RU&onload=initMap&ns=ym\" defer></script>
  290. \t<script>
  291.         const mapConfig = {
  292. \t\t\tid:\"map-wrap\",
  293. \t\t\tmultiple_cities:\"";
  294.         // line 78
  295.         echo twig_escape_filter($this->env, (isset($context["multipleCities"]) || array_key_exists("multipleCities"$context) ? $context["multipleCities"] : (function () { throw new RuntimeError('Variable "multipleCities" does not exist.'78$this->source); })()), "html"nulltrue);
  296.         echo "\",
  297. \t\t\troutes_url: \"";
  298.         // line 79
  299.         echo ((((isset($context["multipleCities"]) || array_key_exists("multipleCities"$context) ? $context["multipleCities"] : (function () { throw new RuntimeError('Variable "multipleCities" does not exist.'79$this->source); })()) == 0)) ? ("/js/fos_js_routes.json") : ("/js/fos_js_routes_city_prefixed.json"));
  300.         echo "\",
  301. \t\t\tcity_uri_identity:\"";
  302.         // line 80
  303.         echo twig_escape_filter($this->env, (isset($context["cityUriIdentity"]) || array_key_exists("cityUriIdentity"$context) ? $context["cityUriIdentity"] : (function () { throw new RuntimeError('Variable "cityUriIdentity" does not exist.'80$this->source); })()), "html"nulltrue);
  304.         echo "\",
  305. \t\t\tcity_latitude:\"";
  306.         // line 81
  307.         echo twig_escape_filter($this->env, (isset($context["lat"]) || array_key_exists("lat"$context) ? $context["lat"] : (function () { throw new RuntimeError('Variable "lat" does not exist.'81$this->source); })()), "html"nulltrue);
  308.         echo "\",
  309. \t\t\tcity_longitude:\"";
  310.         // line 82
  311.         echo twig_escape_filter($this->env, (isset($context["lon"]) || array_key_exists("lon"$context) ? $context["lon"] : (function () { throw new RuntimeError('Variable "lon" does not exist.'82$this->source); })()), "html"nulltrue);
  312.         echo "\",
  313. \t\t\tlocale:\"";
  314.         // line 83
  315.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'83$this->source); })()), "request", [], "any"falsefalsefalse83), "locale", [], "any"falsefalsefalse83), "html"nulltrue);
  316.         echo "\",
  317. \t\t\tpath:\"";
  318.         // line 84
  319.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("map.filter", ["city" => (isset($context["cityUriIdentity"]) || array_key_exists("cityUriIdentity"$context) ? $context["cityUriIdentity"] : (function () { throw new RuntimeError('Variable "cityUriIdentity" does not exist.'84$this->source); })())]), "html"nulltrue);
  320.         echo "\",
  321. \t\t\ticon_profile:\"";
  322.         // line 86
  323.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/profile.svg"), "html"nulltrue);
  324.         echo "\",
  325. \t\t\ticon_profile_active:\"";
  326.         // line 87
  327.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/profile-active.svg"), "html"nulltrue);
  328.         echo "\",
  329. \t\t\ticon_profile_hover:\"";
  330.         // line 88
  331.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/profile-hover.svg"), "html"nulltrue);
  332.         echo "\",
  333. \t\t\ticon_saloon:\"";
  334.         // line 90
  335.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/saloon.svg"), "html"nulltrue);
  336.         echo "\",
  337. \t\t\ticon_saloon_active:\"";
  338.         // line 91
  339.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/saloon-active.svg"), "html"nulltrue);
  340.         echo "\",
  341. \t\t\ticon_saloon_hover:\"";
  342.         // line 92
  343.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/saloon-hover.svg"), "html"nulltrue);
  344.         echo "\",
  345. \t\t\ticon_masseur:\"";
  346.         // line 94
  347.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/masseur.svg"), "html"nulltrue);
  348.         echo "\",
  349. \t\t\ticon_masseur_active:\"";
  350.         // line 95
  351.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/masseur-active.svg"), "html"nulltrue);
  352.         echo "\",
  353. \t\t\ticon_masseur_hover:\"";
  354.         // line 96
  355.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/masseur-hover.svg"), "html"nulltrue);
  356.         echo "\",
  357. \t\t\ticon_cluster_small:\"";
  358.         // line 98
  359.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/cluster-small.svg"), "html"nulltrue);
  360.         echo "\",
  361. \t\t\ticon_cluster_medium:\"";
  362.         // line 99
  363.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/cluster-medium.svg"), "html"nulltrue);
  364.         echo "\",
  365. \t\t\ticon_cluster_big:\"";
  366.         // line 100
  367.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/map/cluster-big.svg"), "html"nulltrue);
  368.         echo "\",
  369. \t\t\tavatar_path : \"";
  370.         // line 102
  371.         echo twig_escape_filter($this->env$this->extensions['App\Twig\ResponsiveAssetExtension']->getResponsiveImageUrl("replace_path""profile_media_avatar""200x280""jpg"), "html"nulltrue);
  372.         echo "\",
  373. \t\t\tphoto_path : \"";
  374.         // line 103
  375.         echo twig_escape_filter($this->env$this->extensions['App\Twig\ResponsiveAssetExtension']->getResponsiveImageUrl("replace_path""profile_media""200x280""jpg"), "html"nulltrue);
  376.         echo "\",
  377. \t\t\tthumb_path : \"";
  378.         // line 104
  379.         echo twig_escape_filter($this->env$this->extensions['App\Twig\ResponsiveAssetExtension']->getResponsiveImageUrl("replace_path""saloon_media_thumb""200x280""jpg"), "html"nulltrue);
  380.         echo "\",
  381. \t\t\tprocess_profile_shows_url  : \"";
  382.         // line 105
  383.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("map.increment_profile_shows", (((isset($context["multipleCities"]) || array_key_exists("multipleCities"$context) ? $context["multipleCities"] : (function () { throw new RuntimeError('Variable "multipleCities" does not exist.'105$this->source); })())) ? (["city" => (isset($context["cityUriIdentity"]) || array_key_exists("cityUriIdentity"$context) ? $context["cityUriIdentity"] : (function () { throw new RuntimeError('Variable "cityUriIdentity" does not exist.'105$this->source); })())]) : ([]))), "html"nulltrue);
  384.         echo "\"
  385. \t\t};
  386. \t\t";
  387.         // line 114
  388.         echo "
  389. \t\twindow.isMapInitialized = false;
  390. \t\twindow.isYMapLoaded = false;
  391. \t\tfunction initMap() {
  392. \t\t\tconsole.log('initMap');
  393. \t\t\twindow.ymap = new ym.Map(document.getElementById('map-wrap'), {
  394. \t\t\t\tcenter: [\"";
  395.         // line 120
  396.         echo twig_escape_filter($this->env, (isset($context["lat"]) || array_key_exists("lat"$context) ? $context["lat"] : (function () { throw new RuntimeError('Variable "lat" does not exist.'120$this->source); })()), "html"nulltrue);
  397.         echo "\", \"";
  398.         echo twig_escape_filter($this->env, (isset($context["lon"]) || array_key_exists("lon"$context) ? $context["lon"] : (function () { throw new RuntimeError('Variable "lon" does not exist.'120$this->source); })()), "html"nulltrue);
  399.         echo "\"],
  400. \t\t\t\tzoom: 8,
  401. \t\t\t\tcontrols: ['zoomControl', 'typeSelector',  'fullscreenControl']
  402. \t\t\t});
  403. \t\t\twindow.isMapInitialized = true;
  404. \t\t\twindow.isYMapLoaded = true;
  405. \t\t\t//if (!window.isMapInitialized) {
  406. \t\t\t//\tconsole.log('new mapPage initMap');
  407. \t\t\t//\twindow.isMapInitialized = true;
  408. \t\t\t//\tnew MapPage(mapConfig);
  409. \t\t\t//}
  410. \t\t}
  411. \t\twindow.profileShowed = function ({id}) {
  412. \t\t\tif (!id) return;
  413. \t\t\tfetch('";
  414.         // line 136
  415.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("profile_ctr.increase_shows");
  416.         echo "', {
  417. \t\t\t\tmethod: \"POST\",
  418. \t\t\t\tbody: JSON.stringify({ profiles: [id], source: 'map' }),
  419. \t\t\t});
  420. \t\t}
  421.         window.stations = {";
  422.         // line 143
  423.         $context['_parent'] = $context;
  424.         $context['_seq'] = twig_ensure_traversable($this->extensions['App\Twig\StationsExtension']->stations());
  425.         $context['loop'] = [
  426.           'parent' => $context['_parent'],
  427.           'index0' => 0,
  428.           'index'  => 1,
  429.           'first'  => true,
  430.         ];
  431.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  432.             $length count($context['_seq']);
  433.             $context['loop']['revindex0'] = $length 1;
  434.             $context['loop']['revindex'] = $length;
  435.             $context['loop']['length'] = $length;
  436.             $context['loop']['last'] = === $length;
  437.         }
  438.         foreach ($context['_seq'] as $context["_key"] => $context["station"]) {
  439.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["station"], "id", [], "any"falsefalsefalse143), "html"nulltrue);
  440.             echo ":{icon:`";
  441.             $this->loadTemplate("components/metro/icon_generate.partial.twig""Map/page.html.twig"143)->display(twig_array_merge($context, ["data" => $this->extensions['App\Twig\StationsExtension']->stationLines($context["station"])]));
  442.             echo "`,name:`";
  443.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["station"], "name", [], "any"falsefalsefalse143), "html"nulltrue);
  444.             echo "`},";
  445.             ++$context['loop']['index0'];
  446.             ++$context['loop']['index'];
  447.             $context['loop']['first'] = false;
  448.             if (isset($context['loop']['length'])) {
  449.                 --$context['loop']['revindex0'];
  450.                 --$context['loop']['revindex'];
  451.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  452.             }
  453.         }
  454.         $_parent $context['_parent'];
  455.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['station'], $context['_parent'], $context['loop']);
  456.         $context array_intersect_key($context$_parent) + $_parent;
  457.         // line 144
  458.         echo "};
  459.         document.addEventListener('DOMContentLoaded', function () {
  460. \t\t\tfunction loadForm() {
  461. \t\t\t\tfetch('";
  462.         // line 148
  463.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("map.form", ["city" => (isset($context["cityUriIdentity"]) || array_key_exists("cityUriIdentity"$context) ? $context["cityUriIdentity"] : (function () { throw new RuntimeError('Variable "cityUriIdentity" does not exist.'148$this->source); })())]), "html"nulltrue);
  464.         echo "', {
  465. \t\t\t\t\tmode: \"cors\",
  466. \t\t\t\t\timportance: \"low\",
  467. \t\t\t\t\tmethod: \"POST\",
  468. \t\t\t\t\theaders: {
  469. \t\t\t\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",
  470. \t\t\t\t\t\t\"X-Requested-With\": \"XMLHttpRequest\"
  471. \t\t\t\t\t},
  472. \t\t\t\t}).then(response => {
  473. \t\t\t\t\tif (response.status < 300) {
  474. \t\t\t\t\t\treturn response.text();
  475. \t\t\t\t\t} else {
  476. \t\t\t\t\t\tconsole.warn(\"🤔\");
  477. \t\t\t\t\t\treturn null;
  478. \t\t\t\t\t}
  479. \t\t\t\t}).then(response => {
  480. \t\t\t\t\tdocument.getElementById('collapseFilter').innerHTML = response;
  481. \t\t\t\t\tfilterLoader()
  482. \t\t\t\t});
  483. \t\t\t}
  484. \t\t\tloadForm();
  485. \t\t\tfunction filterLoader() {
  486. \t\t\t\tconst stringifyData = `{\"city_id\":\"\${document.getElementById('filter_map_form_city_id').value}\",\"_token\":\"\${document.getElementById('filter_map_form__token').value}\"}`;
  487. \t\t\t\tfetch(\"";
  488.         // line 173
  489.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("map.filter", ["city" => (isset($context["cityUriIdentity"]) || array_key_exists("cityUriIdentity"$context) ? $context["cityUriIdentity"] : (function () { throw new RuntimeError('Variable "cityUriIdentity" does not exist.'173$this->source); })()), "scale" => 20]), "html"nulltrue);
  490.         echo "\", {
  491. \t\t\t\t\tmethod: \"POST\",
  492. \t\t\t\t\theaders: {
  493. \t\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
  494. \t\t\t\t\t\t'X-Requested-With': 'XMLHttpRequest',
  495. \t\t\t\t\t},
  496. \t\t\t\t\tbody: new URLSearchParams({ form: stringifyData }).toString(),
  497. \t\t\t\t})
  498. \t\t\t\t\t.then(response => response.json())
  499. \t\t\t\t\t.then(data => {
  500. \t\t\t\t\t\t//console.log('map-data-loaded')
  501. \t\t\t\t\t\tconst mapLoadedInterval = setInterval(()=>{
  502. \t\t\t\t\t\t\tif (window.isYMapLoaded) {
  503. \t\t\t\t\t\t\t\tdocument.dispatchEvent(new CustomEvent('map:data:loaded', { detail: { data, stringifyData, mapConfig } }));
  504. \t\t\t\t\t\t\t\tclearInterval(mapLoadedInterval)
  505. \t\t\t\t\t\t\t}
  506. \t\t\t\t\t\t}, 200)
  507. \t\t\t\t\t})
  508. \t\t\t\t\t.catch(error => console.error(error));
  509. \t\t\t\t//if (!window.isMapInitialized) {
  510. \t\t\t\t//\tconsole.log('new mapPage filterLoader');
  511. \t\t\t\t//\twindow.isMapInitialized = true;
  512. \t\t\t\t//\tnew MapPage(mapConfig);
  513. \t\t\t\t//}
  514. \t\t\t}
  515. \t\t})
  516. \t</script>
  517.     ";
  518.         // line 203
  519.         echo $this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->renderWebpackScriptTags("scripts/map-page"null"basicConfig");
  520.         echo "
  521. ";
  522.         
  523.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  524.         
  525.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  526.         
  527.         $__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
  528.     }
  529.     /**
  530.      * @codeCoverageIgnore
  531.      */
  532.     public function getTemplateName()
  533.     {
  534.         return "Map/page.html.twig";
  535.     }
  536.     /**
  537.      * @codeCoverageIgnore
  538.      */
  539.     public function isTraitable()
  540.     {
  541.         return false;
  542.     }
  543.     /**
  544.      * @codeCoverageIgnore
  545.      */
  546.     public function getDebugInfo()
  547.     {
  548.         return array (  597 => 203,  564 => 173,  536 => 148,  530 => 144,  495 => 143,  486 => 136,  465 => 120,  457 => 114,  451 => 105,  447 => 104,  443 => 103,  439 => 102,  434 => 100,  430 => 99,  426 => 98,  421 => 96,  417 => 95,  413 => 94,  408 => 92,  404 => 91,  400 => 90,  395 => 88,  391 => 87,  387 => 86,  382 => 84,  378 => 83,  374 => 82,  370 => 81,  366 => 80,  362 => 79,  358 => 78,  348 => 71,  344 => 70,  341 => 69,  338 => 68,  335 => 67,  332 => 66,  329 => 65,  326 => 64,  323 => 63,  321 => 62,  315 => 60,  302 => 59,  287 => 55,  282 => 54,  251 => 29,  248 => 28,  245 => 27,  242 => 26,  239 => 25,  236 => 24,  233 => 23,  230 => 22,  227 => 21,  224 => 20,  221 => 19,  208 => 18,  183 => 17,  158 => 16,  141 => 12,  128 => 11,  112 => 8,  99 => 7,  83 => 4,  70 => 3,  41 => 1,);
  549.     }
  550.     public function getSourceContext()
  551.     {
  552.         return new Source("{% extends 'grid.html.twig' %}
  553. {% block title %}
  554.     {{ seo_title() }}
  555. {% endblock %}
  556. {% block metaDescription %}
  557.     <meta name=\"description\" content=\"{{ seo_description() }}\">
  558. {% endblock %}
  559. {% block stylesheet %}
  560.     {{ parent() }}
  561.     <link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css\">
  562. {% endblock %}
  563. {% block name_page %}map{% endblock %}
  564. {% block bodyClasses %}map-page{% endblock %}
  565. {% block mainContainer %}
  566.     {% if city is defined and city.mapCoordinate.latitude %}
  567.         {% set coordss = 1 %}
  568.         {% set lat = city.mapCoordinate.latitude %}
  569.         {% set lon = city.mapCoordinate.longitude %}
  570.     {% else %}
  571.         {% set coordss = 0 %}
  572.         {% set lat = '55.75' %}
  573.         {% set lon = '37.61' %}
  574.     {% endif %}
  575.     <h1 class=\"border-line\">{% if seo_heading() is empty %}%Интим карта{% else %}{{ seo_heading() }}{% endif %}</h1>
  576.     <p class=\"text-desc mb-lg-4\">
  577.         На карте обозначено местоположение зарегистрированных анкет.<br>
  578.         Кликнув на маркер Вы узнаете краткую информацию о девушке.
  579.     </p>
  580.     <div class=\"map\">
  581.         <div class=\"filter-line d-flex justify-content-center justify-content-md-between mb-2 mb-md-3 mb-lg-4\">
  582.             <button class=\"btn btn-secondary btn-collapse-filter\" type=\"button\" id=\"filter-expand\">
  583.                 <svg class=\"icon mr-1\">
  584.                     <use xlink:href=\"#icon-dropdown\"></use>
  585.                 </svg>
  586.                 Расширенный поиск
  587.             </button>
  588.             <div class=\"d-flex align-items-center collapse-reset ml-2\">
  589.                 <span class=\"d-none\" id=\"count-parameters\">Выбрано <em>0</em> параметров</span>
  590.                 <button class=\"btn btn-secondary btn-collapse-reset ml-md-2\" id=\"reset-form-2\" data-reset=\"true\">Сброс</button>
  591.             </div>
  592.         </div>
  593.         <div class=\"collapse\" id=\"collapseFilter\">
  594.         </div>
  595.         <div class=\"map-wrap loading\" id=\"map-wrap\" style=\"width: 100%; height: 700px;\">
  596.         </div>
  597.     </div>
  598.     {# {{ include('components/big_footer.html.twig', { 'type': 'main' }) }} #}
  599. \t{{ include('components/seo.partial.twig', {type: 'top'}) }}
  600. \t{{ include('components/seo.partial.twig', {type: 'bottom'}) }}
  601. {% endblock %}
  602. {% block javascripts %}
  603.     {{ parent() }}
  604.     {% if city is defined and city.mapCoordinate.latitude %}
  605. \t\t{% set lat = city.mapCoordinate.latitude %}
  606. \t\t{% set lon = city.mapCoordinate.longitude %}
  607. \t{% else %}
  608. \t\t{% set lat = '55.753215' %}
  609. \t\t{% set lon = '37.622504' %}
  610. \t{% endif %}
  611. \t<script src=\"{{ asset('bundles/fosjsrouting/js/router.min.js') }}\" defer></script>
  612. \t<script src=\"{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}\" defer></script>
  613. \t<script src=\"https://api-maps.yandex.ru/2.1/?lang=ru_RU&onload=initMap&ns=ym\" defer></script>
  614. \t<script>
  615.         const mapConfig = {
  616. \t\t\tid:\"map-wrap\",
  617. \t\t\tmultiple_cities:\"{{ multipleCities }}\",
  618. \t\t\troutes_url: \"{{ multipleCities == 0 ? '/js/fos_js_routes.json' : '/js/fos_js_routes_city_prefixed.json' }}\",
  619. \t\t\tcity_uri_identity:\"{{ cityUriIdentity }}\",
  620. \t\t\tcity_latitude:\"{{ lat }}\",
  621. \t\t\tcity_longitude:\"{{ lon }}\",
  622. \t\t\tlocale:\"{{ app.request.locale }}\",
  623. \t\t\tpath:\"{{ path('map.filter', {city:cityUriIdentity}) }}\",
  624. \t\t\ticon_profile:\"{{ asset('assets/images/map/profile.svg') }}\",
  625. \t\t\ticon_profile_active:\"{{ asset('assets/images/map/profile-active.svg') }}\",
  626. \t\t\ticon_profile_hover:\"{{ asset('assets/images/map/profile-hover.svg') }}\",
  627. \t\t\ticon_saloon:\"{{ asset('assets/images/map/saloon.svg') }}\",
  628. \t\t\ticon_saloon_active:\"{{ asset('assets/images/map/saloon-active.svg') }}\",
  629. \t\t\ticon_saloon_hover:\"{{ asset('assets/images/map/saloon-hover.svg') }}\",
  630. \t\t\ticon_masseur:\"{{ asset('assets/images/map/masseur.svg') }}\",
  631. \t\t\ticon_masseur_active:\"{{ asset('assets/images/map/masseur-active.svg') }}\",
  632. \t\t\ticon_masseur_hover:\"{{ asset('assets/images/map/masseur-hover.svg') }}\",
  633. \t\t\ticon_cluster_small:\"{{ asset('assets/images/map/cluster-small.svg') }}\",
  634. \t\t\ticon_cluster_medium:\"{{ asset('assets/images/map/cluster-medium.svg') }}\",
  635. \t\t\ticon_cluster_big:\"{{ asset('assets/images/map/cluster-big.svg') }}\",
  636. \t\t\tavatar_path : \"{{ responsive_asset('replace_path', 'profile_media_avatar', \"200x280\", \"jpg\") }}\",
  637. \t\t\tphoto_path : \"{{ responsive_asset('replace_path', 'profile_media', \"200x280\", \"jpg\") }}\",
  638. \t\t\tthumb_path : \"{{ responsive_asset('replace_path', 'saloon_media_thumb', \"200x280\", \"jpg\") }}\",
  639. \t\t\tprocess_profile_shows_url  : \"{{ path('map.increment_profile_shows', multipleCities ? {city:cityUriIdentity} : {}) }}\"
  640. \t\t};
  641. \t\t{# window._mapPage = {
  642. \t\t\tisMapInitialized: false,
  643. \t\t\tisYMapLoaded: false,
  644. \t\t\tisFormLoaded: false,
  645. \t\t\tisFilterLoaded: false,
  646. \t\t} #}
  647. \t\twindow.isMapInitialized = false;
  648. \t\twindow.isYMapLoaded = false;
  649. \t\tfunction initMap() {
  650. \t\t\tconsole.log('initMap');
  651. \t\t\twindow.ymap = new ym.Map(document.getElementById('map-wrap'), {
  652. \t\t\t\tcenter: [\"{{ lat }}\", \"{{ lon }}\"],
  653. \t\t\t\tzoom: 8,
  654. \t\t\t\tcontrols: ['zoomControl', 'typeSelector',  'fullscreenControl']
  655. \t\t\t});
  656. \t\t\twindow.isMapInitialized = true;
  657. \t\t\twindow.isYMapLoaded = true;
  658. \t\t\t//if (!window.isMapInitialized) {
  659. \t\t\t//\tconsole.log('new mapPage initMap');
  660. \t\t\t//\twindow.isMapInitialized = true;
  661. \t\t\t//\tnew MapPage(mapConfig);
  662. \t\t\t//}
  663. \t\t}
  664. \t\twindow.profileShowed = function ({id}) {
  665. \t\t\tif (!id) return;
  666. \t\t\tfetch('{{ path('profile_ctr.increase_shows') }}', {
  667. \t\t\t\tmethod: \"POST\",
  668. \t\t\t\tbody: JSON.stringify({ profiles: [id], source: 'map' }),
  669. \t\t\t});
  670. \t\t}
  671.         window.stations = {
  672. \t\t\t{%- for station in stations() -%}{{- station.id -}}:{icon:`{%- include 'components/metro/icon_generate.partial.twig' with {data: station|station_lines} -%}`,name:`{{- station.name -}}`},{%- endfor -%}
  673. \t\t};
  674.         document.addEventListener('DOMContentLoaded', function () {
  675. \t\t\tfunction loadForm() {
  676. \t\t\t\tfetch('{{ path('map.form', {city: cityUriIdentity}) }}', {
  677. \t\t\t\t\tmode: \"cors\",
  678. \t\t\t\t\timportance: \"low\",
  679. \t\t\t\t\tmethod: \"POST\",
  680. \t\t\t\t\theaders: {
  681. \t\t\t\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",
  682. \t\t\t\t\t\t\"X-Requested-With\": \"XMLHttpRequest\"
  683. \t\t\t\t\t},
  684. \t\t\t\t}).then(response => {
  685. \t\t\t\t\tif (response.status < 300) {
  686. \t\t\t\t\t\treturn response.text();
  687. \t\t\t\t\t} else {
  688. \t\t\t\t\t\tconsole.warn(\"🤔\");
  689. \t\t\t\t\t\treturn null;
  690. \t\t\t\t\t}
  691. \t\t\t\t}).then(response => {
  692. \t\t\t\t\tdocument.getElementById('collapseFilter').innerHTML = response;
  693. \t\t\t\t\tfilterLoader()
  694. \t\t\t\t});
  695. \t\t\t}
  696. \t\t\tloadForm();
  697. \t\t\tfunction filterLoader() {
  698. \t\t\t\tconst stringifyData = `{\"city_id\":\"\${document.getElementById('filter_map_form_city_id').value}\",\"_token\":\"\${document.getElementById('filter_map_form__token').value}\"}`;
  699. \t\t\t\tfetch(\"{{ path('map.filter', {city:cityUriIdentity, scale: 20}) }}\", {
  700. \t\t\t\t\tmethod: \"POST\",
  701. \t\t\t\t\theaders: {
  702. \t\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
  703. \t\t\t\t\t\t'X-Requested-With': 'XMLHttpRequest',
  704. \t\t\t\t\t},
  705. \t\t\t\t\tbody: new URLSearchParams({ form: stringifyData }).toString(),
  706. \t\t\t\t})
  707. \t\t\t\t\t.then(response => response.json())
  708. \t\t\t\t\t.then(data => {
  709. \t\t\t\t\t\t//console.log('map-data-loaded')
  710. \t\t\t\t\t\tconst mapLoadedInterval = setInterval(()=>{
  711. \t\t\t\t\t\t\tif (window.isYMapLoaded) {
  712. \t\t\t\t\t\t\t\tdocument.dispatchEvent(new CustomEvent('map:data:loaded', { detail: { data, stringifyData, mapConfig } }));
  713. \t\t\t\t\t\t\t\tclearInterval(mapLoadedInterval)
  714. \t\t\t\t\t\t\t}
  715. \t\t\t\t\t\t}, 200)
  716. \t\t\t\t\t})
  717. \t\t\t\t\t.catch(error => console.error(error));
  718. \t\t\t\t//if (!window.isMapInitialized) {
  719. \t\t\t\t//\tconsole.log('new mapPage filterLoader');
  720. \t\t\t\t//\twindow.isMapInitialized = true;
  721. \t\t\t\t//\tnew MapPage(mapConfig);
  722. \t\t\t\t//}
  723. \t\t\t}
  724. \t\t})
  725. \t</script>
  726.     {{ encore_entry_script_tags('scripts/map-page', null, 'basicConfig') }}
  727. {% endblock %}""Map/page.html.twig""/app/templates/Map/page.html.twig");
  728.     }
  729. }