comparison app/view/panel/Map.js @ 1289:bfdc00c24baf

Ortszuordnung for messprogramm and probe using same form
author Maximilian Krambach <mkrambach@intevation.de>
date Wed, 01 Feb 2017 14:52:51 +0100
parents 08085b7d1d0b
children 152fca74a839
comparison
equal deleted inserted replaced
1288:08085b7d1d0b 1289:bfdc00c24baf
87 this.locationStore = Ext.data.StoreManager.get('orte'); 87 this.locationStore = Ext.data.StoreManager.get('orte');
88 this.addLocations(this.locationStore); 88 this.addLocations(this.locationStore);
89 } 89 }
90 }, 90 },
91 91
92 /**
93 * Select a feature by record (a Lada.model.Ort) and zoom to this Ort
94 */
92 selectFeature: function(model, record) { 95 selectFeature: function(model, record) {
93 if (!record.get('id') || record.get('id') === '') { 96 if (!record.get('id') || record.get('id') === '') {
94 return; 97 return;
95 } 98 }
96 var feature = this.featureLayer.getFeaturesByAttribute('id', record.get('id'))[0]; 99 var feature = this.featureLayer.getFeaturesByAttribute('id', record.get('id'))[0];
97 this.map.setCenter( 100 this.map.setCenter(
98 new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y)); 101 new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y));
99 this.map.zoomTo(12); 102 this.map.zoomTo(12);
100
101 if (this.selectedFeatureLayer) { 103 if (this.selectedFeatureLayer) {
102 if (this.selectedFeatureLayer.features.lenght > 0) { 104 this.selectControl.unselectAll();
103 this.featureLayer.addFeatures(this.selectedFeatureLayer.features); 105 this.selectedFeatureLayer.removeAllFeatures();
104 } 106 this.selectedFeatureLayer.addFeatures(feature);
105 this.selectedFeatureLayer.addFeatures([feature]);
106 } else { 107 } else {
108 this.selectControl.unselectAll();
107 this.selectControl.select(feature); 109 this.selectControl.select(feature);
108 } 110 }
109 //TODO: the text of new features is still drawn on top of the old feature's text
110 }, 111 },
111 112
112 activateDraw: function(record) { 113 activateDraw: function(record) {
113 this.locationRecord = record; 114 this.locationRecord = record;
114 if (!this.drawPoint) { 115 if (!this.drawPoint) {
161 fontColor: 'green', 162 fontColor: 'green',
162 fontWeight: 'bold' 163 fontWeight: 'bold'
163 }, OpenLayers.Feature.Vector.style['default'])), 164 }, OpenLayers.Feature.Vector.style['default'])),
164 'select': new OpenLayers.Style({ 165 'select': new OpenLayers.Style({
165 externalGraphic: 'resources/lib/OpenLayers/img/marker-blue.png', 166 externalGraphic: 'resources/lib/OpenLayers/img/marker-blue.png',
166 pointRadius: 15, 167 pointRadius: 12,
167 label: '${bez}', 168 label: '${bez}',
168 labelAlign: 'rt', 169 labelAlign: 'rt',
169 fontColor: 'blue', 170 fontColor: 'blue',
170 fontWeight: 'bold' 171 fontWeight: 'bold'
171 }) 172 })
209 210
210 /** 211 /**
211 * Forward OpenlayersEvent to EXT 212 * Forward OpenlayersEvent to EXT
212 */ 213 */
213 selectedFeature: function(feature) { 214 selectedFeature: function(feature) {
214 this.selectControl.unselectAll({except:feature});
215 this.fireEvent('featureselected', this, arguments); 215 this.fireEvent('featureselected', this, arguments);
216 }, 216 },
217 217
218 beforeDestroy: function() { 218 beforeDestroy: function() {
219 if (this.map) { 219 if (this.map) {

http://lada.wald.intevation.org