[Commits] r2735 - in sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing: examples lib/GeoExt.ux/widgets
commits at geoext.org
commits at geoext.org
Tue Jun 28 15:53:48 CEST 2011
Author: adube
Date: 2011-06-28 15:53:48 +0200 (Tue, 28 Jun 2011)
New Revision: 2735
Modified:
sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/examples/WFSTFeatureEditing.html
sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/examples/WFSTFeatureEditing.js
sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.js
Log:
WFSTFeatureEditing - auto show WMS layer sibling upon editing activation
Modified: sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/examples/WFSTFeatureEditing.html
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/examples/WFSTFeatureEditing.html 2011-06-28 13:06:31 UTC (rev 2734)
+++ sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/examples/WFSTFeatureEditing.html 2011-06-28 13:53:48 UTC (rev 2735)
@@ -39,15 +39,17 @@
filter mode. Enabling the 'edit' mode on a layer doesn't show the
features yet. You need to draw a box on the map to get the features
first, then click on the feature you wish to edit. You can also select it
- from the grid on the left of the window. If you only one feature was
+ from the grid on the left of the window that pops up when you select a
+ feature. If only one feature was
returned by box you drawn, it's automatically selected. The
"Return to selection" button clears the features that were returned by the
box and reenable the box selection.
</p>
<p>
While creating vector layers with a WFS protocol, if a WMS layer having
- the same name present in the map, it will be automatically refreshed on
- modifications each modifications. This feature is shown in this demo.
+ the same name present in the map, it will be automatically refreshed upon
+ each modifications and also automatically shown when editing is enabled on
+ its WFS counterpart. These features are shown in this demo.
</p>
<p>
The demo also available in <a href="WFSTFeatureEditingFR.html">French</a>.
@@ -62,13 +64,13 @@
<b>GeoExt.ux.FeatureEditorGrid</b> from the GeoExt.ux (user extension)
library, see the
<a target="_blank" href="http://trac.geoext.org/wiki/ux/FeatureEditing">
- widget wiki page</a>. It's the component drawn on the right of the
+ widget wiki page</a>. It's the grid drawn on the right of the
window.
</li>
<li>
<b>gpx.grid.FeatureGrid</b>, from the gpx library. See the
<a target="_blank" href="http://trac.geoext.org/wiki/ux/FeatureEditing">
- github page</a>. It's the component drawn on the left of the window.
+ github page</a>. It's the grid drawn on the left of the window.
</li>
</ul>
<script type="text/javascript"
Modified: sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/examples/WFSTFeatureEditing.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/examples/WFSTFeatureEditing.js 2011-06-28 13:06:31 UTC (rev 2734)
+++ sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/examples/WFSTFeatureEditing.js 2011-06-28 13:53:48 UTC (rev 2735)
@@ -51,13 +51,14 @@
toolbar = new Ext.Toolbar(actions);
// == MapPanel ==
- wmsOptions = {isBaseLayer: false, singleTile: true};
+ wmsOptions = {isBaseLayer: false, singleTile: true, visibility: false};
mapPanel = new GeoExt.MapPanel({
region: "center",
layers: [
//new OpenLayers.Layer.OSM(),
new OpenLayers.Layer.WMS('Bathymetry', msURL, {
- transparent: true, layers: 'bathymetry'}, wmsOptions),
+ transparent: true, layers: 'bathymetry'},
+ Ext.applyIf({visibility: true}, wmsOptions)),
new OpenLayers.Layer.WMS('Drainage', msURL, {
transparent: true, layers: 'drainage'}, wmsOptions),
new OpenLayers.Layer.WMS('Roads', msURL, {
Modified: sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.js 2011-06-28 13:06:31 UTC (rev 2734)
+++ sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.js 2011-06-28 13:53:48 UTC (rev 2735)
@@ -221,6 +221,13 @@
*/
ignoredAttributes: {name:["the_geom", "id", "gid", "fid"]},
+ /** api: config[showWMSSibling]
+ * ``Boolean`` Whether to show (set visibility to true) or not the WMS
+ * sibling layer when activating the "draw" or "edit" controls.
+ * Defaults to true.
+ */
+ showWMSSibling: true,
+
/* PRIVATE*/
/** private: property[mainPanel]
@@ -571,7 +578,11 @@
var drawControl = new OpenLayers.Control.DrawFeature(layer, handler);
drawControl.events.on({
"activate": function() {
+ var wfstFE = this.layer.wfstFeatureEditing;
this.layer.setVisibility(true);
+ this.manager.showWMSSibling &&
+ wfstFE.wmsLayerSibling &&
+ wfstFE.wmsLayerSibling.setVisibility(true);
},
"deactivate": function() { this.layer.setVisibility(false); },
"featureadded": function(e) {
@@ -645,6 +656,13 @@
e.control.deactivateHandlers();
e.layer.wfstFeatureEditing.highlightControl.activate();
},
+ "activate": function(e) {
+ var layer = e.object.layer;
+ var wfstFE = layer.wfstFeatureEditing;
+ this.showWMSSibling &&
+ wfstFE.wmsLayerSibling &&
+ wfstFE.wmsLayerSibling.setVisibility(true);
+ },
"deactivate": function(e) {
var layer = e.object.layer;
layer.wfstFeatureEditing.highlightControl.deactivate();
@@ -661,15 +679,21 @@
});
selectControl.events.on({
"activate": function() {
+ var wfstFE = this.layer.wfstFeatureEditing;
this.layer.setVisibility(true);
- this.manager.useFilter === false &&
+ if (this.manager.useFilter === false) {
this.manager.toggleMainPanelContainer(true);
+ this.manager.showWMSSibling &&
+ wfstFE.wmsLayerSibling &&
+ wfstFE.wmsLayerSibling.setVisibility(true);
+ }
- this.layer.wfstFeatureEditing.featureGrid.enable();
+ wfstFE.featureGrid.enable();
this.manager.featureGridContainer.setActiveTab(
this.manager.featureGridContainer.items.items.indexOf(
- this.layer.wfstFeatureEditing.featureGrid)
+ wfstFE.featureGrid
+ )
);
},
"deactivate": function() {
More information about the Commits
mailing list