{% load i18n %}
<div id='{{map_id}}'></div>
<script type="text/javascript">
   $("#{{map_id}}").show();
</script>
<div id="waiting">
    <div id="waiting-content">
        <img src='{{STATIC_URL}}chimere/img/ajax-loader.gif'/>
        <p>{% trans "Loading of the map in progress" %}</p>
    </div>
</div>
<script type="text/javascript">
    {% if single_category %}
    $(function() {$('#panel').hide()});{% endif %}
    var chimere_init_options = {};
    chimere_init_options["default_icon"] = '{{STATIC_URL}}img/marker-green.png';
    chimere_init_options["map_layers"] = [{{map_layers|safe|escape}}];
    chimere_init_options['permalink_label'] = '{%trans "Permalink"%}';
    chimere_init_options['permalink_element'] = document.getElementById('permalink');
    {% if dynamic_categories %}chimere_init_options['dynamic_categories'] = true;{% endif %}
    {% if default_area %}
    chimere_init_options["default_area"] = new Array({{default_area.upper_left_corner.x}}, {{default_area.upper_left_corner.y}}, {{default_area.lower_right_corner.x}}, {{default_area.lower_right_corner.y}});
    {% endif %}
    {% if p_zoom %}chimere_init_options["zoom"] = {{ p_zoom }};{% endif %}
    {% if p_lat %}chimere_init_options["lat"] = {{ p_lat }};{% endif %}
    {% if p_lon %}chimere_init_options["lon"] = {{ p_lon }};{% endif %}
    chimere_init_options["icon_offset"] = new OpenLayers.Pixel({{icon_offset_x}},
                                                            {{icon_offset_y}});
    chimere_init_options["dynamic_categories"] = {{ dynamic_categories }};
    {% if p_display_submited %}chimere_init_options["display_submited"] = {{ p_display_submited }};{% endif %}
    chimere_init_options["checked_categories"] = {{ p_checked_categories }};
    {% if area_id %}chimere_init_options['area_id'] = "{{area_id}}";{% endif %}
    {% if p_current_feature %}
    chimere_init_options["display_feature"] = {{ p_current_feature }};{% endif %}
    {% if p_current_route %}
    chimere_init_options["display_route"] = {{ p_current_route }};{% endif %}
    {% if restricted_extent %}{{ restricted_extent }}
    chimere_init_options["restricted_extent"] = bounds;
    {% endif %}
    {% if selected_map_layer %}
    chimere_init_options["selected_map_layer"] = {{selected_map_layer}};
    {% endif %}
    $("#main-map").chimere(chimere_init_options);
    {% if zoom %}
    $('#maps').chimere('zoom', {'area':{{zoom}} });
    {% endif %}
</script>

