Skip to content

Commit 4545b69

Browse files
committed
Added menu choices to Zoom to Source Graphic(s) and to Clear Source Graphic(s).
Also adjusted handling of "Zoom to Buffer" and "Clear Buffer" buttons which sometimes were not appearing.
1 parent 93bdfb7 commit 4545b69

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

widgets/AttributesTable/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ toolbarOptions: {
427427
*/
428428
selected: true,
429429

430+
/*
431+
Allow the user to zoom to the source graphic(s)
432+
*/
433+
source: true,
434+
430435
/*
431436
Allow the user to zoom to the buffer
432437
*/
@@ -450,6 +455,11 @@ toolbarOptions: {
450455
*/
451456
selected: true,
452457

458+
/*
459+
Allow the user to clear the source graphic(s)
460+
*/
461+
source: true,
462+
453463
/*
454464
Allow the user to clear the buffer
455465
*/

widgets/AttributesTable/_ToolbarMixin.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ define([
3636
grid: true,
3737
features: true,
3838
selected: true,
39+
source: true,
3940
buffer: true
4041
},
4142

@@ -91,7 +92,10 @@ define([
9192
display = (options.selected && featOptions.selected) ? 'block' : 'none';
9293
domStyle.set(this.attributesTableZoomToSelected.domNode, 'display', display);
9394

94-
display = (options.buffer && featOptions.buffer) ? 'block' : 'none';
95+
display = (options.source && featOptions.source) ? 'block' : 'none';
96+
domStyle.set(this.attributesTableZoomToSource.domNode, 'display', display);
97+
98+
display = (options.buffer) ? 'block' : 'none';
9599
domStyle.set(this.attributesTableZoomToBuffer.domNode, 'display', display);
96100
},
97101

@@ -113,7 +117,11 @@ define([
113117
itemCount += (display === 'none') ? 0 : 1;
114118
domStyle.set(this.attributesTableClearSelected.domNode, 'display', display);
115119

116-
display = (options.buffer && featOptions.buffer) ? 'block' : 'none';
120+
display = (options.source && featOptions.source) ? 'block' : 'none';
121+
itemCount += (display === 'none') ? 0 : 1;
122+
domStyle.set(this.attributesTableClearSource.domNode, 'display', display);
123+
124+
display = (options.buffer) ? 'block' : 'none';
117125
itemCount += (display === 'none') ? 0 : 1;
118126
domStyle.set(this.attributesTableClearBuffer.domNode, 'display', display);
119127

@@ -140,6 +148,10 @@ define([
140148
this.attributesTableClearSelected.set('disabled', disabled);
141149
this.attributesTableZoomToSelected.set('disabled', disabled);
142150

151+
disabled = (this.sourceGraphics && this.sourceGraphics.graphics && this.sourceGraphics.graphics.length > 0) ? false : true;
152+
this.attributesTableClearSource.set('disabled', disabled);
153+
this.attributesTableZoomToSource.set('disabled', disabled);
154+
143155
disabled = (this.bufferGraphics && this.bufferGraphics.graphics.length > 0) ? false : true;
144156
this.attributesTableClearBuffer.set('disabled', disabled);
145157
this.attributesTableZoomToBuffer.set('disabled', disabled);

widgets/AttributesTable/nls/AttributesTable.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ define({
2828
zoom: {
2929
title: 'Zoom',
3030
zoomToFeatures: 'Zoom To All Features',
31-
zoomToSelectedFeatures: 'Zoom To Selected Features',
31+
zoomToSelectedFeatures: 'Zoom To Selected Feature(s)',
32+
zoomToSourceGraphics: 'Zoom To Source Graphic(s)',
3233
zoomToBuffer: 'Zoom To Buffer'
3334
},
3435

3536
clear: {
3637
title: 'Clear',
3738
clearFeatures: 'Clear All Features',
38-
clearSelectedFeatures: 'Clear Selected Features',
39+
clearSelectedFeatures: 'Clear Selected Feature(s)',
40+
clearSourceGraphics: 'Clear Source Graphic(s)',
3941
clearBufferGraphics: 'Clear Buffer',
4042
clearGrid: 'Clear Grid',
4143
clearAll: 'Clear All'

widgets/AttributesTable/templates/AttributesTable.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<div data-dojo-type="dijit/DropDownMenu" data-dojo-attach-point="attributesTableZoomMenu">
66
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableZoomToFeatures" data-dojo-attach-event="onClick:zoomToFeatureGraphics">${i18n.menus.zoom.zoomToFeatures}</div>
77
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableZoomToSelected" data-dojo-attach-event="onClick:zoomToSelectedGraphics">${i18n.menus.zoom.zoomToSelectedFeatures}</div>
8+
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableZoomToSource" data-dojo-attach-event="onClick:zoomToSourceGraphics">${i18n.menus.zoom.zoomToSourceGraphics}</div>
89
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableZoomToBuffer" data-dojo-attach-event="onClick:zoomToBufferGraphics">${i18n.menus.zoom.zoomToBuffer}</div>
910
</div>
1011
</div>
@@ -13,8 +14,9 @@
1314
<div data-dojo-type="dijit/DropDownMenu" data-dojo-attach-point="attributesTableClearMenu">
1415
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableClearFeatures" data-dojo-attach-event="onClick:clearFeatures">${i18n.menus.clear.clearFeatures}</div>
1516
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableClearSelected" data-dojo-attach-event="onClick:clearSelectedFeatures">${i18n.menus.clear.clearSelectedFeatures}</div>
16-
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableClearGrid" data-dojo-attach-event="onClick:clearGrid">${i18n.menus.clear.clearGrid}</div>
17+
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableClearSource" data-dojo-attach-event="onClick:clearSourceGraphics">${i18n.menus.clear.clearSourceGraphics}</div>
1718
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableClearBuffer" data-dojo-attach-event="onClick:clearBufferGraphics">${i18n.menus.clear.clearBufferGraphics}</div>
19+
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableClearGrid" data-dojo-attach-event="onClick:clearGrid">${i18n.menus.clear.clearGrid}</div>
1820
<div data-dojo-type="dijit/MenuItem" data-dojo-attach-point="attributesTableClearAll" data-dojo-attach-event="onClick:clearAll">${i18n.menus.clear.clearAll}</div>
1921
</div>
2022
</div>

0 commit comments

Comments
 (0)