Package com.jbstrap.jbmap.layers.layer
Class Circle
- All Implemented Interfaces:
com.jbstrap.core.event.handlers.BrowserEventHandler
,PopupDrawnEventHandler
,PopupHideEventHandler
,LayerStyleLayer<Circle>
,TooltipLayer<Circle>
public class Circle
extends BaseLayer<Circle>
implements PopupDrawnEventHandler, PopupHideEventHandler, TooltipLayer<Circle>, LayerStyleLayer<Circle>
This class represents a circle shape on the map.
You can add a tooltip that you can configure freely. Read more about tooltip configuration in the
TooltipLayer
class.
You can add a layer style to the circle. Read more about layer style configuration in the LayerStyleLayer
class.- Since:
- 4.0
- See Also:
-
Field Summary
Fields inherited from class com.jbstrap.jbmap.layers.BaseLayer
COORDINATES, layerStyle, NAME, POINT, POINT_TYPE, popup, POPUP_CONTENT, POPUP_ENABLED, POPUP_OPENED, TYPE
Fields inherited from class com.jbstrap.jbmap.layers.Layer
componentContent, params, parent
Fields inherited from interface com.jbstrap.jbmap.layers.LayerStyleLayer
STYLE
Fields inherited from interface com.jbstrap.jbmap.layers.TooltipLayer
TOOLTIP_CONTENT, TOOLTIP_ENABLED, TOOLTIP_OPENED
-
Constructor Summary
ConstructorDescriptionCircle
(String name, Coordinates coordinates) Creates a circle shape with 5 km radius.Circle
(String name, Coordinates coordinates, int radius) Creates a center shape. -
Method Summary
Modifier and TypeMethodDescriptionGets the circle center coordinates.int
Gets the circle radius.void
onPopupDrawn
(PopupDrawnEvent event) Registering the events for the popup draw event in the popup component.void
onPopupHide
(PopupHideEvent event) Registering the events for the popup hide event in the popup component.setCoordinates
(Coordinates coordinates) Sets the circle center coordinates.setRadius
(int radius) Sets the circle radius.Methods inherited from class com.jbstrap.jbmap.layers.BaseLayer
addClickHandler, addCustomParam, addMouseOutHandler, addMouseOverHandler, closePopup, getClickHandlers, getCustomParams, getGeometry, getMouseOutHandlers, getMouseOverHandlers, getName, getParams, getParent, getPopup, getPopupContent, getProperties, getTitle, hide, isPopupEnabled, isShown, openPopup, removeClickHandler, removeCustomParam, removeMouseOutHandler, removeMouseOverHandler, runJSLayer, runJSLayerGroup, setCoordinates, setCustomParams, setParent, setPopupContent, setPopupEnabled, setTitle, show
Methods inherited from class com.jbstrap.jbmap.layers.Layer
getContent, runAfterDrawOnLayer, runOnHideOnLayer, runOnShowOnLayer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.jbmap.layers.LayerStyleLayer
getLayerStyle, setLayerStyle
Methods inherited from interface com.jbstrap.jbmap.layers.TooltipLayer
closeTooltip, getTooltipContent, isTooltipEnabled, isTooltipOpened, openTooltip, setTooltipContent, setTooltipEnabled
-
Constructor Details
-
Circle
Creates a circle shape with 5 km radius.- Parameters:
name
- Unique IDcoordinates
- Circle center coordinates- Throws:
NullPointerException
- Thrown if the value of thename
orcoordinates
parameter isnull
-
Circle
Creates a center shape.- Parameters:
name
- Unique IDcoordinates
- Circle center coordinatesradius
- Circle radius (meters)- Throws:
NullPointerException
- Thrown if the value of thename
orcoordinates
parameter isnull
-
-
Method Details
-
getCoordinates
Gets the circle center coordinates.- Returns:
- Circle center coordinates
-
setCoordinates
Sets the circle center coordinates.- Parameters:
coordinates
- A Coordinates type object that contains longitude and latitude values- Returns:
- The instantiated Circle class
-
getRadius
public int getRadius()Gets the circle radius.- Returns:
- The circle radius in meters
-
setRadius
Sets the circle radius.- Parameters:
radius
- The circle radius in meters- Returns:
- The instantiated Circle class
-
onPopupDrawn
Registering the events for the popup draw event in the popup component.- Specified by:
onPopupDrawn
in interfacePopupDrawnEventHandler
- Parameters:
event
- The popup drawn event component
-
onPopupHide
Registering the events for the popup hide event in the popup component.- Specified by:
onPopupHide
in interfacePopupHideEventHandler
- Parameters:
event
- The popup hide event component
-