{% if ymap %}
{% load i18n staticfiles djeymtags djeymfilters %}
{% if selected_load_indicator %}
{% widthratio load_indicator_size 2 1 as margin_offset %}
<style type="text/css">
    #djeymModalLock { display: block; }
    #djeymLoadIndicator {
        width: {{ load_indicator_size }}px;
        height: {{ load_indicator_size }}px;
        margin: -{{ margin_offset }}px 0 0 -{{ margin_offset }}px;
        content: url('{{ selected_load_indicator.svg.url }}');
        {% if not ymap.disable_indicator_animation %}animation: djeym-spin {{ ymap.animation_speed }}s infinite linear;{% endif %}
    }
</style>
{% endif %}
{% if not general_settings.disable_site_panel %}{% include panel_path %}{% endif %}
<script type="text/javascript">
    var djeymMapID = {{ ymap.pk }},
        djeymCenterMap = [{{ ymap.latitude }},{{ ymap.longitude }}],
        djeymZoomMap = {{ ymap.zoom }},
        djeymCluster = ["{{ cluster.svg.url }}",{{ cluster.get_size }},{{ cluster.get_offset }}],
        djeymControls = {{ controls.get_control_list|safe }},
        djeymSearchProvider = {{ controls.provider|lower }},
        djeymClusteringSite = {{ general_settings.clustering_site|lower }},
        djeymClusterLayout = "{{ general_settings.cluster_layout }}",
        djeymClusterIconContent = {{ general_settings.cluster_icon_content|lower }},
        djeymClusterIconContentBgColor = "{{ general_settings.cluster_icon_content_bg_color }}",
        djeymClusterIconContentTxtColor = "{{ general_settings.cluster_icon_content_txt_color }}",
        djeymMapType = "{{ controls.maptype }}",
        djeymDisableSitePanel = {{ general_settings.disable_site_panel|lower }},
        djeymBalloonMinHeight = {% if selected_load_indicator %}{{ load_indicator_size }} + 40{% else %}60{% endif %},
        {% if tile %}
            djeymTile = {
                maxZoom: {{ tile.maxzoom }},
                minZoom: {{ tile.minzoom }},
                copyrights: "{{ tile.copyrights|safe|escape_double_brackets }}"
            },
            djeymSource = function () { return "{% random_domain tile.source|safe tile.apikey %}"; },
        {% endif %}
        djeymRoundTheme = {{ external_modules.roundtheme|lower }},
        djeymHeatmap = {{ external_modules.heatmap|lower }},
        djeymHeatmapRadius = {{ heatmap_settings.radius }},
        djeymHeatmapDissipating = {{ heatmap_settings.dissipating|lower }},
        djeymHeatmapOpacity = {{ heatmap_settings.opacity }},
        djeymHeatmapIntensity = {{ heatmap_settings.intensity }},
        djeymHeatmapGradientColor1 = "{{ heatmap_settings.gradient_color1 }}",
        djeymHeatmapGradientColor2 = "{{ heatmap_settings.gradient_color2 }}",
        djeymHeatmapGradientColor3 = "{{ heatmap_settings.gradient_color3 }}",
        djeymHeatmapGradientColor4 = "{{ heatmap_settings.gradient_color4 }}";
</script>
{% get_api_ymap lang=language_code %}
<script type="text/javascript" src="{% static "djeym/js/ymfront.min.js" %}"></script>
{% endif %}
