Heron.widgets.search.CoordSearchPanel
¶
-
class
Heron.widgets.search.
CoordSearchPanel
(config)¶ A specific
Ext.form.FormPanel
whose internal form is aExt.form.BasicForm
. Use this form to do pan and zoom to a point in the map. The coordinates are typed in by the user.
Example Use¶
Sample code showing how to use the CoordSearchPanel.
var panel = new Heron.widgets.search.CoordSearchPanel({
xtype: 'hr_coordsearchpanel',
id: 'hr-coordsearchpanelRD',
title: 'Go to Coordinates (Dutch RD)',
height: 150,
border: true,
collapsible: true,
collapsed: true,
onZoomLevel: 8,
hropts: [ {
projEpsg: 'EPSG:28992',
projDesc: 'Amersfoort / RD New',
localIconFile: 'redpin.png',
fieldLabelX: 'x (Dutch RD)',
fieldLabelY: 'y (Dutch RD)'
}
]
}
});
IMPORTANT If using the zoom option (showZoom: true) the global ‘map’ must already be initialized - otherwise the zoom combo box will not contain any scale values! This happens for example if the ‘hr_coordsearchpanel’ is defined BEFORE the ‘hr_mappanel’. The solution is: ALWAYS define the ‘hr_mappanel’ as the FIRST element in the layout tree - this ensures that the ‘map’ is initialized properly. See ‘coordsearch’ demo - here is the right coding scheme:
Heron.layout = {
xtype: 'panel',
id: 'hr-container-main',
items: [ {
xtype: 'panel',
id: 'hr-map-and-info-container',
layout: 'border',
region: 'center',
width: '100%',
collapsible: true,
split: true,
border: false,
items: [ {
xtype: 'hr_mappanel', // FIRST
id: 'hr-map',
region: 'center',
collapsible : false,
border: false,
hropts: Heron.options.map
} ]
},
{
xtype: 'panel',
id: 'hr-menu-left-container',
layout: 'accordion',
region: "west",
width: 270,
collapsible: true,
split: true,
border: false,
items: [ {
xtype: 'hr_coordsearchpanel', // SECOND
id: 'hr-coordsearchpanel',
title: 'Go to Coordinates (Lon/Lat)',
height: 150,
border: true,
collapsible: true,
collapsed: false,
fieldLabelWidth: 50,
onZoomLevel: 6,
showZoom: true,
layerName: 'Location Europe - Lon/Lat',
hropts: [ {
fieldLabelX: 'Lon',
fieldLabelY: 'Lat',
fieldEmptyTextX: 'Enter Lon-coordinate...',
fieldEmptyTextY: 'Enter Lat-coordinate...'
} ]
},
Config Options¶
Configuration properties in addition to those listed for Ext.form.FormPanel.
-
bodyBaseCls
body base cls default value is ‘x-panel’.
-
bodyCls
cls for setting the font features (example: ‘hr-html-panel-font-size-11’) of the form items default value is “null”.
-
bodyItemCls
item cls for setting the font features (example: ‘hr-html-panel-font-size-11’) of the form items default value is “null”.
-
buttonAlign
Alignment of the button(s) - ‘left’, ‘center’, ‘right’ - in the form default value is ‘left’.
-
checkAddMarkers
Boolean
If set to true, the AddMarkers option will be set. If set to false, no AddMarkers option will be set. Default is false.
-
checkHideMarkers
Boolean
If set to true, the HideMarkers option will be set. If set to false, no HideMarkers option will be set. Default is false.
-
fieldDecPrecision
precision of the input coordinate fields default value is 2.
-
fieldLabelStyle
field label style (e.g. ‘color: red;’) or null default value is “null”.
-
fieldLabelWidth
field label width for the input fields default value is ‘’.
-
fieldMaxWidth
field max width for the input fields default value is 200.
-
fieldResultMarkerPrecision
precision of the marker coordinates default value is 2.
-
fieldResultMarkerSeparator
field text coordinates seperator default value is ” , “.
-
fieldResultMarkerStyle
field style (e.g. ‘color: green;’) or null default value is “null”.
-
fieldResultMarkerText
field text label of the result or null default value is “Marker position: “.
-
fieldStyle
field style (e.g. ‘color: green;’) or null default value is “null”.
-
hropts
user defined projection array. default value is “null” - no transformation will be done.
-
layerName
layer name of the location marker.
-
onProjectionIndex
Start index entry of the projection combobox default value is 0 (first combobox entry).
-
onZoomLevel
zoomlevel when moving to point. default value is -1 (no zoom).
-
removeMarkersOnClose
Boolean
If set to true, the markers will be removed from the layer when the form is closed. If set to false, the markers layer will be hidden without removing them. Default is false.
-
showAddMarkers
Boolean
If set to true, the AddMarkers checkbox will be shown. If set to false, no AddMarkers checkbox will be shown. Default is false.
-
showHideMarkers
Boolean
If set to true, the HideMarkers checkbox will be shown. If set to false, no HideMarkers checkbox will be shown. Default is false.
-
showProjection
Boolean
If set to true, the projection combobox will be shown. If set to false, an input system selection will not be possible. Default is false.
-
showRemoveMarkersBtn
Boolean
If set to true, the RemoveMarkers button will be shown. If set to false, no RemoveMarkers button will be shown. Default is false.
-
showResultMarker
Boolean
If set to true, the result coordinates will be shown. If set to false, no result coordinates will be shown. Default is false.
-
showZoom
Boolean
If set to true, the zoom combobox will be shown. If set to false, a zoom selection will not be possible. Default is false.
-
title
title of the panel default value is ‘Go to coordinates’.
-
titleDescription
description line under the title line default value is “null”.
-
titleDescriptionStyle
title description style (e.g. ‘font-size: 11px;’) or null default value is “null”.