Ticket #16577: 16577-1.diff

File 16577-1.diff, 1.2 KB (added by Claude Paroz, 7 years ago)

Add a map_creation block to openlayers.js

  • django/contrib/gis/templates/gis/admin/openlayers.js

    diff --git a/django/contrib/gis/templates/gis/admin/openlayers.js b/django/contrib/gis/templates/gis/admin/openlayers.js
    index c455bff..d358bc9 100644
    a b OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:3857", OpenLayers.Layer.Sp 
    107107{% autoescape off %}{% for item in map_options.items %}      '{{ item.0 }}' : {{ item.1 }}{% if not forloop.last %},{% endif %}
    108108{% endfor %}{% endautoescape %}    };{% endblock %}
    109109    // The admin map for this geometry field.
     110    {% block map_creation %}
    110111    {{ module }}.map = new OpenLayers.Map('{{ id }}_map', options);
    111112    // Base Layer
    112113    {{ module }}.layers.base = {% block base_layer %}new OpenLayers.Layer.WMS( "{{ wms_name }}", "{{ wms_url }}", {layers: '{{ wms_layer }}'} );{% endblock %}
    113114    {{ module }}.map.addLayer({{ module }}.layers.base);
     115    {% endblock %}
    114116    {% block extra_layers %}{% endblock %}
    115117    {% if is_linestring %}OpenLayers.Feature.Vector.style["default"]["strokeWidth"] = 3; // Default too thin for linestrings. {% endif %}
    116118    {{ module }}.layers.vector = new OpenLayers.Layer.Vector(" {{ field_name }}");
Back to Top