combo/combo/apps/maps/templates/maps/map_cell.html

40 lines
1.4 KiB
HTML

{% load l10n %}
{% block cell-content %}
{% if title %}<h2>{{ title }}</h2>{% endif %}
{% localize off %}
<div class="combo-cell-map"
{% block map-attributes %}
data-init-state="{{ initial_state }}"
data-init-zoom="{{ initial_zoom }}" data-min-zoom="{{ min_zoom }}"
data-max-zoom="{{ max_zoom }}" data-init-lat="{{ init_lat }}"
data-init-lng="{{ init_lng }}"
data-include-geoloc-button="true"
{% if group_markers %}data-group-markers="1"{% endif %}
data-marker-behaviour-onclick="{{ cell.marker_behaviour_onclick }}"
{% if max_bounds.corner1.lat %}
data-max-bounds-lat1="{{ max_bounds.corner1.lat }}"
data-max-bounds-lng1="{{ max_bounds.corner1.lng }}"
data-max-bounds-lat2="{{ max_bounds.corner2.lat }}"
data-max-bounds-lng2="{{ max_bounds.corner2.lng }}"
{% endif %}
{% endblock %}
data-cell-id="{{ cell.pk }}"
>
{% endlocalize %}
<script>
var tiles_{{ cell.pk }} = [];
{% for layer in tiles_layers %}
tiles_{{ cell.pk }}.push({
tile_urltemplate: {{ layer.tile_urltemplate|as_json|safe }},
map_attribution: {{ layer.map_attribution|as_json|safe }},
opacity: {{ layer.opacity|as_json|safe }}
});
{% endfor %}
var geojson_{{ cell.pk }} = Object();
{% for layer in geojson_layers %}
geojson_{{ cell.pk }}[{{ layer.slug|as_json|safe }}] = {{layer|as_json|safe}};
{% endfor %}
</script>
</div>
{% endblock %}