Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #16577 -- Added a map_creation block in openlayers.js template

  • Loading branch information...
commit 89136b2725db3cb774ae4b39849684ae8f3847aa 1 parent 7e32dab
Claude Paroz authored September 20, 2012
2  django/contrib/gis/templates/gis/admin/openlayers.js
@@ -109,10 +109,12 @@ OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:3857", OpenLayers.Layer.Sp
109 109
 {% autoescape off %}{% for item in map_options.items %}      '{{ item.0 }}' : {{ item.1 }}{% if not forloop.last %},{% endif %}
110 110
 {% endfor %}{% endautoescape %}    };{% endblock %}
111 111
     // The admin map for this geometry field.
  112
+    {% block map_creation %}
112 113
     {{ module }}.map = new OpenLayers.Map('{{ id }}_map', options);
113 114
     // Base Layer
114 115
     {{ module }}.layers.base = {% block base_layer %}new OpenLayers.Layer.WMS("{{ wms_name }}", "{{ wms_url }}", {layers: '{{ wms_layer }}'{{ wms_options|safe }}});{% endblock %}
115 116
     {{ module }}.map.addLayer({{ module }}.layers.base);
  117
+    {% endblock %}
116 118
     {% block extra_layers %}{% endblock %}
117 119
     {% if is_linestring %}OpenLayers.Feature.Vector.style["default"]["strokeWidth"] = 3; // Default too thin for linestrings. {% endif %}
118 120
     {{ module }}.layers.vector = new OpenLayers.Layer.Vector(" {{ field_name }}");
2  docs/ref/contrib/gis/admin.txt
@@ -45,7 +45,7 @@ GeoDjango's admin site
45 45
    .. attribute:: openlayers_url
46 46
 
47 47
    Link to the URL of the OpenLayers JavaScript.  Defaults to
48  
-   ``'http://openlayers.org/api/2.8/OpenLayers.js'``.
  48
+   ``'http://openlayers.org/api/2.11/OpenLayers.js'``.
49 49
 
50 50
 
51 51
    .. attribute:: modifiable

0 notes on commit 89136b2

Please sign in to comment.
Something went wrong with that request. Please try again.