comparison app/view/panel/Map.js @ 1361:5c2d6812d85a

Merge behaviour of Stammdaten panel and ortszuordnungs grid according to the recent changes in Ortszuordnung and Ortserstellung.
author Maximilian Krambach <mkrambach@intevation.de>
date Tue, 07 Feb 2017 19:50:36 +0100
parents 26e0aec2eb31
children 94d35d5a7913
comparison
equal deleted inserted replaced
1360:d1dce50fa9a6 1361:5c2d6812d85a
118 this.selectControl.unselectAll(); 118 this.selectControl.unselectAll();
119 this.selectControl.select(feature); 119 this.selectControl.select(feature);
120 } 120 }
121 }, 121 },
122 122
123 activateDraw: function(record) { 123 activateDraw: function() {
124 this.locationRecord = record;
125 if (!this.drawPoint) { 124 if (!this.drawPoint) {
126 this.drawPoint = new OpenLayers.Control.DrawFeature(this.featureLayer, 125 this.drawPoint = new OpenLayers.Control.DrawFeature(this.featureLayer,
127 OpenLayers.Handler.Point); 126 OpenLayers.Handler.Point);
128 this.map.addControl(this.drawPoint); 127 this.map.addControl(this.drawPoint);
128 this.drawPoint.events.register('featureadded', this, this.featureAdded);
129 } 129 }
130 this.drawPoint.activate(); 130 this.drawPoint.activate();
131 this.drawPoint.events.register('featureadded', this, this.featureAdded);
132 }, 131 },
133 132
134 featureAdded: function(features) { 133 featureAdded: function(features) {
135 this.locationRecord.set('kdaId', 4);
136 features.feature.geometry.transform(new OpenLayers.Projection('EPSG:3857'), 134 features.feature.geometry.transform(new OpenLayers.Projection('EPSG:3857'),
137 new OpenLayers.Projection('EPSG:4326')); 135 new OpenLayers.Projection('EPSG:4326'));
138 this.locationRecord.set('koordYExtern', features.feature.geometry.y); 136 var parent = this.up('ortszuordnungwindow') || this.up('ortpanel');
139 this.locationRecord.set('koordXExtern', features.feature.geometry.x); 137 Ext.create('Lada.view.window.Ortserstellung', {
138 record: Ext.create('Lada.model.Ort',{
139 koordXExtern: features.feature.geometry.x,
140 koordYExtern: features.feature.geometry.y,
141 kdaId : 4,
142 ortTyp: 1
143 }),
144 parentWindow: parent
145 }).show();
140 this.drawPoint.deactivate(); 146 this.drawPoint.deactivate();
141 this.fireEvent('featureadded', this.locationRecord);
142 // this.selectControl.unselectAll();
143 // this.selectControl.select(features.feature);
144 }, 147 },
145 148
146 addLocations: function(locationStore) { 149 addLocations: function(locationStore) {
147 var me = this; 150 var me = this;
148 locationFeatures = []; 151 locationFeatures = [];

http://lada.wald.intevation.org