Ticket #14886: geomodeladmin_format_patch.diff
File geomodeladmin_format_patch.diff, 2.0 KB (added by , 14 years ago) |
---|
-
django/contrib/gis/admin/options.py
37 37 wms_url = 'http://labs.metacarta.com/wms/vmap0' 38 38 wms_layer = 'basic' 39 39 wms_name = 'OpenLayers WMS' 40 wms_options = {'format': 'image/jpeg'} 40 41 debug = False 41 42 widget = OpenLayersWidget 42 43 … … 77 78 class OLMap(self.widget): 78 79 template = self.map_template 79 80 geom_type = db_field.geom_type 81 wms_options = '' 82 if self.wms_options: 83 wms_options = ["%s: '%s'" % pair for pair in self.wms_options.items()] 84 wms_options = ', '.join(wms_options) 85 wms_options = ', ' + wms_options 80 86 params = {'default_lon' : self.default_lon, 81 87 'default_lat' : self.default_lat, 82 88 'default_zoom' : self.default_zoom, -
django/contrib/gis/templates/gis/admin/openlayers.js
108 108 // The admin map for this geometry field. 109 109 {{ module }}.map = new OpenLayers.Map('{{ id }}_map', options); 110 110 // Base Layer 111 {{ module }}.layers.base = {% block base_layer %}new OpenLayers.Layer.WMS( "{{ wms_name }}", "{{ wms_url }}", {layers: '{{ wms_layer }}' });{% endblock %}111 {{ module }}.layers.base = {% block base_layer %}new OpenLayers.Layer.WMS( "{{ wms_name }}", "{{ wms_url }}", {layers: '{{ wms_layer }}' {{ wms_options|safe }} } );{% endblock %} 112 112 {{ module }}.map.addLayer({{ module }}.layers.base); 113 113 {% block extra_layers %}{% endblock %} 114 114 {% if is_linestring %}OpenLayers.Feature.Vector.style["default"]["strokeWidth"] = 3; // Default too thin for linestrings. {% endif %}