Package org.opencms.widgets
Class CmsLocationPickerWidgetValue
- java.lang.Object
-
- org.opencms.widgets.CmsLocationPickerWidgetValue
-
public class CmsLocationPickerWidgetValue extends java.lang.Object
A value of the google map widget.This is the parsed value of an element of the type
Stringusing the widgetGoogleMapWidget.lat:50.953412,lng:6.956534,zoom:13,width:400,height:300,mode:dynamic,type:hybridAvailable options are:
lat:50.953412: the latitudelng:6.956534: the longitudezoom:7: initial zoom levelwidth:300: map width in pixels or %height:200: map height in pixels or %mode:'static': the front-end map's mode should be dynamic or statictype:'hybrid': the map type, which can be normal, hybrid, satellite and physical
- Since:
- 7.0.5
- Version:
- $Revision: 1.1 $
- Author:
- Michael Moossen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCmsLocationPickerWidgetValue.MapModeEnumeration class for defining the map mode.static classCmsLocationPickerWidgetValue.MapTypeEnumeration class for defining the map types.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_HEIGHTThe default map height in pixels.static floatDEFAULT_LATThe default latitude.static floatDEFAULT_LNGThe default longitude.static CmsLocationPickerWidgetValue.MapModeDEFAULT_MODEThe default map mode.static CmsLocationPickerWidgetValue.MapTypeDEFAULT_TYPEThe default map type.static intDEFAULT_WIDTHThe default map width in pixels.static intDEFAULT_ZOOMThe default zoom level.static java.lang.StringOPTION_HEIGHTOption height.static java.lang.StringOPTION_LATOption lat.static java.lang.StringOPTION_LNGOption lng.static java.lang.StringOPTION_MODEOption mode.static java.lang.StringOPTION_TYPEOption type.static java.lang.StringOPTION_WIDTHOption width.static java.lang.StringOPTION_ZOOMOption zoom.
-
Constructor Summary
Constructors Constructor Description CmsLocationPickerWidgetValue()Creates a new empty widget option object.CmsLocationPickerWidgetValue(java.lang.String value)Creates a new widget value object, configured by the given value String.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHeight()Returns the height.floatgetLat()Returns the lat.floatgetLng()Returns the longitude.CmsLocationPickerWidgetValue.MapModegetMode()Returns the mode.CmsLocationPickerWidgetValue.MapTypegetType()Returns the type.intgetWidth()Returns the width.intgetZoom()Returns the zoom.protected voidparseOptions(java.lang.String configuration)Parses the given configuration String.voidsetHeight(int height)Sets the height.voidsetLat(float lat)Sets the latitude.voidsetLng(float lng)Sets the longitude.voidsetMode(CmsLocationPickerWidgetValue.MapMode mode)Sets the mode.voidsetType(CmsLocationPickerWidgetValue.MapType type)Sets the type.voidsetWidth(int width)Sets the width.voidsetWrappedValue(java.lang.String value)Sets the value that is wrapped.voidsetZoom(int zoom)Sets the zoom.java.lang.StringtoString()
-
-
-
Field Detail
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT
The default map height in pixels.- See Also:
- Constant Field Values
-
DEFAULT_LAT
public static final float DEFAULT_LAT
The default latitude.- See Also:
- Constant Field Values
-
DEFAULT_LNG
public static final float DEFAULT_LNG
The default longitude.- See Also:
- Constant Field Values
-
DEFAULT_MODE
public static final CmsLocationPickerWidgetValue.MapMode DEFAULT_MODE
The default map mode.
-
DEFAULT_TYPE
public static final CmsLocationPickerWidgetValue.MapType DEFAULT_TYPE
The default map type.
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH
The default map width in pixels.- See Also:
- Constant Field Values
-
DEFAULT_ZOOM
public static final int DEFAULT_ZOOM
The default zoom level.- See Also:
- Constant Field Values
-
OPTION_HEIGHT
public static final java.lang.String OPTION_HEIGHT
Option height.- See Also:
- Constant Field Values
-
OPTION_LAT
public static final java.lang.String OPTION_LAT
Option lat.- See Also:
- Constant Field Values
-
OPTION_LNG
public static final java.lang.String OPTION_LNG
Option lng.- See Also:
- Constant Field Values
-
OPTION_MODE
public static final java.lang.String OPTION_MODE
Option mode.- See Also:
- Constant Field Values
-
OPTION_TYPE
public static final java.lang.String OPTION_TYPE
Option type.- See Also:
- Constant Field Values
-
OPTION_WIDTH
public static final java.lang.String OPTION_WIDTH
Option width.- See Also:
- Constant Field Values
-
OPTION_ZOOM
public static final java.lang.String OPTION_ZOOM
Option zoom.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsLocationPickerWidgetValue
public CmsLocationPickerWidgetValue()
Creates a new empty widget option object.
-
CmsLocationPickerWidgetValue
public CmsLocationPickerWidgetValue(java.lang.String value)
Creates a new widget value object, configured by the given value String.- Parameters:
value- the value String to parse
-
-
Method Detail
-
getHeight
public int getHeight()
Returns the height.- Returns:
- the height
-
getLat
public float getLat()
Returns the lat.- Returns:
- the lat
-
getLng
public float getLng()
Returns the longitude.- Returns:
- the longitude
-
getMode
public CmsLocationPickerWidgetValue.MapMode getMode()
Returns the mode.- Returns:
- the mode
-
getType
public CmsLocationPickerWidgetValue.MapType getType()
Returns the type.- Returns:
- the type
-
getWidth
public int getWidth()
Returns the width.- Returns:
- the width
-
getZoom
public int getZoom()
Returns the zoom.- Returns:
- the zoom
-
setHeight
public void setHeight(int height)
Sets the height.- Parameters:
height- the height to set
-
setLat
public void setLat(float lat)
Sets the latitude.- Parameters:
lat- the latitude to set
-
setLng
public void setLng(float lng)
Sets the longitude.- Parameters:
lng- the longitude to set
-
setMode
public void setMode(CmsLocationPickerWidgetValue.MapMode mode)
Sets the mode.- Parameters:
mode- the mode to set
-
setType
public void setType(CmsLocationPickerWidgetValue.MapType type)
Sets the type.- Parameters:
type- the type to set
-
setWidth
public void setWidth(int width)
Sets the width.- Parameters:
width- the width to set
-
setWrappedValue
public void setWrappedValue(java.lang.String value)
Sets the value that is wrapped. The method is added for convenient usage of the class in JSPs. In a formatter JSP you can use
instead of setting the value directly via the constructor.- Parameters:
value- The string value that should be wrapped as CmsLocationPickerWidgetValue.
-
setZoom
public void setZoom(int zoom)
Sets the zoom.- Parameters:
zoom- the zoom to set
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
parseOptions
protected void parseOptions(java.lang.String configuration)
Parses the given configuration String.- Parameters:
configuration- the configuration String to parse
-
-