Mercurial > lada > lada-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
637:8acb3123b46c | 638:d21048cbdbb3 |
---|---|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU GPL (v>=3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | |
6 * the documentation coming with IMIS-Labordaten-Application for details. | |
7 */ | |
8 | |
9 /** | |
10 */ | |
11 Ext.define('Lada.controller.Map', { | |
12 extend: 'Ext.app.Controller', | |
13 | |
14 requires: [ | |
15 ], | |
16 | |
17 init: function() { | |
18 this.control({ | |
19 'maptoolbar button[action=add]': { | |
20 click: this.addLocation | |
21 } | |
22 }); | |
23 this.callParent(arguments); | |
24 }, | |
25 | |
26 addLocation: function(button) { | |
27 var mapPanel = button.up('map'); | |
28 var details = button.up('window').down('locationform'); | |
29 var newLocation = Ext.create('Lada.model.Location'); | |
30 details.setRecord(newLocation); | |
31 details.setReadOnly(false); | |
32 | |
33 mapPanel.activateDraw(newLocation); | |
34 } | |
35 }); |