# HG changeset patch # User Raimund Renkert # Date 1484747776 -3600 # Node ID 20a2466820ce2ffee007526525b9a3ead0af01ec # Parent 8012e5212bd56069c16128ce99139eee09356add# Parent 3b4dcc83a21b5e7aea8bac07d339ede26ece114a merged. diff -r 8012e5212bd5 -r 20a2466820ce Dockerfile_mini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Dockerfile_mini Wed Jan 18 14:56:16 2017 +0100 @@ -0,0 +1,57 @@ +# +# Build and run LADA-client (minified version) +# +# Build with e.g. `docker build --force-rm=true -t koala/lada_client_mini .' +# Run from the repository root-dir with e.g. +# `docker run --name lada_client +# --link lada_wildfly:lada-server +# -p 8180-8184:80-84 -d koala/lada_client_mini' +# +# The linked container may be created from the Dockerfile in the lada-server +# repository. +# +# The LADA-application will be available under http://yourdockerhost:8182 +# +# Add `-v $PWD:/var/www/html/' to the run-command if you want to +# test your local changes (you'll have to run ./install-dependencies.sh again). +# + +FROM debian:jessie +MAINTAINER mstanko@bfs.de + +RUN apt-get update -y && apt-get install -y curl unzip python apache2 ruby openjdk-7-jre + +# +# Install sencha cmd +# +RUN curl -O https://cdn.sencha.com/cmd/4.0.5.87/SenchaCmd-4.0.5.87-linux-x64.run.zip && unzip SenchaCmd-4.0.5.87-linux-x64.run.zip && chmod +x ./SenchaCmd-4.0.5.87-linux-x64.run && ./SenchaCmd-4.0.5.87-linux-x64.run --mode unattended +ENV PATH=~/bin/Sencha/Cmd/4.0.5.87:$PATH +ENV SENCHA_CMD_3_0_0="~/bin/Sencha/Cmd/4.0.5.87" + +ADD . /tmp/lada-client +WORKDIR /tmp/lada-client + +# +# Install dependencies +# +RUN ./install-dependencies.sh + +# +# compile and minify application +# +ENV VERSION=2.4.1 +RUN ./build.sh +RUN cd /var/www/html && cp -r /tmp/lada-client/lada-client-$VERSION/* . + +# +# httpd setup +# +RUN a2enmod proxy +RUN a2enmod proxy_http +RUN a2enmod headers +RUN ln -sf $PWD/custom-vhosts.conf /etc/apache2/conf-available/lada.conf +RUN a2enconf lada + +EXPOSE 80 81 82 83 84 + +CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] diff -r 8012e5212bd5 -r 20a2466820ce app/controller/form/Messprogramm.js --- a/app/controller/form/Messprogramm.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/controller/form/Messprogramm.js Wed Jan 18 14:56:16 2017 +0100 @@ -43,10 +43,10 @@ change: this.checkPeriod }, 'messprogrammform [name="teilintervallVon"]': { - change: this.synchronizeSlider, + change: this.synchronizeSlider }, 'messprogrammform [name="teilintervallBis"]': { - change: this.synchronizeSlider, + change: this.synchronizeSlider }, 'messprogrammform probenintervall combobox': { select: this.updateIntervalls diff -r 8012e5212bd5 -r 20a2466820ce app/controller/grid/Ortszuordnung.js --- a/app/controller/grid/Ortszuordnung.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/controller/grid/Ortszuordnung.js Wed Jan 18 14:56:16 2017 +0100 @@ -13,7 +13,8 @@ extend: 'Ext.app.Controller', requires: [ - 'Lada.view.window.Ortszuordnung' + 'Lada.view.window.Ortszuordnung', + 'Lada.view.form.Ortserstellung' ], /** @@ -30,6 +31,15 @@ }, 'ortszuordnunggrid button[action=delete]': { click: this.remove + }, + 'ortszuordnungwindow toolbar button[action=createort]':{ + click: this.createort + }, + 'ortszuordnungwindow toolbar button[action=frommap]':{ + click: this.frommap + }, + 'ortszuordnungwindow toolbar button[action=clone]':{ + click: this.cloneort } }); }, @@ -42,7 +52,7 @@ var probe = grid.up('window').record; var win = Ext.create('Lada.view.window.Ortszuordnung', { parentWindow: grid.up('window'), - probe: grid.up('window').down('probeform').record, + probe: probe, record: record, grid: grid }); @@ -103,5 +113,42 @@ } }); grid.down('button[action=delete]').disable(); + }, + + /** + * Opens the form for a new Messpunkt + */ + createort: function() { + Ext.create('Lada.view.form.Ortserstellung').show(); + }, + + /** + * + * Opens the form for a new Messpunkt, with prefilled coordinates. + * TODO Not functional yet + */ + frommap: function(button) { + var map = button.up('ortszuordnungwindow').down('map'); + // map.getClick(); + //TODO: wait for click return + Ext.create('Lada.view.form.Ortserstellung', { + presets: { + kda_id: 4, + koord_x_extern: 35000000, //TODO dummy values + koord_y_extern: 1000000 + } + }).show(); + }, + + /** + * Opens the form for a new Messpunkt, with all values prefilled from the currently + * selected item + */ + cloneort: function(button) { + var grid = button.up('ortszuordnungwindow').down('ortstammdatengrid').getView(); + var selected = grid.getSelectionModel().getSelection()[0]; + Ext.create('Lada.view.form.Ortserstellung', { + presets: selected.data + }).show(); } }); diff -r 8012e5212bd5 -r 20a2466820ce app/controller/grid/Status.js --- a/app/controller/grid/Status.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/controller/grid/Status.js Wed Jan 18 14:56:16 2017 +0100 @@ -20,7 +20,7 @@ this.control({ 'statusgrid': { edit: this.gridSave, - canceledit: this.cancelEdit, + canceledit: this.cancelEdit }, 'statusgrid button[action=add]': { click: this.add diff -r 8012e5212bd5 -r 20a2466820ce app/model/Messwert.js --- a/app/model/Messwert.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/model/Messwert.js Wed Jan 18 14:56:16 2017 +0100 @@ -34,8 +34,7 @@ return null; } return "<"; - }, -// defaultValue: null + } }, { name: 'messfehler', type: 'float' diff -r 8012e5212bd5 -r 20a2466820ce app/model/Probe.js --- a/app/model/Probe.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/model/Probe.js Wed Jan 18 14:56:16 2017 +0100 @@ -39,7 +39,7 @@ }, { name: 'datenbasisId' }, { - name: 'baId', + name: 'baId' }, { name: 'probenartId' }, { diff -r 8012e5212bd5 -r 20a2466820ce app/model/Probenzusatz.js --- a/app/model/Probenzusatz.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/model/Probenzusatz.js Wed Jan 18 14:56:16 2017 +0100 @@ -32,7 +32,7 @@ }, { name: 'beschreibung' }, { - name: 'messEinheitId', + name: 'messEinheitId' }, { name: 'zusatzwert' }, { diff -r 8012e5212bd5 -r 20a2466820ce app/store/DatensatzErzeuger.js --- a/app/store/DatensatzErzeuger.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/store/DatensatzErzeuger.js Wed Jan 18 14:56:16 2017 +0100 @@ -11,5 +11,5 @@ */ Ext.define('Lada.store.DatensatzErzeuger', { extend: 'Ext.data.Store', - model: 'Lada.model.DatensatzErzeuger', + model: 'Lada.model.DatensatzErzeuger' }); diff -r 8012e5212bd5 -r 20a2466820ce app/view/FilterPanel.js --- a/app/view/FilterPanel.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/FilterPanel.js Wed Jan 18 14:56:16 2017 +0100 @@ -45,7 +45,7 @@ }] }, { layout: { - type: 'hbox', + type: 'hbox' }, border: false, items: [{ diff -r 8012e5212bd5 -r 20a2466820ce app/view/form/Ortserstellung.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/form/Ortserstellung.js Wed Jan 18 14:56:16 2017 +0100 @@ -0,0 +1,286 @@ +/* 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. + */ + +/** + * Form to create a new Messpunkt + * TODO: layout, saving, model + */ +Ext.define('Lada.view.form.Ortserstellung', { + extend: 'Ext.form.Panel', + alias: 'widget.ortserstellungsform', + + model: 'Lada.model.Ortszuordnung',//TODO correct model needed + requires: [ + 'Lada.view.widget.Verwaltungseinheit', + 'Lada.view.widget.Staat' + ], + + width: 900, + height: 700, + bodyStyle: {background: '#fff'}, + layout: 'vbox', + scrollable: true, + margin: '5, 5, 0, 5', + border: 0, + floating: true, + closable: true, + + /** + * Preset values + */ + presets: null, + + initComponent: function() { + var i18n = Lada.getApplication().bundle; + var me = this; + this.items = [{ //TODO: layout and input types + title: 'Neuen Messpunkt anlegen', + dockedItems : [{ + xtype: 'toolbar', + dock: 'bottom', + border: '0, 1, 1, 1', + style: { + borderBottom: '1px solid #b5b8c8 !important', + borderLeft: '1px solid #b5b8c8 !important', + borderRight: '1px solid #b5b8c8 !important' + }, + items: ['->', { + text: i18n.getMsg('save'), + disabled: true, + action: 'save', + handler: me.saveOrt + }, { + text: i18n.getMsg('close'), + action: 'close', + handler: function() { + me.close(); + } + }] + }], + items : [{ + xtype: 'netzbetreiber', + editable: false, + readOnly: true, + submitValue: true, + fieldLabel: i18n.getMsg('netzbetreiberId'), + margin : '0, 5, 5, 5', + labelWidth: 80, + // value: XXX + // TODO: get netzbetreiber of current user + }, { + xtype: 'checkbox', + name: 'aktiv', + fieldLabel: 'aktiv:', + value: me.presets.aktiv? me.presets.aktiv:null + }, { + xtype: 'displayfield', + value: 'D', + labelWidth: 125, + maxLength: 1, + name: 'messpunktart', + fieldLabel: 'Art des Messpunktes:' + },{ + xtype: 'displayfield', + labelWidth: 125, + maxLength: 100, + name: 'OrtID', + fieldLabel: 'Ort/Messpunkt-ID:', + // TODO: needed? We can't set it, and it is not yet given + // for a new messpunkt + editable: false + }, { + xtype: 'staat', + labelWidth: 100, + fieldLabel: i18n.getMsg('staat'), + name: 'staatId', + width: 160, + listeners: { + change: { + fn: function() { me.checkCommitEnabled() } + } + } + }, { + xtype: 'verwaltungseinheit', + labelWidth: 125, + fieldLabel: i18n.getMsg('orte.gemeinde'), + name: 'gemeinde', + listeners: { + change: { + fn: function() { me.checkCommitEnabled() } + } + } + }, { + xtype: 'displayfield', + labelWidth: 125, + fieldLabel: i18n.getMsg('orte.kda'), + name: 'kdaId', + listeners: { + change: { + fn: function() { me.checkCommitEnabled() } + } + } + }, { + xtype: 'displayfield', + labelWidth: 125, + fieldLabel: i18n.getMsg('orte.koordx'), + name: 'koordXExtern', + listeners: { + change: { + fn: function() { me.checkCommitEnabled() } + } + } + }, { + xtype: 'displayfield', + labelWidth: 125, + fieldLabel: i18n.getMsg('orte.koordy'), + name: 'koordYExtern', + listeners: { + change: { + fn: function() { me.checkCommitEnabled() } + } + } + }, { + xtype: 'displayfield', + labelWidth: 125, + fieldLabel: 'Höhe:', + name: 'hoehe', //TODO: hohe_ueber_NN? + }, { + xtype: 'displayfield', + labelWidth: 125, + maxLength: 100, + name: 'kurztext', + fieldLabel: 'Kurztext:' + },{ + xtype: 'displayfield', + labelWidth: 125, + fieldLabel: i18n.getMsg('orte.langtext'), + name: 'langtext' + },{ + xtype: 'displayfield', + labelWidth: 125, + fieldLabel: 'Berichtstext:', + name: 'berichtstext' + }] + }]; +//TODO: +// 'Anlage:'? +// zone +// sektor +// zustaendigkeit +// Messregime (mpArt) +// 'Prog.-Punkt:', ? +// nutsCode +// Ortszusatz-ID (ozId) + me.callParent(arguments); + this.prefillForm(); + }, + + /** + * checks Messpunktart and if the Messpunkt can be committed. + * Disables the save button if false + */ + // TODO messpunktart is not yet finally defined + checkCommitEnabled: function() { + var savebutton = this.down('toolbar').down('button[action=save]'); + var form = this.getForm(); + if (this.checkCoordinates()) { + form.findField('messpunktart').setValue('D'); + savebutton.setDisabled(false); + } else if (form.findField('gemeinde').getValue()) { + form.findField('messpunktart').setValue('V'); + savebutton.setDisabled(false); + } else if (form.findField('staatId')) { + form.findField('messpunktart').setValue('S'); + savebutton.setDisabled(false); + } else { + form.findField('messpunktart').setValue('D'); + savebutton.setDisabled(true); + } + }, + + /** + * Validates the coordinate fields kdaId, koordXExtern, koordYExtern + */ + checkCoordinates: function() { + var x = this.getForm().findField('koordXExtern').getValue(); + var y = this.getForm().findField('koordYExtern').getValue(); + var kda = this.getForm().findField('kdaId').getValue(); + if (x && y && kda) { + if (kda === 4){ + if (x > -180 && x < 180 + && y > -90 && y < 90) { + return true; + } else { + // TODO: WGS84 (degrees- decimal), coordinates invalid + return false; + } + } else if (kda === 5){ + if (x >= 1000000 && x < 61000000 && + y > -10000000 && y < 10000000) { + return true; + } else { + // TODO: UTM, coordinates invalid + return false; + } + } else { + // TODO KDA not supported + return false; + } + } else { + // TODO: not all fields filled in + return false; + } + }, + + saveOrt: function(){ + // TODO not yet implemented + alert("save!"); + }, + + /** + * Fill the form with values passed by presets. + // TODO Find a shorter way of setting all these + */ + prefillForm: function() { + var form = this.getForm(); + if (this.presets.aktiv) { + form.findField('aktiv').setValue(this.presets.aktiv); + } + if (this.presets.staatId) { + // TODO: staatID != staatISO + form.findField('staatId').setValue(me.presets.staatId); + } + if (this.presets.gemeinde) { + // TODO: ortId != gemeinde + form.findField('gemeinde').setValue(this.presets.gemeinde); + } + if (this.presets.kdaId) { + form.findField('kdaId').setValue(this.presets.kdaId); + } + if (this.presets.koordXExtern) { + form.findField('koordXExtern').setValue(this.presets.koordXExtern); + } + if (this.presets.koordYExtern) { + form.findField('koordYExtern').setValue(this.presets.koordYExtern); + } + if (this.presets.hoehe) { + // TODO hohe_ueber_NN? + form.findField('hoehe').setValue(me.presets.hoehe); + } + if (this.presets.kurztext) { + form.findField('kurztext').setValue(this.presets.kurztext); + } + if (this.presets.langtext) { + form.findField('langtext').setValue(this.presets.langtext); + } + if (this.presets.berichtstext) { + form.findField('berichtstext').setValue(this.presets.berichtstext); + } + } +}); + diff -r 8012e5212bd5 -r 20a2466820ce app/view/grid/Messwert.js --- a/app/view/grid/Messwert.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/grid/Messwert.js Wed Jan 18 14:56:16 2017 +0100 @@ -115,7 +115,7 @@ width: 80, editor: { xtype: 'expnumberfield', - allowBlank: false, + allowBlank: false }, renderer: function(value) { if (!value || value === '') { @@ -172,7 +172,7 @@ dataIndex: 'nwgZuMesswert', width: 80, editor: { - xtype: 'expnumberfield', + xtype: 'expnumberfield' }, renderer: function(value) { if (!value || value === '') { diff -r 8012e5212bd5 -r 20a2466820ce app/view/grid/Probenzusatzwert.js --- a/app/view/grid/Probenzusatzwert.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/grid/Probenzusatzwert.js Wed Jan 18 14:56:16 2017 +0100 @@ -93,7 +93,7 @@ dataIndex: 'messwertPzs', flex: 1, editor: { - xtype: 'expnumberfield', + xtype: 'expnumberfield' }, renderer: function(value) { if (!value || value === '') { @@ -124,7 +124,7 @@ dataIndex: 'nwgZuMesswert', flex: 1, editor: { - xtype: 'expnumberfield', + xtype: 'expnumberfield' }, renderer: function(value) { if (!value || value === '') { diff -r 8012e5212bd5 -r 20a2466820ce app/view/grid/Status.js --- a/app/view/grid/Status.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/grid/Status.js Wed Jan 18 14:56:16 2017 +0100 @@ -187,7 +187,7 @@ this.store.load({ params: { - messungsId: this.recordId, + messungsId: this.recordId } }); }, diff -r 8012e5212bd5 -r 20a2466820ce app/view/panel/Map.js --- a/app/view/panel/Map.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/panel/Map.js Wed Jan 18 14:56:16 2017 +0100 @@ -27,11 +27,12 @@ /** * @cfg * OpenLayers map options. + * Please note that TMS zoom levels are roughly as this: + * 7 = 1:4000000 14 = 1:35000 */ mapOptions: { maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), - //scales: [5000000, 3000000, 2000000, 1000000, 500000, 250000, 100000, 25000], - //numZoomLevels: 7, + numZoomLevels: 15, projection: 'EPSG:3857', displayProjection: new OpenLayers.Projection('EPSG:4326') }, @@ -59,7 +60,10 @@ this.map = new OpenLayers.Map('map_' + id, { controls: [], tileManager: null, - zoomMethod: null + zoomMethod: null, + // initializing with view centered on germany + center: new OpenLayers.LonLat(1160000,6694000), + zoom: 7 }); this.map.setOptions(this.mapOptions); this.map.addLayers(this.layers); @@ -89,12 +93,20 @@ if (!record.get('id') || record.get('id') === '') { return; } - var feature = this.featureLayer.getFeaturesByAttribute('id', record.get('id')); + var feature = this.featureLayer.getFeaturesByAttribute('id', record.get('id'))[0]; this.map.setCenter( - new OpenLayers.LonLat(feature[0].geometry.x, feature[0].geometry.y)); - this.map.zoomToScale(this.mapOptions.scales[5]); - this.selectControl.unselectAll(); - this.selectControl.select(feature[0]); + new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y)); + this.map.zoomTo(12); + + if (this.selectedFeatureLayer) { + if (this.selectedFeatureLayer.features.lenght > 0) { + this.featureLayer.addFeatures(this.selectedFeatureLayer.features); + } + this.selectedFeatureLayer.addFeatures([feature]); + } else { + this.selectControl.select(feature); + } + //TODO: the text of new features is still drawn on top of the old feature's text }, activateDraw: function(record) { @@ -138,7 +150,7 @@ // Create a new Feature Layer and add it to the map if (!this.featureLayer) { - this.featureLayer = new OpenLayers.Layer.Vector('alle Messpunkte', { + this.featureLayer = new OpenLayers.Layer.Vector( 'alle Messpunkte', { styleMap: new OpenLayers.StyleMap({ 'default': new OpenLayers.Style(OpenLayers.Util.applyDefaults({ externalGraphic: 'resources/lib/OpenLayers/img/marker-green.png', @@ -158,9 +170,10 @@ fontWeight: 'bold' }) }), - projection: new OpenLayers.Projection('EPSG:4326'), + projection: new OpenLayers.Projection('EPSG:3857'), preFeatureInsert: function(feature) { - feature.geometry.transform(new OpenLayers.Projection('EPSG:4326'), new OpenLayers.Projection('EPSG:3857')); + feature.geometry.transform(new OpenLayers.Projection('EPSG:4326'), + new OpenLayers.Projection('EPSG:3857')); } }); this.selectControl = new OpenLayers.Control.SelectFeature(this.featureLayer, { @@ -169,6 +182,7 @@ multiple: false, hover: false, onSelect: me.selectedFeature, + layers: [me.featureLayer], scope: me }); this.map.addControl(this.selectControl); @@ -177,10 +191,9 @@ this.featureLayer.removeAllFeatures(); this.featureLayer.addFeatures(locationFeatures); this.map.addLayer(this.featureLayer); - + this.featureLayer.setZIndex(500); }, - /** * @private * Override to display and update the map view in the panel. @@ -197,7 +210,8 @@ /** * Forward OpenlayersEvent to EXT */ - selectedFeature: function() { + selectedFeature: function(feature) { + this.selectControl.unselectAll({except:feature}); this.fireEvent('featureselected', this, arguments); }, diff -r 8012e5212bd5 -r 20a2466820ce app/view/panel/Ort.js --- a/app/view/panel/Ort.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/panel/Ort.js Wed Jan 18 14:56:16 2017 +0100 @@ -95,7 +95,7 @@ afterRender: function() { this.superclass.afterRender.apply(this, arguments); - this.down('map').map.zoomToMaxExtent(); + this.down('map').map.zoomTo(6); }, setStore: function(store) { diff -r 8012e5212bd5 -r 20a2466820ce app/view/window/FileUpload.js --- a/app/view/window/FileUpload.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/window/FileUpload.js Wed Jan 18 14:56:16 2017 +0100 @@ -107,6 +107,7 @@ var win = Ext.create('Lada.view.window.ImportResponse', { data: response.response.responseText, message: response.message, + modal: true, fileName: file.config.fileApiObject.name, title: 'Importergebnis' }); diff -r 8012e5212bd5 -r 20a2466820ce app/view/window/GenProbenFromMessprogramm.js --- a/app/view/window/GenProbenFromMessprogramm.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/window/GenProbenFromMessprogramm.js Wed Jan 18 14:56:16 2017 +0100 @@ -71,7 +71,7 @@ timeout: 2 * 60 * 1000, jsonData: jsondata, success: me.onSuccess, - failure: me.onFailure, + failure: me.onFailure }); } }]; diff -r 8012e5212bd5 -r 20a2466820ce app/view/window/Ortszuordnung.js --- a/app/view/window/Ortszuordnung.js Wed Jan 18 14:54:38 2017 +0100 +++ b/app/view/window/Ortszuordnung.js Wed Jan 18 14:56:16 2017 +0100 @@ -15,6 +15,7 @@ requires: [ 'Lada.view.form.Ortszuordnung', + 'Lada.view.form.Ortserstellung', 'Lada.view.panel.Ort' ], @@ -103,10 +104,9 @@ layout: 'fit', name: 'ortgrid', hidden: true, - maxHeight: '45%', + maxHeight: 240, items: [{ - xtype: 'ortstammdatengrid', - maxHeight: '45%' + xtype: 'ortstammdatengrid' }], dockedItems: [{ xtype: 'toolbar', @@ -123,20 +123,18 @@ fieldLabel: i18n.getMsg('ortszuordnung.ortsuche'), }, '->', { text: i18n.getMsg('orte.new'), - action: 'createort', + action: 'createort' }, { text: i18n.getMsg('orte.frommap'), - action: 'frommap', + action: 'frommap' }, { text: i18n.getMsg('orte.clone'), - action: 'clone', - }, { - text: i18n.getMsg('orte.select'), - action: 'select', + action: 'clone' }] }] }] }]; + this.callParent(arguments); }, @@ -170,19 +168,35 @@ osg.setLoading(false); map.setLoading(false); osg.setStore(ortstore); - var store = Ext.create('Lada.store.Orte', { - autoLoad: false - }); - store.add(ortstore.getRange()); - var rec = store.getById(me.record.get('ortId')); - store.remove(rec); - console.log(rec); - map.addLocations(store); + map.addLocations(ortstore); + map.featureLayer.setVisibility(false); + map.selectedFeatureLayer = new OpenLayers.Layer.Vector( + 'gewählter Messpunkt', { + styleMap: new OpenLayers.StyleMap({ + externalGraphic: 'resources/lib/OpenLayers/img/marker-blue.png', + pointRadius: 10, + label: '${bez}', + labelAlign: 'rt', + fontColor: 'blue', + fontWeight: 'bold', + }), + displayInLayerSwitcher: false, + projection: new OpenLayers.Projection('EPSG:3857') + }); + map.map.addLayer(map.selectedFeatureLayer); + map.selectedFeatureLayer.setZIndex(499); + var ortId = me.record.get('ortId'); + if (ortId){ + var feat = map.featureLayer.getFeaturesByAttribute('id', ortId)[0]; + map.selectControl.select(feat); + } } } } }); ortstore.load(); + map.addListener('featureselected', osg.selectOrt, osg); + osg.addListener('select', map.selectFeature, map); }, /** @@ -193,7 +207,6 @@ this.superclass.afterRender.apply(this, arguments); var map = this.down('map'); map.map.addControl(new OpenLayers.Control.LayerSwitcher()); - //map.map.zoomToMaxExtent(); }, /** diff -r 8012e5212bd5 -r 20a2466820ce build.sh --- a/build.sh Wed Jan 18 14:54:38 2017 +0100 +++ b/build.sh Wed Jan 18 14:56:16 2017 +0100 @@ -31,7 +31,7 @@ cp -r resources/lib/FileSaver $VERSION/resources/lib/ cp -r resources/lib/FileSaver.js-master $VERSION/resources/lib/ cp -r resources/lib/OpenLayers $VERSION/resources/lib/ -cp -r resources/lib/openlayers-release-2.13.1 $VERSION/resources/lib/ +cp -r resources/lib/ol2-release-2.13.1 $VERSION/resources/lib/ echo "Compressing...." tar -czf $VERSION.tgz $VERSION