Skip to content

Commit

Permalink
#226 add a button to reset the export form, including the drawn polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
gerald2545 committed Oct 10, 2019
1 parent 72b76f4 commit 0c204eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
15 changes: 14 additions & 1 deletion lib/js/public/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,10 @@ var southPanelFormExportPOI = new Ext.form.FormPanel({
],
buttonAlign: 'center',
buttons: [{
text: T_delete_polygon,
handler: deleteExistingPolygon,
iconCls: 'silk_delete'
},{
text: T_submit,
handler: exportPublicPOI, //createPublicPOI
iconCls: 'silk_add'
Expand Down Expand Up @@ -1479,7 +1483,16 @@ function isPOIFormValid() {
feat != null
);
}

function deleteExistingPolygon() {
console.log('in deleteExistingPolygon');
//if the new observation marker is not created on the map, do not allow to create the observation
if (exportPolygonFeature != null){
exportPolygonFeature.destroy();
exportPolygonFeature = null;
}
resetPOIForm();
polygonControl.activate();
}
function createPublicPOI() {
console.log('feat' + feat);
//if the new observation marker is not created on the map, do not allow to create the observation
Expand Down
3 changes: 2 additions & 1 deletion lib/js/translation_en.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,5 @@ var T_custom_polygone = 'Polygon coordinates';
var T_exportFormValidation = 'Only one field must be filled';
var T_exportChoice = 'Export choice';
var T_exportHelp = "Select a city OR a territory OR give a custom polygon (like \"POLYGON((1.30497 43.642535,1.30291 43.631851,1.304798 43.619052,1.311321 43.606748,1.320934 43.598792,1.30497 43.642535))\")";
var T_print = 'Print pdf';
var T_print = 'Print pdf';
var T_delete_polygon = 'Reinitialize the export form';
1 change: 1 addition & 0 deletions lib/js/translation_fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,4 @@ var T_exportFormValidation = 'Un seul et unique champ doit être renseigné';
var T_exportChoice = 'Choix d\'export';
var T_exportHelp = "Sélectionner un territoire OU un pôle OU une commune OU spécifiez un polygone soit en le dessinant sur la carte ou en le donnant sous la forme \"POLYGON((1.30497 43.642535,1.30291 43.631851,1.304798 43.619052,1.311321 43.606748,1.320934 43.598792,1.30497 43.642535))\"";
var T_print = 'Imprimer pdf';
var T_delete_polygon = 'Réinitialiser le formulaire d\'export';

0 comments on commit 0c204eb

Please sign in to comment.