|
|
@@ -110,7 +110,7 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
$(priv.options.id).append(div);
|
|
|
|
|
|
_nodeProcesses.on('change', function() {
|
|
|
- console.log("onchange this:", this, this.selectedIndex, this.options);
|
|
|
+ if (priv.options.debug) console.log("onchange this:", this, this.selectedIndex, this.options);
|
|
|
var selection = this.options[this.selectedIndex].value;
|
|
|
if (this.selectedIndex > 0) {
|
|
|
OpenLayers.Request.GET({
|
|
|
@@ -125,7 +125,7 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
_process = new OpenLayers.Format.WPSDescribeProcess().read(
|
|
|
response.responseText
|
|
|
).processDescriptions[selection];
|
|
|
- console.log("Process:", _process);
|
|
|
+ if (priv.options.debug) console.log("Process:", _process);
|
|
|
priv.buildForm();
|
|
|
}
|
|
|
});
|
|
|
@@ -206,19 +206,19 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
|
|
|
_layer.events.on({
|
|
|
'beforefeaturemodified': function(e) {
|
|
|
- console.log('Event: beforefeaturemodified modified(', e.feature.attributes._modified, ')', e.feature.attributes, ' selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');// TODO: DBG
|
|
|
+ if (priv.options.debug) console.log('Event: beforefeaturemodified modified(', e.feature.attributes._modified, ')', e.feature.attributes, ' selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');// TODO: DBG
|
|
|
// NOTE: beforefeaturemodified from new node is fired before afterfeaturemodified from old node when click from one node to enother
|
|
|
priv.checkSelectedFeatureModifications('before');
|
|
|
priv.setSelectedFeature(e.feature);
|
|
|
},
|
|
|
'featuremodified': function(e) {
|
|
|
- console.log('Event: featuremodified modified(', e.feature.attributes._modified, ') ', e.feature.attributes, ' selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');// TODO: DBG
|
|
|
+ if (priv.options.debug) console.log('Event: featuremodified modified(', e.feature.attributes._modified, ') ', e.feature.attributes, ' selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');// TODO: DBG
|
|
|
_selectedFeature.attributes._modified = 1;
|
|
|
},
|
|
|
'afterfeaturemodified': function(e) {
|
|
|
- console.log('Event: afterfeaturemodified fid('+e.feature.fid+'/'+(_selectedFeature ? _selectedFeature.fid : 'null')+') modified(', e.feature.attributes._modified, ') ', e.feature.attributes, ' selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');// TODO: DBG
|
|
|
+ if (priv.options.debug) console.log('Event: afterfeaturemodified fid('+e.feature.fid+'/'+(_selectedFeature ? _selectedFeature.fid : 'null')+') modified(', e.feature.attributes._modified, ') ', e.feature.attributes, ' selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');// TODO: DBG
|
|
|
if (_selectedFeature && _selectedFeature.fid != e.feature.fid) {
|
|
|
- console.log('Event: afterfeaturemodified pomiń check!');
|
|
|
+ if (priv.options.debug) console.log('Event: afterfeaturemodified pomiń check!');
|
|
|
} else {
|
|
|
priv.checkSelectedFeatureModifications('after');
|
|
|
priv.setSelectedFeature(null);
|
|
|
@@ -297,12 +297,12 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
});
|
|
|
btnSelectFeature.events.on({
|
|
|
"boxselectionend": function(e) {
|
|
|
- console.log('SelectFeature boxselectionend event', e, e.bounds);
|
|
|
+ if (priv.options.debug) console.log('SelectFeature boxselectionend event', e, e.bounds);
|
|
|
if (typeof priv.options.onSelectBox == "function") {
|
|
|
var layerProj = _map.getProjectionObject();
|
|
|
var targetProj = new OpenLayers.Projection("EPSG:4326");
|
|
|
var bounds = e.bounds.transform(layerProj, targetProj);
|
|
|
- console.log('SelectFeature boxselectionend event bounds', bounds);
|
|
|
+ if (priv.options.debug) console.log('SelectFeature boxselectionend event bounds', bounds);
|
|
|
priv.options.onSelectBox.call(this, bounds);
|
|
|
}
|
|
|
}
|
|
|
@@ -397,7 +397,7 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
|
|
|
priv.updateState = function() {
|
|
|
// TODO: update state view
|
|
|
- //console.log('updateState: _selectedFeature:', _selectedFeature, ' _selectedRecordId:', _selectedRecordId);
|
|
|
+ //if (priv.options.debug) console.log('updateState: _selectedFeature:', _selectedFeature, ' _selectedRecordId:', _selectedRecordId);
|
|
|
if (_selectedFeature || _selectedRecordId) {
|
|
|
|
|
|
} else {
|
|
|
@@ -424,7 +424,7 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
};
|
|
|
|
|
|
priv.isSelectedFeature = function() {
|
|
|
- console.log('_selectedFeature:', _selectedFeature);
|
|
|
+ if (priv.options.debug) console.log('_selectedFeature:', _selectedFeature);
|
|
|
return (_selectedFeature)? true : false;
|
|
|
};
|
|
|
|
|
|
@@ -453,7 +453,11 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
priv.saveSelectedFeature = function() {
|
|
|
if (priv.isSelectedFeatureModified()) {
|
|
|
if (typeof priv.options.onSaveFeature == "function") {
|
|
|
- var selFeatureExtent = new OpenLayers.Format.WKT().write(_selectedFeature);
|
|
|
+ var sourceProj = _map.getProjectionObject();
|
|
|
+ var targetProj = new OpenLayers.Projection("EPSG:4326");
|
|
|
+ var selFeatureGeometry = _selectedFeature.geometry.clone();
|
|
|
+ var selFeatureGeomTransformed = selFeatureGeometry.transform(sourceProj, targetProj);
|
|
|
+ var selFeatureExtent = new OpenLayers.Format.WKT().extractGeometry(selFeatureGeomTransformed);
|
|
|
priv.options.onSaveFeature.call(this, _selectedRecordId, selFeatureExtent);
|
|
|
}
|
|
|
}
|
|
|
@@ -563,7 +567,7 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
this.innerHTML = new OpenLayers.Format.WKT().write(
|
|
|
_layer.selectedFeatures[0]
|
|
|
);
|
|
|
- console.log('_layer.selectedFeatures[0]: ', _layer.selectedFeatures[0]);
|
|
|
+ if (priv.options.debug) console.log('_layer.selectedFeatures[0]: ', _layer.selectedFeatures[0]);
|
|
|
}
|
|
|
priv.createCopy(input, this, priv.addWKTInput);
|
|
|
};
|