diff app/controller/Map.js @ 638:d21048cbdbb3

Added controllers for map and location form and handle new locations.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 17 Mar 2015 14:33:13 +0100
parents
children 6e28ebbe1a73
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/controller/Map.js	Tue Mar 17 14:33:13 2015 +0100
@@ -0,0 +1,35 @@
+/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
+ */
+
+/**
+ */
+Ext.define('Lada.controller.Map', {
+    extend: 'Ext.app.Controller',
+
+    requires: [
+    ],
+
+    init: function() {
+        this.control({
+            'maptoolbar button[action=add]': {
+                click: this.addLocation
+            }
+        });
+        this.callParent(arguments);
+    },
+
+    addLocation: function(button) {
+        var mapPanel = button.up('map');
+        var details = button.up('window').down('locationform');
+        var newLocation = Ext.create('Lada.model.Location');
+        details.setRecord(newLocation);
+        details.setReadOnly(false);
+
+        mapPanel.activateDraw(newLocation);
+    }
+});

http://lada.wald.intevation.org