summaryrefslogtreecommitdiff
path: root/django/contrib/gis/templates/gis/openlayers.html
blob: 4884f48106cad138e291483d9f288b7b80bbefc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<style type="text/css">{% block map_css %}
    #{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; }
    #{{ id }}_map .aligned label { float: inherit; }
    #{{ id }}_div_map { position: relative; vertical-align: top; float: {{ LANGUAGE_BIDI|yesno:"right,left" }}; }
    {% if not display_raw %}#{{ id }} { display: none; }{% endif %}
    .olControlEditingToolbar .olControlModifyFeatureItemActive {
        background-image: url("{{ STATIC_URL }}admin/img/gis/move_vertex_on.png");
        background-repeat: no-repeat;
    }
    .olControlEditingToolbar .olControlModifyFeatureItemInactive {
        background-image: url("{{ STATIC_URL }}admin/img/gis/move_vertex_off.png");
        background-repeat: no-repeat;
    }{% endblock %}
</style>

<div id="{{ id }}_div_map">
    <div id="{{ id }}_map"></div>
    <span class="clear_features"><a href="javascript:{{ module }}.clearFeatures()">Delete all Features</a></span>
    {% if display_raw %}<p>Debugging window (serialized value):</p>{% endif %}
    <textarea id="{{ id }}" class="vSerializedField required" cols="150" rows="10" name="{{ name }}">{{ serialized }}</textarea>
    <script type="text/javascript">
        {% block map_options %}var map_options = {};{% endblock %}
        {% block options %}var options = {
            geom_name: '{{ geom_type }}',
            id: '{{ id }}',
            map_id: '{{ id }}_map',
            map_options: map_options,
            map_srid: {{ map_srid }},
            name: '{{ name }}'
        };
        {% endblock %}
        var {{ module }} = new MapWidget(options);
    </script>
</div>