Add a navigation Ext.Toolbar to the UI. OpenLayers controls are added to the toolbar using GeoExt.Action. It contains the following controls by default :
- Zoom to maximum map extent
- Zoom in
- Zoom out
- Navigation
- Last extent
- Next extent
Beside the default buttons, it’s possible to add other button in the toolbar by using the <widgets> node in the <options> node.
Note
This widget must be added to the first widgets of the first resource or else it won’t be drawn. It is a bug that should be corrected in future releases.
Note
This widget must be defined only once.
Note
This widget deprecates the original Toolbar widget (which comes from the MapFish API).
Warning
This widget only works with ExtJS 3.0.0 or higher.
Sample configuration of a toolbar with no widgets added.
<geoexttoolbar>
<name>W_MyToolbar</name>
<options>
</options>
</geoexttoolbar>
Toolbar with more widgets added.
<geoexttoolbar>
<name>W_MyToolbar</name>
<options>
<widgets>
<widget>W_MyQuery</widget>
<widget>W_MyMeasureTool</widget>
</widgets>
</options>
</geoexttoolbar>
Toolbar using a separator.
<geoexttoolbar>
<name>W_GeoExtToolbar</name>
<options>
<widgets>
<widget>W_MeasureToolLength_One</widget>
<widget>W_MeasureToolLength_Two</widget>
<widget>W_MeasureToolLength_Three</widget>
<widget>__separator__</widget>
<widget>W_MeasureToolArea_One</widget>
<widget>W_MeasureToolArea_Two</widget>
<widget>W_MeasureToolArea_Three</widget>
</widgets>
</options>
</geoexttoolbar>
Toolbar with custom controls.
<geoexttoolbar>
<name>GeoExtToolbar</name>
<options>
<controls>
<control>Pan</control>
<control>ZoomIn</control>
<control>ZoomOut</control>
<control>Separator</control>
</controls>
<widgets />
</options>
</geoexttoolbar>
The toolbar widget must be drawn inside the GeoExt.MapPanel object. Here’s an example :
oMyMapPanel = {
id: 'gpDefaultMap',
xtype: 'gx_mappanel',
title: 'Map',
layout: 'fit',
region: 'center',
border: false,
height: 800,
width: 800,
<xsl:call-template name="geoexttoolbar:drawWidgets"/>
map: oMap
};
Note
The call-template must not be used as the last item since it outputs a ‘,’.
Here’s an output example : tbar: objGPWidgetW_MyToolbar,
N/A
widgets: | Contains <widget> tags |
---|---|
widgets/widget: | Must be in the <widgets> tag. Name of a widget to add in the toolbar. It can also have “GeoPrisma-specific” values such as :
|
scrollDelay: | Can have an integer value or false. Default is 100 if not set. If set, only one zoom event will be performed after the delay when the Navigation control is active. |
controls: | Contains <control> tags. If not defined, the default controls are automatically added to the toolbar, in a predefined order. |
controls/control: | |
Must be in the <controls> tag. Add a specific control to the toolbar. The order of the <control> tags determines the order they are added in the toolbar. Possible values are (Case sensitive):
Note each control must appear only once. |
|
separateEditFeatureWidgets: | |
(Boolean) Defaults to true. Whether a separator should be added between editfeature widgets from different resources. |
Warning
The old widgets/separator option has been replaced by widgets/widget with value equal to __separator__. The old method is no longer supported.
N/A
read