Mercurial > lada > lada-client
comparison app/view/panel/Map.js @ 643:477379250512
Open the ort create window on button click.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 17 Mar 2015 16:05:52 +0100 |
parents | d21048cbdbb3 |
children | 7267bae1d43f |
comparison
equal
deleted
inserted
replaced
642:bd151c8b7ad1 | 643:477379250512 |
---|---|
30 /** | 30 /** |
31 * @private | 31 * @private |
32 * Initialize the map panel. | 32 * Initialize the map panel. |
33 */ | 33 */ |
34 initComponent: function() { | 34 initComponent: function() { |
35 var id = this.record ? this.record.get('id') : Math.floor(Math.random() * 100); | |
35 this.layers = [ | 36 this.layers = [ |
36 new OpenLayers.Layer.WMS( | 37 new OpenLayers.Layer.WMS( |
37 'Standard' + this.record.get('id'), | 38 'Standard' + id, |
38 'http://osm.intevation.de/cgi-bin/standard.fcgi?', | 39 'http://osm.intevation.de/cgi-bin/standard.fcgi?', |
39 { | 40 { |
40 layers: 'OSM-WMS-Dienst', | 41 layers: 'OSM-WMS-Dienst', |
41 format: 'image/png', | 42 format: 'image/png', |
42 BGCOLOR: '0xFFFFFF' | 43 BGCOLOR: '0xFFFFFF' |
44 isBaseLayer: true, | 45 isBaseLayer: true, |
45 buffer: 0, | 46 buffer: 0, |
46 visibility: true | 47 visibility: true |
47 }) | 48 }) |
48 ]; | 49 ]; |
49 this.map = new OpenLayers.Map('map_' + this.record.get('id'), { | 50 this.map = new OpenLayers.Map('map_' + id, { |
50 controls: [], | 51 controls: [], |
51 tileManager: null, | 52 tileManager: null, |
52 zoomMethod: null | 53 zoomMethod: null |
53 }); | 54 }); |
54 this.map.setOptions(this.mapOptions); | 55 this.map.setOptions(this.mapOptions); |
75 { | 76 { |
76 id: this.locationStore.getAt(i).get('id') | 77 id: this.locationStore.getAt(i).get('id') |
77 } | 78 } |
78 )); | 79 )); |
79 } | 80 } |
80 this.featureLayer = new OpenLayers.Layer.Vector('vector' + this.record.get('id'), { | 81 this.featureLayer = new OpenLayers.Layer.Vector('vector_' + this.map.name, { |
81 styleMap: new OpenLayers.StyleMap({ | 82 styleMap: new OpenLayers.StyleMap({ |
82 'default': new OpenLayers.Style(OpenLayers.Util.applyDefaults({ | 83 'default': new OpenLayers.Style(OpenLayers.Util.applyDefaults({ |
83 externalGraphic: 'resources/lib/OpenLayers/img/marker-green.png', | 84 externalGraphic: 'resources/lib/OpenLayers/img/marker-green.png', |
84 graphicOpacity: 1, | 85 graphicOpacity: 1, |
85 pointRadius: 10 | 86 pointRadius: 10 |
158 this.map.addControl(new OpenLayers.Control.ScaleLine()); | 159 this.map.addControl(new OpenLayers.Control.ScaleLine()); |
159 if (this.record) { | 160 if (this.record) { |
160 this.selectFeature(this.record.get('ort')); | 161 this.selectFeature(this.record.get('ort')); |
161 } | 162 } |
162 else { | 163 else { |
163 this.map.zoomToScale(this.mapOptions.scales[0]); | 164 this.map.zoomToMaxExtent(); |
164 } | 165 } |
165 }, | 166 }, |
166 | 167 |
167 beforeDestroy: function() { | 168 beforeDestroy: function() { |
168 if (this.map) { | 169 if (this.map) { |