<?php

/* @particles/googlemap.html.twig */
class __TwigTemplate_32a6c124307814934648ad7b218af88c0423f5c44b6fde651473c67ee63e0b8d extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        // line 1
        $this->parent = $this->loadTemplate("@nucleus/partials/particle.html.twig", "@particles/googlemap.html.twig", 1);
        $this->blocks = array(
            'particle' => array($this, 'block_particle'),
            'javascript_footer' => array($this, 'block_javascript_footer'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "@nucleus/partials/particle.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 3
        $context["attr_extra"] = "";
        // line 4
        if ($this->getAttribute(($context["particle"] ?? null), "extra", array())) {
            // line 5
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["particle"] ?? null), "extra", array()));
            foreach ($context['_seq'] as $context["_key"] => $context["attributes"]) {
                // line 6
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable($context["attributes"]);
                foreach ($context['_seq'] as $context["key"] => $context["value"]) {
                    // line 7
                    $context["attr_extra"] = (((((($context["attr_extra"] ?? null) . " ") . twig_escape_filter($this->env, $context["key"])) . "=\"") . twig_escape_filter($this->env, $context["value"], "html_attr")) . "\"");
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['key'], $context['value'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['attributes'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
        }
        // line 12
        $context["indentifier"] = twig_random($this->env);
        // line 1
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 14
    public function block_particle($context, array $blocks = array())
    {
        // line 15
        echo "    <div class=\"g-googlemap";
        if ($this->getAttribute($this->getAttribute(($context["particle"] ?? null), "css", array()), "class", array())) {
            echo " ";
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(($context["particle"] ?? null), "css", array()), "class", array()));
        }
        echo "\" ";
        if ($this->getAttribute(($context["particle"] ?? null), "extra", array())) {
            echo ($context["attr_extra"] ?? null);
        }
        echo " >
        <div id=\"g-map-";
        // line 16
        echo twig_escape_filter($this->env, ($context["indentifier"] ?? null));
        echo "\" style=\"width: ";
        echo twig_escape_filter($this->env, $this->getAttribute(($context["particle"] ?? null), "width", array()));
        echo "; height: ";
        echo twig_escape_filter($this->env, $this->getAttribute(($context["particle"] ?? null), "height", array()));
        echo ";\">
        </div>
    </div>
";
    }

    // line 21
    public function block_javascript_footer($context, array $blocks = array())
    {
        // line 22
        echo "    ";
        $this->displayParentBlock("javascript_footer", $context, $blocks);
        echo "
    <script type=\"text/javascript\" src=\"https://maps.googleapis.com/maps/api/js";
        // line 23
        if ($this->getAttribute(($context["particle"] ?? null), "apikey", array())) {
            echo "?key=";
            echo twig_escape_filter($this->env, twig_trim_filter(twig_escape_filter($this->env, $this->getAttribute(($context["particle"] ?? null), "apikey", array()))), "html", null, true);
        }
        echo "\"></script>
    <script type=\"text/javascript\">
        function initialize";
        // line 25
        echo twig_escape_filter($this->env, ($context["indentifier"] ?? null));
        echo "() {

            var latlng = new google.maps.LatLng(";
        // line 27
        echo twig_escape_filter($this->env, $this->getAttribute(($context["particle"] ?? null), "latitude", array()));
        echo ",";
        echo twig_escape_filter($this->env, $this->getAttribute(($context["particle"] ?? null), "longitude", array()));
        echo ");

            ";
        // line 29
        if (((($this->getAttribute(($context["particle"] ?? null), "dragging", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["particle"] ?? null), "dragging", array()), "enabled")) : ("enabled")) == "enabled")) {
            // line 30
            echo "                var isDraggable = 1;
            ";
        } elseif (((($this->getAttribute(        // line 31
($context["particle"] ?? null), "dragging", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["particle"] ?? null), "dragging", array()), "enabled")) : ("enabled")) == "disabledmobile")) {
            // line 32
            echo "                ";
            $this->getAttribute(($context["gantry"] ?? null), "load", array(0 => "jquery"), "method");
            // line 33
            echo "                var isDraggable = jQuery(document).width() > 767 ? true : 0;
            ";
        } else {
            // line 35
            echo "                var isDraggable = 0;
            ";
        }
        // line 37
        echo "
            var myOptions =
            {
                zoom: ";
        // line 40
        echo twig_escape_filter($this->env, $this->getAttribute(($context["particle"] ?? null), "zoom", array()));
        echo ",
                center: latlng,
                mapTypeId: google.maps.MapTypeId.";
        // line 42
        echo twig_escape_filter($this->env, (($this->getAttribute(($context["particle"] ?? null), "maptype", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["particle"] ?? null), "maptype", array()), "ROADMAP")) : ("ROADMAP")));
        echo ",

                ";
        // line 44
        if ($this->getAttribute(($context["particle"] ?? null), "snazzymaps", array())) {
            // line 45
            echo "                    styles: ";
            echo $this->getAttribute(($context["particle"] ?? null), "snazzymaps", array());
            echo ",
                ";
        }
        // line 47
        echo "
                scrollwheel: ";
        // line 48
        echo twig_escape_filter($this->env, (($this->getAttribute(($context["particle"] ?? null), "scrollwheel", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["particle"] ?? null), "scrollwheel", array()), 0)) : (0)));
        echo ",
                draggable: isDraggable
            };

            var map = new google.maps.Map(document.getElementById(\"g-map-";
        // line 52
        echo twig_escape_filter($this->env, ($context["indentifier"] ?? null));
        echo "\"), myOptions);

            ";
        // line 54
        if (((($this->getAttribute(($context["particle"] ?? null), "defaultmarker", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["particle"] ?? null), "defaultmarker", array()), "show")) : ("show")) == "show")) {
            // line 55
            echo "                var myMarker = new google.maps.Marker(
                {
                    position: latlng,
                    map: map,
                });

                var contentString = '";
            // line 61
            echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute(($context["particle"] ?? null), "markertext", array()), "js"), "html", null, true);
            echo "';

                var infowindow = new google.maps.InfoWindow({
                    content: contentString
                });

                ";
            // line 67
            if ($this->getAttribute(($context["particle"] ?? null), "markertext", array())) {
                // line 68
                echo "                    myMarker.addListener('click', function() {
                        infowindow.open(map, myMarker);
                    });

                    ";
                // line 72
                if ((($this->getAttribute(($context["particle"] ?? null), "markerstate", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["particle"] ?? null), "markerstate", array()), 1)) : (1))) {
                    // line 73
                    echo "                        infowindow.open(map, myMarker);
                    ";
                }
                // line 75
                echo "                ";
            }
            // line 76
            echo "            ";
        }
        // line 77
        echo "
            ";
        // line 78
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["particle"] ?? null), "markers", array()));
        foreach ($context['_seq'] as $context["_key"] => $context["marker"]) {
            // line 79
            echo "                ";
            $context["marker_id"] = twig_random($this->env);
            // line 80
            echo "
                var myMarker";
            // line 81
            echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
            echo " = new google.maps.Marker(
                {
                    position: {lat: ";
            // line 83
            echo twig_escape_filter($this->env, $this->getAttribute($context["marker"], "latitude", array()));
            echo ", lng: ";
            echo twig_escape_filter($this->env, $this->getAttribute($context["marker"], "longitude", array()));
            echo "},
                    map: map,
                });

                var contentString";
            // line 87
            echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
            echo " = '";
            echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute($context["marker"], "markertext", array()), "js"), "html", null, true);
            echo "';

                var infowindow";
            // line 89
            echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
            echo " = new google.maps.InfoWindow({
                    content: contentString";
            // line 90
            echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
            echo "
                });

                ";
            // line 93
            if ($this->getAttribute($context["marker"], "markertext", array())) {
                // line 94
                echo "                myMarker";
                echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
                echo ".addListener('click', function() {
                    infowindow";
                // line 95
                echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
                echo ".open(map, myMarker";
                echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
                echo ");
                });

                    ";
                // line 98
                if ((($this->getAttribute($context["marker"], "markerstate", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($context["marker"], "markerstate", array()), 1)) : (1))) {
                    // line 99
                    echo "                        infowindow";
                    echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
                    echo ".open(map, myMarker";
                    echo twig_escape_filter($this->env, ($context["marker_id"] ?? null));
                    echo ");
                    ";
                }
                // line 101
                echo "                ";
            }
            // line 102
            echo "
                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['marker'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 104
        echo "
            // Resize stuff...
            google.maps.event.addDomListener(window, \"resize\", function() {
                var center = map.getCenter();
                google.maps.event.trigger(map, \"resize\");
                map.setCenter(center); 
            });

        }
        google.maps.event.addDomListener(window, 'load', initialize";
        // line 113
        echo twig_escape_filter($this->env, ($context["indentifier"] ?? null));
        echo ");
        
    </script>
";
    }

    public function getTemplateName()
    {
        return "@particles/googlemap.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  295 => 113,  284 => 104,  277 => 102,  274 => 101,  266 => 99,  264 => 98,  256 => 95,  251 => 94,  249 => 93,  243 => 90,  239 => 89,  232 => 87,  223 => 83,  218 => 81,  215 => 80,  212 => 79,  208 => 78,  205 => 77,  202 => 76,  199 => 75,  195 => 73,  193 => 72,  187 => 68,  185 => 67,  176 => 61,  168 => 55,  166 => 54,  161 => 52,  154 => 48,  151 => 47,  145 => 45,  143 => 44,  138 => 42,  133 => 40,  128 => 37,  124 => 35,  120 => 33,  117 => 32,  115 => 31,  112 => 30,  110 => 29,  103 => 27,  98 => 25,  90 => 23,  85 => 22,  82 => 21,  70 => 16,  58 => 15,  55 => 14,  51 => 1,  49 => 12,  38 => 7,  34 => 6,  30 => 5,  28 => 4,  26 => 3,  11 => 1,);
    }

    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);

        return $this->getSourceContext()->getCode();
    }

    public function getSourceContext()
    {
        return new Twig_Source("", "@particles/googlemap.html.twig", "/home/isfmp/public_html/welthaus/templates/it_construction/particles/googlemap.html.twig");
    }
}
