Ticket #8972: ol_admin_delete_selected.2.diff
File ol_admin_delete_selected.2.diff, 2.1 KB (added by , 16 years ago) |
---|
-
django/contrib/gis/templates/gis/admin/openlayers.html
30 30 //]]> 31 31 </script> 32 32 <div id="{{ id }}_map"></div> 33 < a href="javascript:{{ module }}.clearFeatures()">Delete all Features</a>33 </p>Features: <a href="javascript:{{ module }}.clearSelectedFeatures()">Delete Selected</a> | <a href="javascript:{{ module }}.clearFeatures()">Delete All</a> 34 34 {% if display_wkt %}<p> WKT debugging window:</p>{% endif %} 35 35 <textarea id="{{ id }}" class="vWKTField required" cols="150" rows="10" name="{{ field_name }}">{{ wkt }}</textarea> 36 36 <script type="text/javascript">{% block init_function %}{{ module }}.init();{% endblock %}</script> -
django/contrib/gis/templates/gis/admin/openlayers.js
66 66 {{ module }}.clearFeatures = function (){ 67 67 {{ module }}.deleteFeatures(); 68 68 document.getElementById('{{ id }}').value = ''; 69 {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }});70 69 } 70 71 {{ module }}.clearSelectedFeatures = function (){ 72 var selected = {{ module }}.layers.vector.selectedFeatures; 73 if (selected && (selected.length > 0)) { 74 {{ module }}.layers.vector.removeFeatures(selected); 75 {{ module }}.modify_wkt(); 76 {{ module }}.map.getControlsByClass('OpenLayers.Control.ModifyFeature')[0].unselectFeature(); 77 } 78 } 79 71 80 // Add Select control 72 81 {{ module }}.addSelectControl = function(){ 73 var select = new OpenLayers.Control.SelectFeature({{ module }}.layers.vector, {'toggle' : true, 'clickout' : true });82 var select = new OpenLayers.Control.SelectFeature({{ module }}.layers.vector, {'toggle' : true, 'clickout' : true, 'multipleKey': "shiftKey",'multiple': true}); 74 83 {{ module }}.map.addControl(select); 75 84 select.activate(); 76 85 }