Index: django/contrib/gis/templates/gis/admin/openlayers.html =================================================================== --- django/contrib/gis/templates/gis/admin/openlayers.html (revision 8985) +++ django/contrib/gis/templates/gis/admin/openlayers.html (working copy) @@ -30,7 +30,7 @@ //]]>
-Delete all Features +Features: Delete Selected | Delete All {% if display_wkt %}WKT debugging window:
{% endif %} Index: django/contrib/gis/templates/gis/admin/openlayers.js =================================================================== --- django/contrib/gis/templates/gis/admin/openlayers.js (revision 8985) +++ django/contrib/gis/templates/gis/admin/openlayers.js (working copy) @@ -66,11 +66,20 @@ {{ module }}.clearFeatures = function (){ {{ module }}.deleteFeatures(); document.getElementById('{{ id }}').value = ''; - {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }}); } + +{{ module }}.clearSelectedFeatures = function (){ + var selected = {{ module }}.layers.vector.selectedFeatures; + if (selected && (selected.length > 0)) { + {{ module }}.layers.vector.removeFeatures(selected); + {{ module }}.modify_wkt(); + {{ module }}.map.getControlsByClass('OpenLayers.Control.ModifyFeature')[0].unselectFeature(); + } +} + // Add Select control {{ module }}.addSelectControl = function(){ - var select = new OpenLayers.Control.SelectFeature({{ module }}.layers.vector, {'toggle' : true, 'clickout' : true}); + var select = new OpenLayers.Control.SelectFeature({{ module }}.layers.vector, {'toggle' : true, 'clickout' : true, 'multipleKey': "shiftKey",'multiple': true}); {{ module }}.map.addControl(select); select.activate(); }