[fusion-commits] r2238 - sandbox/jxlib-3.0/layers
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Sep 28 10:32:46 EDT 2010
Author: pagameba
Date: 2010-09-28 14:32:46 +0000 (Tue, 28 Sep 2010)
New Revision: 2238
Modified:
sandbox/jxlib-3.0/layers/Layers.js
Log:
refine editing notification to be at the virtual layer level, more useful there.
Modified: sandbox/jxlib-3.0/layers/Layers.js
===================================================================
--- sandbox/jxlib-3.0/layers/Layers.js 2010-09-28 14:21:57 UTC (rev 2237)
+++ sandbox/jxlib-3.0/layers/Layers.js 2010-09-28 14:32:46 UTC (rev 2238)
@@ -54,7 +54,6 @@
query: false,
edit: false
},
- bIsEditing: false,
initialize: function(map, mapTag, isMapWidgetLayer) {
// console.log('Fusion.Layers.initialize');
@@ -305,19 +304,9 @@
getMapTip: function(mapTipWidget) {},
- startEditing: function() {
- if (!this.bIsEditing && this.supports.edit) {
- this.bIsEditing = true;
- this.triggerEvent(Fusion.Event.LAYER_START_EDIT, this);
- }
- },
+ startEditing: function() { },
- stopEditing: function() {
- if (this.bIsEditing && this.supports.edit) {
- this.bIsEditing = false;
- this.triggerEvent(Fusion.Event.LAYER_STOP_EDIT, this);
- }
- }
+ stopEditing: function() { }
});
/***************************************************************************
@@ -486,6 +475,7 @@
this.actuallyVisible = o.actuallyVisible;
this.statusDefault = o.statusdefault;
this.editable = o.editable;
+ this.isEditing = false;
this.visible = o.visible;
this.initiallyVisible = o.visible;
this.selectable = o.selectable;
@@ -569,6 +559,20 @@
set: function(property, value) {
this[property] = value;
this.oMap.triggerEvent(Fusion.Event.LAYER_PROPERTY_CHANGED, this);
+ },
+
+ startEditing: function() {
+ if (this.oMap.supports.edit && this.editable && !this.isEditing) {
+ this.isEditing = true;
+ this.oMap.triggerEvent(Fusion.Event.LAYER_START_EDIT, this);
+ }
+ },
+
+ stopEditing: function() {
+ if (this.oMap.supports.edit && this.editable && this.isEditing) {
+ this.isEditing = false;
+ this.oMap.triggerEvent(Fusion.Event.LAYER_STOP_EDIT, this);
+ }
}
});
More information about the fusion-commits
mailing list