summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-09-20 10:31:37 +0200
committerClaude Paroz <claude@2xlibre.net>2012-09-20 10:31:37 +0200
commit89136b2725db3cb774ae4b39849684ae8f3847aa (patch)
tree02d47d2f9c3d8c63199825d9e6bc644dee7b5347 /django
parent7e32dab3a64570c67993d38b5bc25c9bd1f7455e (diff)
Fixed #16577 -- Added a map_creation block in openlayers.js template
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/templates/gis/admin/openlayers.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/contrib/gis/templates/gis/admin/openlayers.js b/django/contrib/gis/templates/gis/admin/openlayers.js
index f54b75e258..a67980da40 100644
--- a/django/contrib/gis/templates/gis/admin/openlayers.js
+++ b/django/contrib/gis/templates/gis/admin/openlayers.js
@@ -109,10 +109,12 @@ OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:3857", OpenLayers.Layer.Sp
{% autoescape off %}{% for item in map_options.items %} '{{ item.0 }}' : {{ item.1 }}{% if not forloop.last %},{% endif %}
{% endfor %}{% endautoescape %} };{% endblock %}
// The admin map for this geometry field.
+ {% block map_creation %}
{{ module }}.map = new OpenLayers.Map('{{ id }}_map', options);
// Base Layer
{{ module }}.layers.base = {% block base_layer %}new OpenLayers.Layer.WMS("{{ wms_name }}", "{{ wms_url }}", {layers: '{{ wms_layer }}'{{ wms_options|safe }}});{% endblock %}
{{ module }}.map.addLayer({{ module }}.layers.base);
+ {% endblock %}
{% block extra_layers %}{% endblock %}
{% if is_linestring %}OpenLayers.Feature.Vector.style["default"]["strokeWidth"] = 3; // Default too thin for linestrings. {% endif %}
{{ module }}.layers.vector = new OpenLayers.Layer.Vector(" {{ field_name }}");