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
String
using the widgetGoogleMapWidget
.lat:50.953412,lng:6.956534,zoom:13,width:400,height:300,mode:dynamic,type:hybrid
Available 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 class
CmsLocationPickerWidgetValue.MapMode
Enumeration class for defining the map mode.static class
CmsLocationPickerWidgetValue.MapType
Enumeration class for defining the map types.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_HEIGHT
The default map height in pixels.static float
DEFAULT_LAT
The default latitude.static float
DEFAULT_LNG
The default longitude.static CmsLocationPickerWidgetValue.MapMode
DEFAULT_MODE
The default map mode.static CmsLocationPickerWidgetValue.MapType
DEFAULT_TYPE
The default map type.static int
DEFAULT_WIDTH
The default map width in pixels.static int
DEFAULT_ZOOM
The default zoom level.static java.lang.String
OPTION_HEIGHT
Option height.static java.lang.String
OPTION_LAT
Option lat.static java.lang.String
OPTION_LNG
Option lng.static java.lang.String
OPTION_MODE
Option mode.static java.lang.String
OPTION_TYPE
Option type.static java.lang.String
OPTION_WIDTH
Option width.static java.lang.String
OPTION_ZOOM
Option 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 int
getHeight()
Returns the height.float
getLat()
Returns the lat.float
getLng()
Returns the longitude.CmsLocationPickerWidgetValue.MapMode
getMode()
Returns the mode.CmsLocationPickerWidgetValue.MapType
getType()
Returns the type.int
getWidth()
Returns the width.int
getZoom()
Returns the zoom.protected void
parseOptions(java.lang.String configuration)
Parses the given configuration String.void
setHeight(int height)
Sets the height.void
setLat(float lat)
Sets the latitude.void
setLng(float lng)
Sets the longitude.void
setMode(CmsLocationPickerWidgetValue.MapMode mode)
Sets the mode.void
setType(CmsLocationPickerWidgetValue.MapType type)
Sets the type.void
setWidth(int width)
Sets the width.void
setWrappedValue(java.lang.String value)
Sets the value that is wrapped.void
setZoom(int zoom)
Sets the zoom.java.lang.String
toString()
-
-
-
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:
toString
in 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
-
-